Present a JSON response as Graphic Layer
Hello I got this response back from an GP tool, but I'm not able to figure out how to present this json return as a Graphic layer. Does anyone have a tip for me:
{"returnlayer":{"displayFieldName":"","geometryType":"esriGeometryPolygon","spatialReference":{"wkid":32633,"latestWkid":32633},"fields":[{"name":"OBJECTID","type":"esriFieldTypeOID","alias":"OBJECTID"},{"name":"gridcode","type":"esriFieldTypeInteger","alias":"gridcode"},{"name":"Shape_Length","type":"esriFieldTypeDouble","alias":"Shape_Length"},{"name":"Shape_Area","type":"esriFieldTypeDouble","alias":"Shape_Area"}],"features":[{"geometry":{"rings":[[[649650,7736950.5],[649675,7736950.5],[649675,7736975.5],[649650,7736975.5],[649650,7736950.5],[649525,7736950.5],[649525,7736925.5],[649475,7736925.5],[649475,7736950.5],[649450,7736950.5],[649450,7736975.5],[649425,7736975.5],[649425,7737025.5],[649375,7737025.5],[649375,7737050.5],[649350,7737050.5],[649350,7737075.5],[649325,7737075.5],[649325,7737100.5],[649300,7737100.5],[649300,7737125.5],[649325,7737125.5],[649325,7737175.5],[649300,7737175.5],[649300,7737225.5],[649275,7737225.5],[649275,7737250.5],[649250,7737250.5],[649250,7737225.5],[649200,7737225.5],[649200,7737200.5],[649175,7737200.5],[649175,7737175.5],[649150,7737175.5],[649150,7737150.5],[649125,7737150.5],[649125,7737175.5],[649100,7737175.5],[649100,7737225.5],[649075,7737225.5],[649075,7737250.5],[649050,7737250.5],[649050,7737275.5],[649025,7737275.5],[649025,7737325.5],[649000,7737325.5],[649000,7737350.5],[648975,7737350.5],[648975,7737400.5],[648950,7737400.5],[648950,7737450.5],[648925,7737450.5],[648925,7737525.5],[648900,7737525.5],[648900,7737600.5],[648875,7737600.5],[648875,7737675.5],[648925,7737675.5],[648925,7737650.5],[649000,7737650.5],[649000,7737675.5],[649025,7737675.5],[649025,7737725.5],[649000,7737725.5],[649000,7737750.5],[649100,7737750.5],[649100,7737775.5],[649125,7737775.5],[649125,7737750.5],[649150,7737750.5],[649150,7737825.5],[649100,7737825.5],[649100,7737875.5],[649075,7737875.5],[649075,7737900.5],[649050,7737900.5],[649050,7737950.5],[649025,7737950.5],[649025,7738000.5],[649000,7738000.5],[649000,7738050.5],[648975,7738050.5],[648975,7738075.5],[649000,7738075.5],[649000,7738175.5],[648975,7738175.5],[648975,7738200.5],[649000,7738200.5],[649000,7738250.5],[648975,7738250.5],[648975,7738375.5],[649025,7738375.5],[649025,7738450.5],[649050,7738450.5],[649050,7738475.5],[649075,7738475.5],[649075,7738500.5],[649100,7738500.5],[649100,7738550.5],[649125,7738550.5],[649125,7738575.5],[649150,7738575.5],[649150,7738600.5],[649200,7738600.5],[649200,7738625.5],[649225,7738625.5],[649225,7738650.5],[649250,7738650.5],[649250,7738675.5],[649275,7738675.5],[649275,7738700.5],[649300,7738700.5],[649300,7738675.5],[649325,7738675.5],[649325,7738650.5],[649375,7738650.5],[649375,7738675.5],[649400,7738675.5],[649400,7738700.5],[649475,7738700.5],[649475,7738725.5],[649550,7738725.5],[649550,7738775.5],[649600,7738775.5],[649600,7738825.5],[649625,7738825.5],[649625,7738850.5],[649775,7738850.5],[649775,7738825.5],[649825,7738825.5],[649825,7738800.5],[649850,7738800.5],[649850,7738750.5],[649875,7738750.5],[649875,7738700.5],[649925,7738700.5],[649925,7738600.5],[649900,7738600.5],[649900,7738525.5],[649950,7738525.5],[649950,7738500.5],[649975,7738500.5],[649975,7738450.5],[650000,7738450.5],[650000,7738425.5],[650075,7738425.5],[650075,7738375.5],[650050,7738375.5],[650050,7738350.5],[650075,7738350.5],[650075,7738325.5],[650100,7738325.5],[650100,7738350.5],[650150,7738350.5],[650150,7738375.5],[650200,7738375.5],[650200,7738425.5],[650250,7738425.5],[650250,7738450.5],[650275,7738450.5],[650275,7738475.5],[650325,7738475.5],[650325,7738500.5],[650300,7738500.5],[650300,7738525.5],[650350,7738525.5],[650350,7738500.5],[650400,7738500.5],[650400,7738475.5],[650425,7738475.5],[650425,7738450.5],[650400,7738450.5],[650400,7738425.5],[650425,7738425.5],[650425,7738375.5],[650450,7738375.5],[650450,7738400.5],[650550,7738400.5],[650550,7738375.5],[650525,7738375.5],[650525,7738350.5],[650550,7738350.5],[650550,7738375.5],[650600,7738375.5],[650600,7738400.5],[650650,7738400.5],[650650,7738375.5],[650725,7738375.5],[650725,7738325.5],[650750,7738325.5],[650750,7738275.5],[650775,7738275.5],[650775,7738200.5],[650750,7738200.5],[650750,7738150.5],[650775,7738150.5],[650775,7738200.5],[650800,7738200.5],[650800,7738125.5],[650825,7738125.5],[650825,7738025.5],[650850,7738025.5],[650850,7737700.5],[650825,7737700.5],[650825,7737600.5],[650800,7737600.5],[650800,7737525.5],[650775,7737525.5],[650775,7737450.5],[650750,7737450.5],[650750,7737400.5],[650725,7737400.5],[650725,7737350.5],[650700,7737350.5],[650700,7737325.5],[650675,7737325.5],[650675,7737275.5],[650650,7737275.5],[650650,7737250.5],[650625,7737250.5],[650625,7737225.5],[650600,7737225.5],[650600,7737200.5],[650575,7737200.5],[650575,7737150.5],[650550,7737150.5],[650550,7737125.5],[650500,7737125.5],[650500,7737100.5],[650475,7737100.5],[650475,7737075.5],[650450,7737075.5],[650450,7737050.5],[650425,7737050.5],[650425,7737025.5],[650375,7737025.5],[650375,7737000.5],[650325,7737000.5],[650325,7736975.5],[650275,7736975.5],[650275,7736950.5],[650225,7736950.5],[650225,7736925.5],[650150,7736925.5],[650150,7736900.5],[650075,7736900.5],[650075,7736875.5],[649675,7736875.5],[649675,7736925.5],[649650,7736925.5],[649650,7736950.5]],[[649550,7738300.5],[649550,7738375.5],[649525,7738375.5],[649525,7738400.5],[649500,7738400.5],[649500,7738425.5],[649475,7738425.5],[649475,7738475.5],[649425,7738475.5],[649425,7738450.5],[649400,7738450.5],[649400,7738375.5],[649450,7738375.5],[649450,7738350.5],[649500,7738350.5],[649500,7738325.5],[649525,7738325.5],[649525,7738300.5],[649550,7738300.5]],[[650525,7738275.5],[650525,7738300.5],[650500,7738300.5],[650500,7738275.5],[650525,7738275.5]],[[649975,7737450.5],[649975,7737475.5],[649925,7737475.5],[649925,7737450.5],[649975,7737450.5]],[[649675,7737275.5],[649675,7737300.5],[649650,7737300.5],[649650,7737275.5],[649675,7737275.5]],[[649850,7737100.5],[649850,7737125.5],[649825,7737125.5],[649825,7737100.5],[649850,7737100.5]],[[650075,7736925.5],[650075,7736950.5],[650100,7736950.5],[650100,7737000.5],[650125,7737000.5],[650125,7737025.5],[650100,7737025.5],[650100,7737050.5],[650075,7737050.5],[650075,7737025.5],[650050,7737025.5],[650050,7737000.5],[650000,7737000.5],[650000,7736950.5],[650025,7736950.5],[650025,7736925.5],[650075,7736925.5]]],"spatialReference":{"wkid":32633,"latestWkid":32633}},"symbol":null,"attributes":{"OBJECTID":1,"gridcode":1,"Shape_Length":11550,"Shape_Area":2710625}}],"exceededTransferLimit":false,"transform":null}}
Best regards
Jan-Henrik Nilsen
-
If that JSON is actually a string, you should probably use the Get Feature Set From JSON activity, followed by Add Graphics (with Features =$featureSet1.featureSet.features).
0 -
Yes found the error in the string. The GP tools returned {"returnlayer": the valid Json to use in the json tool. Had to do a for each on the parsed json result to populate a valid json for Get Feature Set From JSON activity. After that it was straight ahead.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare