Skip to main content
Solved

Trying to parse unique esriJSON file geometry


runneals
Contributor
Forum|alt.badge.img+22

Trying to turn the following json response from a HTTPCaller (hitting the ESRI Roads & Highways LRS Service - measureToGeometry) into line geometry.

Worth noting is that the line points are in [X,Y,Z,M], so I guess if I am able to remove the Z and M, I should be able to use the Geometry Replacer.

{"spatialReference":{"wkid":3857},"locations":[{"status":"esriLocatingOK","routeId":"S001920030W","geometryType":"esriGeometryPolyline","geometry":{"hasZ":true,"hasM":true,"paths":[[[-10415371.759930966,5162233.8351752404,0,179.327719443608],[-10415353.016318941,5162235.5338697936,0,179.31902059650747],[-10415173.989513392,5162253.0877756234,0,179.23587763117393],[-10414937.441137116,5162275.1197145516,0,179.12607168131217],[-10414712.804785877,5162297.1376164714,0,179.02174782997463],[-10414626.694503454,5162306.0776990149,0,178.98173415283964],[-10414577.001150453,5162309.6976211928,0,178.95870487764478],[-10414527.307759741,5162313.317119943,0,178.93567554029869],[-10414397.626339536,5162319.5500039952,0,178.87566648887878],[-10414310.829779875,5162320.9713228904,0,178.83554270499735],[-10414219.267391389,5162321.3697635373,0,178.79322107345797],[-10414038.525341231,5162322.5043579964,0,178.70967825656408],[-10413832.253641104,5162321.9418853559,0,178.61433668066456],[-10413625.983360801,5162323.7665091734,0,178.51899237075122],[-10413381.248851223,5162323.898761698,0,178.4058730898978],[-10413130.387584275,5162324.0277784066,0,178.28992197765911],[-10412921.781040879,5162324.848914952,0,178.19350077146373],[-10412712.608958075,5162325.6679260246,0,178.09681819120701]]]}}]}

Best answer by jdh

the geometry portion of that json is in ESRI JSON, you can extract it, and then use a geometry replacer.

 

esrijson.fmw
View original
Did this help you find an answer to your question?

3 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • July 7, 2017

the geometry portion of that json is in ESRI JSON, you can extract it, and then use a geometry replacer.

 

esrijson.fmw

runneals
Contributor
Forum|alt.badge.img+22
  • Author
  • Contributor
  • July 7, 2017
jdh wrote:

the geometry portion of that json is in ESRI JSON, you can extract it, and then use a geometry replacer.

 

esrijson.fmw
No way! You're AWESOME! I was using the JSON Extractor... Guess I shoulda used the fragmenter instead :P THANK YOU!!!

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 7, 2017
runneals wrote:
No way! You're AWESOME! I was using the JSON Extractor... Guess I shoulda used the fragmenter instead :P THANK YOU!!!
The locations is an array, which is why I went with the fragmenter. The extractor would have worked with json["locations"][0]["geometry"] which would return the first (and in this case only) location.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings