which coordinates send?

1961
3
05-10-2016 07:01 PM
CloudingSoft
Occasional Contributor

Hi I continue with thehttp://resources.arcgis.com/en/help/arcgis-rest-api/#/Vehicle_Routing_Problem_service/02r3000000n400...

I am sending a url with all the data and get the jobId OK

but when I check the status of jobId always gives me "esriJobFailed"

investigation found that I am sending wrong coordinates "orders" and "depots"

& Orders = { "features": [{ "geometry": { "x": - 4283666882700000, "y": - 5094167652999600} ...

& Depots = { "features": [{ "geometry": { "x": - 4283666882700000, "y": - 5094167652999600} ...

I did a test example and you put these coordinates manually

for orders:

{ "x": - 122.4889, "y": 37.7538}

for depots:

{ "x": - 122.4739, "y": 37.7432}

and get REQUEST status "esriJobSucceeded" !!!

as I can convert my coordinates to the correct coordinates?

Thank you

0 Kudos
3 Replies
CloudingSoft
Occasional Contributor

Hi I realized I had to add the parameters SpatialReference, in my case my coordinates are type wkid 4326

SpatialReference ": {" wkid ": 4326}

but when I query I still returns FAILED state

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Fabien,

  Sounds like you need to convert your Webmercator coords to Geographic coords. For that use WebMercatorUtils:

esri/geometry/webMercatorUtils | API Reference | ArcGIS API for JavaScript | webMercatorToGeographic

0 Kudos
CloudingSoft
Occasional Contributor

Hello, my coordinates use these coordinates.

but I found that if sending the type of coordinates of example SpatialReference default the script works.

According to documents if I send other cooredenadas must specify the SpatialReference, yet fails.

SpatialReference ": {" wkid ": 4326}

0 Kudos