/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */

window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","esri.tasks.geometry"],["require","esri.tasks._task"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri.tasks.geometry"]){_4._hasResource["esri.tasks.geometry"]=true;_4.provide("esri.tasks.geometry");_4.require("esri.tasks._task");_4.declare("esri.tasks.GeometryService",esri.tasks._Task,{constructor:function(_7){var _8=_4.hitch;this._projectHandler=_8(this,this._projectHandler);this._simplifyHandler=_8(this,this._simplifyHandler);this._bufferHandler=_8(this,this._bufferHandler);this._areasAndLengthsHandler=_8(this,this._areasAndLengthsHandler);this._lengthsHandler=_8(this,this._lengthsHandler);this._labelPointsHandler=_8(this,this._labelPointsHandler);this._relationHandler=_8(this,this._relationHandler);this._convexHullHandler=_8(this,this._convexHullHandler);this._unionHandler=_8(this,this._unionHandler);this._autoCompleteHandler=_8(this,this._autoCompleteHandler);this._reshapeHandler=_8(this,this._reshapeHandler);this._cutHandler=_8(this,this._cutHandler);this._intersectHandler=_8(this,this._intersectHandler);this._differenceHandler=_8(this,this._differenceHandler);this._trimExtendHandler=_8(this,this._trimExtendHandler);this._densifyHandler=_8(this,this._densifyHandler);this._generalizeHandler=_8(this,this._densifyHandler);this._offsetHandler=_8(this,this._offsetHandler);this._distanceHandler=_8(this,this._distanceHandler);},_encodeGeometries:function(_9){var gs=[];for(var i=0,il=_9.length;i<il;i++){gs.push(_9[i].toJson());}return {geometryType:esri.geometry.getJsonType(_9[0]),geometries:gs};},_decodeGeometries:function(_a,_b,sr){var _c=esri.geometry.getGeometryType(_b),_d=_a.geometries,fs=[],_e={spatialReference:sr.toJson()},_f=_4.mixin;_4.forEach(_d,function(g,i){fs[i]=new _c(_f(g,_e));});return fs;},_toProjectGeometry:function(_10){var sr=_10.spatialReference.toJson();if(_10 instanceof esri.geometry.Extent){return new esri.geometry.Polygon({rings:[[[_10.xmin,_10.ymin],[_10.xmin,_10.ymax],[_10.xmax,_10.ymax],[_10.xmax,_10.ymin],[_10.xmin,_10.ymin]]],spatialReference:sr});}else{return new esri.geometry.Polyline({paths:[[].concat(_10.points)],spatialReference:sr});}},_fromProjectedGeometry:function(_11,_12,_13){if(_12==="esriGeometryEnvelope"){var _14=_11.rings[0];return new esri.geometry.Extent(_14[0][0],_14[0][1],_14[2][0],_14[2][1],_13);}else{return new esri.geometry.Multipoint({points:_11.paths[0],spatialReference:_13.toJson()});}},project:function(_15,_16,_17,_18){var _19=_15[0];var _1a=_4.mixin({},this._url.query,{f:"json",outSR:_16.wkid?_16.wkid:_4.toJson(_16.toJson()),inSR:_19.spatialReference.wkid?_19.spatialReference.wkid:_4.toJson(_19.spatialReference.toJson()),geometries:_4.toJson(this._encodeGeometries(_15))}),_1b=esri.geometry.getJsonType(_15[0]),_1c=this._projectHandler,_1d=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/project",content:_1a,callbackParamName:"callback",load:(function(r,i){_1c(r,i,_1b,_16,_17,_18,dfd);}),error:(function(r){_1d(r,_18,dfd);})});return dfd;},_projectHandler:function(_1e,io,_1f,_20,_21,_22,dfd){try{var fs=this._decodeGeometries(_1e,_1f,_20);this._successHandler([fs],"onProjectComplete",_21,dfd);}catch(err){this._errorHandler(err,_22,dfd);}},onProjectComplete:function(){},simplify:function(_23,_24,_25){var _26=_23[0].spatialReference;var _27=_4.mixin({},this._url.query,{f:"json",sr:_26.wkid?_26.wkid:_4.toJson(_26.toJson()),geometries:_4.toJson(this._encodeGeometries(_23))}),_28=esri.geometry.getJsonType(_23[0]),_29=this._simplifyHandler,_2a=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/simplify",content:_27,callbackParamName:"callback",load:(function(r,i){_29(r,i,_28,_26,_24,_25,dfd);}),error:(function(r){_2a(r,_25,dfd);})});return dfd;},_simplifyHandler:function(_2b,io,_2c,sr,_2d,_2e,dfd){try{var fs=this._decodeGeometries(_2b,_2c,sr);this._successHandler([fs],"onSimplifyComplete",_2d,dfd);}catch(err){this._errorHandler(err,_2e,dfd);}},onSimplifyComplete:function(){},convexHull:function(_2f,_30,_31){var _32=_2f[0].spatialReference;var _33=_4.mixin({},this._url.query,{f:"json",sr:_4.toJson(_32.toJson()),geometries:_4.toJson(this._encodeGeometries(_2f))}),_34=this._convexHullHandler,_35=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/convexHull",content:_33,callbackParamName:"callback",load:(function(r,i){_34(r,i,_32,_30,_31,dfd);}),error:(function(r){_35(r,_31,dfd);})});return dfd;},_convexHullHandler:function(_36,io,_37,_38,_39,dfd){try{var _3a=esri.geometry.fromJson(_36.geometry).setSpatialReference(_37);this._successHandler([_3a],"onConvexHullComplete",_38,dfd);}catch(err){this._errorHandler(err,_39,dfd);}},onConvexHullComplete:function(){},union:function(_3b,_3c,_3d){var _3e=_3b[0].spatialReference;var _3f=_4.mixin({},this._url.query,{f:"json",sr:_4.toJson(_3e.toJson()),geometries:_4.toJson(this._encodeGeometries(_3b))}),_40=this._unionHandler,_41=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/union",content:_3f,callbackParamName:"callback",load:(function(r,i){_40(r,i,_3e,_3c,_3d,dfd);}),error:(function(r){_41(r,_3d,dfd);})});return dfd;},_unionHandler:function(_42,io,_43,_44,_45,dfd){try{var _46=esri.geometry.fromJson(_42.geometry).setSpatialReference(_43);this._successHandler([_46],"onUnionComplete",_44,dfd);}catch(err){this._errorHandler(err,_45,dfd);}},onUnionComplete:function(){},autoComplete:function(_47,_48,_49,_4a){var _4b=_47[0].spatialReference;var _4c=_4.mixin({},this._url.query,{f:"json",sr:_4.toJson(_4b.toJson()),polygons:_4.toJson(this._encodeGeometries(_47).geometries),polylines:_4.toJson(this._encodeGeometries(_48).geometries)}),_4d=this._autoCompleteHandler,_4e=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/autoComplete",content:_4c,callbackParamName:"callback",load:(function(r,i){_4d(r,i,_4b,_49,_4a,dfd);}),error:(function(r){_4e(r,_4a,dfd);})});return dfd;},_autoCompleteHandler:function(_4f,io,_50,_51,_52,dfd){try{var _53=esri.geometry.Polygon,_54=_4f.geometries,_55=[];for(var i=0,il=_54.length;i<il;i++){_55[i]=new _53({spatialReference:_50,rings:_54[i].rings});}this._successHandler([_55],"onAutoCompleteComplete",_51,dfd);}catch(err){this._errorHandler(err,_52,dfd);}},onAutoCompleteComplete:function(){},reshape:function(_56,_57,_58,_59){var _5a=_56.spatialReference;var _5b=_4.mixin({},this._url.query,{f:"json",sr:_4.toJson(_5a.toJson()),target:_4.toJson({geometryType:esri.geometry.getJsonType(_56),geometry:_56.toJson()}),reshaper:_4.toJson(_57.toJson())}),_5c=this._reshapeHandler,_5d=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/reshape",content:_5b,callbackParamName:"callback",load:(function(r,i){_5c(r,i,_5a,_58,_59,dfd);}),error:(function(r){_5d(r,_59,dfd);})});return dfd;},_reshapeHandler:function(_5e,io,_5f,_60,_61,dfd){try{var _62=esri.geometry.fromJson(_5e.geometry).setSpatialReference(_5f);this._successHandler([_62],"onReshapeComplete",_60,dfd);}catch(err){this._errorHandler(err,_61,dfd);}},onReshapeComplete:function(){},cut:function(_63,_64,_65,_66){var _67=_63[0].spatialReference;var _68=_4.map(_63,function(_69){return _69.toJson();});var _6a=_4.mixin({},this._url.query,{f:"json",sr:_4.toJson(_67.toJson()),target:_4.toJson({geometryType:esri.geometry.getJsonType(_63[0]),geometries:_68}),cutter:_4.toJson(_64.toJson())}),_6b=this._cutHandler,_6c=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/cut",content:_6a,callbackParamName:"callback",load:(function(r,i){_6b(r,i,_67,_65,_66,dfd);}),error:(function(r){_6c(r,_66,dfd);})});return dfd;},_cutHandler:function(_6d,io,_6e,_6f,_70,dfd){try{var _71=_6d.geometries;var _72={};_72.cutIndexes=_6d.cutIndexes;_72.geometries=[];_4.forEach(_71,function(_73){_72.geometries.push(esri.geometry.fromJson(_73).setSpatialReference(_6e));});this._successHandler([_72],"onCutComplete",_6f,dfd);}catch(err){this._errorHandler(err,_70,dfd);}},onCutComplete:function(){},intersect:function(_74,_75,_76,_77){var _78=_74[0].spatialReference;var _79=_4.mixin({},this._url.query,{f:"json",sr:_4.toJson(_78.toJson()),geometries:_4.toJson(this._encodeGeometries(_74)),geometry:_4.toJson({geometryType:esri.geometry.getJsonType(_75),geometry:_75.toJson()})}),_7a=this._intersectHandler,_7b=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/intersect",content:_79,callbackParamName:"callback",load:(function(r,i){_7a(r,i,_78,_76,_77,dfd);}),error:(function(r){_7b(r,_77,dfd);})});return dfd;},_intersectHandler:function(_7c,io,_7d,_7e,_7f,dfd){try{var _80=_7c.geometries,_81=[];_4.forEach(_80,function(_82){_81.push(esri.geometry.fromJson(_82).setSpatialReference(_7d));});this._successHandler([_81],"onIntersectComplete",_7e,dfd);}catch(err){this._errorHandler(err,_7f,dfd);}},onIntersectComplete:function(){},difference:function(_83,_84,_85,_86){var _87=_83[0].spatialReference;var _88=_4.mixin({},this._url.query,{f:"json",sr:_4.toJson(_87.toJson()),geometries:_4.toJson(this._encodeGeometries(_83)),geometry:_4.toJson({geometryType:esri.geometry.getJsonType(_84),geometry:_84.toJson()})}),_89=this._differenceHandler,_8a=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/difference",content:_88,callbackParamName:"callback",load:(function(r,i){_89(r,i,_87,_85,_86,dfd);}),error:(function(r){_8a(r,_86,dfd);})});return dfd;},_differenceHandler:function(_8b,io,_8c,_8d,_8e,dfd){try{var _8f=_8b.geometries,_90=[];_4.forEach(_8f,function(_91){_90.push(esri.geometry.fromJson(_91).setSpatialReference(_8c));});this._successHandler([_90],"onDifferenceComplete",_8d,dfd);}catch(err){this._errorHandler(err,_8e,dfd);}},onDifferenceComplete:function(){},buffer:function(_92,_93,_94){var _95=_4.mixin({},this._url.query,{f:"json"},_92.toJson()),sr=_92.outSpatialReference||_92.geometries[0].spatialReference,_96=this._bufferHandler,_97=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/buffer",content:_95,callbackParamName:"callback",load:(function(r,i){_96(r,i,sr,_93,_94,dfd);}),error:(function(r){_97(r,_94,dfd);})});return dfd;},_bufferHandler:function(_98,io,sr,_99,_9a,dfd){try{var _9b=esri.geometry.Polygon,_9c=_98.geometries,_9d=[];for(var i=0,il=_9c.length;i<il;i++){_9d[i]=new _9b({spatialReference:sr,rings:_9c[i].rings});}this._successHandler([_9d],"onBufferComplete",_99,dfd);}catch(err){this._errorHandler(err,_9a,dfd);}},onBufferComplete:function(){},areasAndLengths:function(_9e,_9f,_a0){var _a1=_4.mixin({},this._url.query,{f:"json"},_9e.toJson()),_a2=this._areasAndLengthsHandler,_a3=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/areasAndLengths",content:_a1,callbackParamName:"callback",load:(function(r,i){_a2(r,i,_9f,_a0,dfd);}),error:(function(r){_a3(r,_a0,dfd);})});return dfd;},_areasAndLengthsHandler:function(_a4,io,_a5,_a6,dfd){try{this._successHandler([_a4],"onAreasAndLengthsComplete",_a5,dfd);}catch(err){this._errorHandler(err,_a6,dfd);}},onAreasAndLengthsComplete:function(){},lengths:function(_a7,_a8,_a9){var _aa=_4.mixin({},this._url.query,{f:"json"},_a7.toJson()),_ab=this._lengthsHandler,_ac=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/lengths",content:_aa,callbackParamName:"callback",load:(function(r,i){_ab(r,i,_a8,_a9,dfd);}),error:(function(r){_ac(r,_a9,dfd);})});return dfd;},_lengthsHandler:function(_ad,io,_ae,_af,dfd){try{this._successHandler([_ad],"onLengthsComplete",_ae,dfd);}catch(err){this._errorHandler(err,_af,dfd);}},onLengthsComplete:function(){},labelPoints:function(_b0,_b1,_b2){var _b3=_4.map(_b0,function(_b4){return _b4.toJson();});var sr=_b0[0].spatialReference,_b5=_4.mixin({},this._url.query,{f:"json",sr:sr.wkid?sr.wkid:_4.toJson(sr.toJson()),polygons:_4.toJson(_b3)}),_b6=this._labelPointsHandler,_b7=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/labelPoints",content:_b5,callbackParamName:"callback",load:(function(r,i){_b6(r,i,_b0,sr,_b1,_b2,dfd);}),error:(function(r){_b7(r,_b2,dfd);})});return dfd;},_labelPointsHandler:function(_b8,io,_b9,sr,_ba,_bb,dfd){try{var _bc=_b8.labelPoints,_bd=[];_4.forEach(_bc,function(_be){_bd.push(esri.geometry.fromJson(_be).setSpatialReference(sr));});this._successHandler([_bd],"onLabelPointsComplete",_ba,dfd);}catch(err){this._errorHandler(err,_bb,dfd);}},onLabelPointsComplete:function(){},relation:function(_bf,_c0,_c1){var _c2=_4.mixin({},this._url.query,{f:"json"},_bf.toJson()),_c3=this._relationHandler,_c4=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/relation",content:_c2,callbackParamName:"callback",load:(function(r,i){_c3(r,i,_c0,_c1,dfd);}),error:(function(r){_c4(r,_c1,dfd);})});return dfd;},_relationHandler:function(_c5,io,_c6,_c7,dfd){try{var _c8=_c5.relations;this._successHandler([_c8],"onRelationComplete",_c6,dfd);}catch(err){this._errorHandler(err,_c7,dfd);}},onRelationComplete:function(){},trimExtend:function(_c9,_ca,_cb){var _cc=_4.mixin({},this._url.query,{f:"json"},_c9.toJson()),_cd=_c9.sr,_ce=this._trimExtendHandler,_cf=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/trimExtend",content:_cc,callbackParamName:"callback",load:(function(r,i){_ce(r,i,_cd,_ca,_cb,dfd);}),error:(function(r){_cf(r,_cb,dfd);})});return dfd;},_trimExtendHandler:function(_d0,io,_d1,_d2,_d3,dfd){try{var _d4=esri.geometry.Polyline,_d5=_d0.geometries,_d6=[];for(var i=0,il=_d5.length;i<il;i++){_d6[i]=new _d4({spatialReference:_d1,paths:_d5[i].paths});}this._successHandler([_d6],"onTrimExtendComplete",_d2,dfd);}catch(err){this._errorHandler(err,_d3,dfd);}},onTrimExtendComplete:function(){},densify:function(_d7,_d8,_d9){var _da=_4.mixin({},this._url.query,{f:"json"},_d7.toJson()),_db=_d7.geometries[0].spatialReference,_dc=this._densifyHandler,_dd=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/densify",content:_da,callbackParamName:"callback",load:(function(r,i){_dc(r,i,_db,_d8,_d9,dfd);}),error:(function(r){_dd(r,_d9,dfd);})});return dfd;},_densifyHandler:function(_de,io,_df,_e0,_e1,dfd){try{var _e2=_de.geometries,_e3=[];_4.forEach(_e2,function(_e4){_e3.push(esri.geometry.fromJson(_e4).setSpatialReference(_df));});this._successHandler([_e3],"onDensifyComplete",_e0,dfd);}catch(err){this._errorHandler(err,_e1,dfd);}},onDensifyComplete:function(){},generalize:function(_e5,_e6,_e7){var _e8=_4.mixin({},this._url.query,{f:"json"},_e5.toJson()),_e9=_e5.geometries[0].spatialReference,_ea=this._generalizeHandler,_eb=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/generalize",content:_e8,callbackParamName:"callback",load:(function(r,i){_ea(r,i,_e9,_e6,_e7,dfd);}),error:(function(r){_eb(r,_e7,dfd);})});return dfd;},_generalizeHandler:function(_ec,io,_ed,_ee,_ef,dfd){try{var _f0=_ec.geometries,_f1=[];_4.forEach(_f0,function(_f2){_f1.push(esri.geometry.fromJson(_f2).setSpatialReference(_ed));});this._successHandler([_f1],"onGeneralizeComplete",_ee,dfd);}catch(err){this._errorHandler(err,_ef,dfd);}},onGeneralizeComplete:function(){},offset:function(_f3,_f4,_f5){var _f6=_4.mixin({},this._url.query,{f:"json"},_f3.toJson()),_f7=_f3.geometries[0].spatialReference,_f8=this._offsetHandler,_f9=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/offset",content:_f6,callbackParamName:"callback",load:(function(r,i){_f8(r,i,_f7,_f4,_f5,dfd);}),error:(function(r){_f9(r,_f5,dfd);})});return dfd;},_offsetHandler:function(_fa,io,_fb,_fc,_fd,dfd){try{var _fe=_fa.geometries,_ff=[];_4.forEach(_fe,function(geom){_ff.push(esri.geometry.fromJson(geom).setSpatialReference(_fb));});this._successHandler([_ff],"onOffsetComplete",_fc,dfd);}catch(err){this._errorHandler(err,_fd,dfd);}},onOffsetComplete:function(){},distance:function(_100,_101,_102){var _103=_4.mixin({},this._url.query,{f:"json"},_100.toJson()),_104=_100.geometry1.spatialReference,_105=this._distanceHandler,_106=this._errorHandler,dfd=new _4.Deferred(esri._dfdCanceller);dfd._pendingDfd=esri.request({url:this._url.path+"/distance",content:_103,callbackParamName:"callback",load:(function(r,i){_105(r,i,_104,_101,_102,dfd);}),error:(function(r){_106(r,_102,dfd);})});return dfd;},_distanceHandler:function(_107,io,_108,_109,_10a,dfd){try{_107=_107&&_107.distance;this._successHandler([_107],"onDistanceComplete",_109,dfd);}catch(err){this._errorHandler(err,_10a,dfd);}},onDistanceComplete:function(){}});_4.declare("esri.tasks.TrimExtendParameters",null,{polylines:null,trimExtendTo:null,extendHow:null,toJson:function(){var _10b=_4.map(this.polylines,function(geom){return geom.toJson();});var json={};json.polylines=_4.toJson(_10b);json.trimExtendTo=_4.toJson(this.trimExtendTo.toJson());json.sr=_4.toJson(this.polylines[0].spatialReference.toJson());json.extendHow=this.extendHow||0;return json;}});_4.mixin(esri.tasks.TrimExtendParameters,{DEFAULT_CURVE_EXTENSION:0,RELOCATE_ENDS:1,KEEP_END_ATTRIBUTES:2,NO_END_ATTRIBUTES:4,NO_EXTEND_AT_FROM:8,NO_EXTEND_AT_TO:16});_4.declare("esri.tasks.BufferParameters",null,{geometries:null,outSpatialReference:null,bufferSpatialReference:null,distances:null,unit:null,unionResults:false,geodesic:false,toJson:function(){var json={unit:this.unit,unionResults:(""+this.unionResults),geodesic:(""+this.geodesic)},dt=this.distances,_10c=this.outSpatialReference,_10d=this.bufferSpatialReference;var _10e=_4.map(this.geometries,function(geom){geom=(geom.type==="extent")?this._extentToPolygon(geom):geom;return geom.toJson();},this);var _10f=this.geometries;if(_10f&&_10f.length>0){var _110=_10f[0].type==="extent"?"esriGeometryPolygon":esri.geometry.getJsonType(_10f[0]);json.geometries=_4.toJson({geometryType:_110,geometries:_10e});json.inSR=_10f[0].spatialReference.wkid?_10f[0].spatialReference.wkid:_4.toJson(_10f[0].spatialReference.toJson());}if(dt){json.distances=dt.join(",");}if(_10c){json.outSR=_10c.wkid?_10c.wkid:_4.toJson(_10c.toJson());}if(_10d){json.bufferSR=_10d.wkid?_10d.wkid:_4.toJson(_10d.toJson());}return json;},_extentToPolygon:function(_111){var xmin=_111.xmin,ymin=_111.ymin,xmax=_111.xmax,ymax=_111.ymax;return new esri.geometry.Polygon({"rings":[[[xmin,ymin],[xmin,ymax],[xmax,ymax],[xmax,ymin],[xmin,ymin]]],"spatialReference":_111.spatialReference.toJson()});}});_4.mixin(esri.tasks.GeometryService,{UNIT_METER:9001,UNIT_GERMAN_METER:9031,UNIT_FOOT:9002,UNIT_SURVEY_FOOT:9003,UNIT_CLARKE_FOOT:9005,UNIT_FATHOM:9014,UNIT_NAUTICAL_MILE:9030,UNIT_SURVEY_CHAIN:9033,UNIT_SURVEY_LINK:9034,UNIT_SURVEY_MILE:9035,UNIT_KILOMETER:9036,UNIT_CLARKE_YARD:9037,UNIT_CLARKE_CHAIN:9038,UNIT_CLARKE_LINK:9039,UNIT_SEARS_YARD:9040,UNIT_SEARS_FOOT:9041,UNIT_SEARS_CHAIN:9042,UNIT_SEARS_LINK:9043,UNIT_BENOIT_1895A_YARD:9050,UNIT_BENOIT_1895A_FOOT:9051,UNIT_BENOIT_1895A_CHAIN:9052,UNIT_BENOIT_1895A_LINK:9053,UNIT_BENOIT_1895B_YARD:9060,UNIT_BENOIT_1895B_FOOT:9061,UNIT_BENOIT_1895B_CHAIN:9062,UNIT_BENOIT_1895B_LINK:9063,UNIT_INDIAN_FOOT:9080,UNIT_INDIAN_1937_FOOT:9081,UNIT_INDIAN_1962_FOOT:9082,UNIT_INDIAN_1975_FOOT:9083,UNIT_INDIAN_YARD:9084,UNIT_INDIAN_1937_YARD:9085,UNIT_INDIAN_1962_YARD:9086,UNIT_INDIAN_1975_YARD:9087,UNIT_FOOT_1865:9070,UNIT_RADIAN:9101,UNIT_DEGREE:9102,UNIT_ARCMINUTE:9103,UNIT_ARCSECOND:9104,UNIT_GRAD:9105,UNIT_GON:9106,UNIT_MICRORADIAN:9109,UNIT_ARCMINUTE_CENTESIMAL:9112,UNIT_ARCSECOND_CENTESIMAL:9113,UNIT_MIL6400:9114,UNIT_BRITISH_1936_FOOT:9095,UNIT_GOLDCOAST_FOOT:9094,UNIT_INTERNATIONAL_CHAIN:109003,UNIT_INTERNATIONAL_LINK:109004,UNIT_INTERNATIONAL_YARD:109001,UNIT_STATUTE_MILE:9093,UNIT_SURVEY_YARD:109002,UNIT_50KILOMETER_LENGTH:109030,UNIT_150KILOMETER_LENGTH:109031,UNIT_DECIMETER:109005,UNIT_CENTIMETER:109006,UNIT_MILLIMETER:109007,UNIT_INTERNATIONAL_INCH:109008,UNIT_US_SURVEY_INCH:109009,UNIT_INTERNATIONAL_ROD:109010,UNIT_US_SURVEY_ROD:109011,UNIT_US_NAUTICAL_MILE:109012,UNIT_UK_NAUTICAL_MILE:109013,UNIT_SQUARE_INCHES:"esriSquareInches",UNIT_SQUARE_FEET:"esriSquareFeet",UNIT_SQUARE_YARDS:"esriSquareYards",UNIT_ACRES:"esriAcres",UNIT_SQUARE_MILES:"esriSquareMiles",UNIT_SQUARE_MILLIMETERS:"esriSquareMillimeters",UNIT_SQUARE_CENTIMETERS:"esriSquareCentimeters",UNIT_SQUARE_DECIMETERS:"esriSquareDecimeters",UNIT_SQUARE_METERS:"esriSquareMeters",UNIT_ARES:"esriAres",UNIT_HECTARES:"esriHectares",UNIT_SQUARE_KILOMETERS:"esriSquareKilometers"});_4.declare("esri.tasks.AreasAndLengthsParameters",null,{polygons:null,lengthUnit:null,areaUnit:null,toJson:function(){var _112=_4.map(this.polygons,function(geom){return geom.toJson();});var json={};json.polygons=_4.toJson(_112);var _113=this.polygons[0].spatialReference;json.sr=_113.wkid?_113.wkid:_4.toJson(_113.toJson());if(this.lengthUnit){json.lengthUnit=this.lengthUnit;}if(this.areaUnit){if(_4.isString(this.areaUnit)){json.areaUnit=_4.toJson({"areaUnit":this.areaUnit});}else{json.areaUnit=this.areaUnit;}}return json;}});_4.declare("esri.tasks.LengthsParameters",null,{polylines:null,lengthUnit:null,geodesic:null,toJson:function(){var _114=_4.map(this.polylines,function(geom){return geom.toJson();});var json={};json.polylines=_4.toJson(_114);var _115=this.polylines[0].spatialReference;json.sr=_115.wkid?_115.wkid:_4.toJson(_115.toJson());if(this.lengthUnit){json.lengthUnit=this.lengthUnit;}if(this.geodesic){json.geodesic=this.geodesic;}return json;}});_4.declare("esri.tasks.RelationParameters",null,{geometries1:null,geometries2:null,relation:null,relationParam:null,toJson:function(){var _116=_4.map(this.geometries1,function(geom){return geom.toJson();});var _117=_4.map(this.geometries2,function(geom){return geom.toJson();});var json={};var _118=this.geometries1;if(_118&&_118.length>0){json.geometries1=_4.toJson({geometryType:esri.geometry.getJsonType(_118[0]),geometries:_116});var _119=this.geometries1[0].spatialReference;json.sr=_119.wkid?_119.wkid:_4.toJson(_119.toJson());}var _11a=this.geometries2;if(_11a&&_11a.length>0){json.geometries2=_4.toJson({geometryType:esri.geometry.getJsonType(_11a[0]),geometries:_117});}if(this.relation){json.relation=this.relation;}if(this.relationParam){json.relationParam=_4.toJson(this.relationParam);}return json;}});_4.mixin(esri.tasks.RelationParameters,{SPATIAL_REL_CROSS:"esriGeometryRelationCross",SPATIAL_REL_DISJOINT:"esriGeometryRelationDisjoint",SPATIAL_REL_IN:"esriGeometryRelationIn",SPATIAL_REL_INTERIORINTERSECTION:"esriGeometryRelationInteriorIntersection",SPATIAL_REL_INTERSECTION:"esriGeometryRelationIntersection",SPATIAL_REL_COINCIDENCE:"esriGeometryRelationLineCoincidence",SPATIAL_REL_LINETOUCH:"esriGeometryRelationLineTouch",SPATIAL_REL_OVERLAP:"esriGeometryRelationOverlap",SPATIAL_REL_POINTTOUCH:"esriGeometryRelationPointTouch",SPATIAL_REL_TOUCH:"esriGeometryRelationTouch",SPATIAL_REL_WITHIN:"esriGeometryRelationWithin",SPATIAL_REL_RELATION:"esriGeometryRelationRelation"});_4.declare("esri.tasks.DensifyParameters",null,{geometries:null,geodesic:null,lengthUnit:null,maxSegmentLength:null,toJson:function(){var _11b=_4.map(this.geometries,function(geom){return geom.toJson();});var json={};if(this.geometries&&this.geometries.length>0){json.geometries=_4.toJson({geometryType:esri.geometry.getJsonType(this.geometries[0]),geometries:_11b});json.sr=_4.toJson(this.geometries[0].spatialReference.toJson());}if(this.geodesic){json.geodesic=this.geodesic;}if(this.lengthUnit){json.lengthUnit=this.lengthUnit;}if(this.maxSegmentLength){json.maxSegmentLength=this.maxSegmentLength;}return json;}});_4.declare("esri.tasks.GeneralizeParameters",null,{geometries:null,deviationUnit:null,maxDeviation:null,toJson:function(){var _11c=_4.map(this.geometries,function(geom){return geom.toJson();});var json={};if(this.geometries&&this.geometries.length>0){json.geometries=_4.toJson({geometryType:esri.geometry.getJsonType(this.geometries[0]),geometries:_11c});json.sr=_4.toJson(this.geometries[0].spatialReference.toJson());}if(this.deviationUnit){json.deviationUnit=this.deviationUnit;}if(this.maxDeviation){json.maxDeviation=this.maxDeviation;}return json;}});_4.declare("esri.tasks.OffsetParameters",null,{geometries:null,bevelRatio:null,offsetDistance:null,offsetHow:null,offsetUnit:null,toJson:function(){var _11d=_4.map(this.geometries,function(geom){return geom.toJson();});var json={};if(this.geometries&&this.geometries.length>0){json.geometries=_4.toJson({geometryType:esri.geometry.getJsonType(this.geometries[0]),geometries:_11d});json.sr=_4.toJson(this.geometries[0].spatialReference.toJson());}if(this.bevelRatio){json.bevelRatio=this.bevelRatio;}if(this.offsetDistance){json.offsetDistance=this.offsetDistance;}if(this.offsetHow){json.offsetHow=this.offsetHow;}if(this.offsetUnit){json.offsetUnit=this.offsetUnit;}return json;}});_4.mixin(esri.tasks.OffsetParameters,{OFFSET_BEVELLED:"esriGeometryOffsetBevelled",OFFSET_MITERED:"esriGeometryOffsetMitered",OFFSET_ROUNDED:"esriGeometryOffsetRounded"});_4.declare("esri.tasks.DistanceParameters",null,{geometry1:null,geometry2:null,distanceUnit:null,geodesic:null,toJson:function(){var json={};var _11e=this.geometry1;if(_11e){json.geometry1=_4.toJson({geometryType:esri.geometry.getJsonType(_11e),geometry:_11e});}var _11f=this.geometry2;if(_11f){json.geometry2=_4.toJson({geometryType:esri.geometry.getJsonType(_11f),geometry:_11f});}json.sr=_4.toJson(this.geometry1.spatialReference.toJson());if(this.distanceUnit){json.distanceUnit=this.distanceUnit;}if(this.geodesic){json.geodesic=this.geodesic;}return json;}});}}};});