Use GeometryService Offset method with geographic coordinates

543
0
08-09-2017 07:01 PM
Robertvan_Waasbergen
New Contributor II

I'm trying to use ArcGIS Server's GeometryService to get an offset geometry from an input polyline. My application uses the webmercator projection, and when I call the Offset method, it returns a geometry that's offset by an amount different than what I asked for: I asked for 30.48 meters and the response was offset by about 24 meters.

I tried submitting the request using geometries in Geographic (WGS84) coordinates, but the response is a very strange set of coordinates (definitely not geographic) that break the map.  The method doesn't appear to support an "outSpatialReference" parameter.

Does anyone have a solution for this? I believe the issue with the webmercator projection is that ArcGIS isn't calculating the distances correctly because of some internal conversion that isn't using geodesic calculations.  I have no idea what it's doing when given geographic coordinates.

Any help appreciated!

Here's an example using the inputs from the ESRI documentation:

sr: 4326

geometries: {
  "geometryType" : "esriGeometryPolyline",
   "geometries" : [
      {
        "paths" : [ [           [
            -97.222626978125,
            38.976123035796
          ],
          [
            -97.222518979687,
            38.976003824077
          ],
          [
            -97.222328552344,
            38.975852417827
          ],
          [
            -97.222101385156,
            38.975743765483
          ],
          [
            -97.221931482813,
            38.97572261314
          ]
]
        ]
     }    ]
}

offset distance: 35

offset unit: 9001 (code for meters)

offset how: mitered

Here's the response, what are those coordinates??:

{  "geometryType": "esriGeometryPolyline",  "geometries": [{"paths": [[   [    -1583.3974272750595,    -1307.397614722718   ],   [    -1583.39731927706,    -1307.3977339347175   ],   [    -840.3099191285299,    -634.2108650553587   ],   [    -721.2332679567114,    -745.8615780059097   ],   [    -1345.244016933423,    -1530.6991598358195   ],   [    -1583.3973192770595,    -1307.397733934718   ],   [    -840.3099191285297,    -634.2108650553589   ],   [    -721.2332679567113,    -745.8615780059097   ],   [    -1345.2440169334227,    -1530.6991598358195   ],   [    -1345.2438265054227,    -1530.6993112418195   ],   [    -721.2330775287113,    -745.8617294119097   ],   [    -529.8581044626147,    -865.5603437031484   ],   [    -962.4938803732296,    -1770.096539824297   ],   [    -1345.243826505423,    -1530.6993112418195   ],   [    -721.2330775287114,    -745.8617294119097   ],   [    -529.8581044626142,    -865.5603437031486   ],   [    -962.4938803732284,    -1770.0965398242975   ],   [    -962.4936532062285,    -1770.0966484772975   ],   [    -529.8578772956142,    -865.5604523561487   ],   [    -221.0943041611068,    -956.0192924389459   ],   [    -344.96650693721364,    -1951.0143286428918   ],   [    -962.4936532062296,    -1770.0966484772969   ],   [    -529.8578772956148,    -865.5604523561484   ],   [    -221.09430416110638,    -956.0192924389459   ],   [    -344.9665069372128,    -1951.0143286428918   ],   [    -344.9663370352128,    -1951.0143497948918   ]  ]]}] }
Tags (2)
0 Kudos
0 Replies