An app I'm developing needs to handcraft ESRI JSON to display simple polygons in ArcMap Desktop upon import. I want to specify color/transparency/outlining for the polygons in a layer and ideally different colors for different polygons. (The app does not have access to APIs for this, so it's all done the hard way.)
I've found no documentation for handcrafted JSON but got a few ideas from looking at JSON (Server) examples on the Net, for example drawingInfo/renderer, but haven't been able to get this working. (Maybe drawingInfo is supported by Server but not by Desktop?). I've tried a renderer of type "uniqueValue" without success and have fallen back to trying a renderer of type "simple".
Below, based largely on guesswork, is my attempt. On import into ArcCatalog/ArcMap 10.4, the polygon is displayed but the attempt to specify color and outline was ignored.
{"displayFieldName":"","fieldAliases":{"Name":"Name","Description":"Description","Latitude":"Latitude","Longitude":"Longitude","TriangAccu":"TriangAccu","SatHorWKID":"SatHorWKID","SatVerWKID":"SatVerWKID","GridWKID":"GridWKID"},"geometryType":"esriGeometryPolygon",
"drawingInfo": {
"renderer": {
"type": "simple",
"symbol": {
"type": "esriSFS",
"style": "esriSFSSolid",
"color": [
255,
0,
0,
255
],
"outline": {
"type": "esriSLS",
"style": "esriSLSSolid",
"color": [
0,
0,
255,
255
],
"width": 0.4
}
}
}
},
"hasZ":"false","spatialReference":{"wkid":"4326","latestWkid":"4326"},"fields":[{"name":"Name","type":"esriFieldTypeString","alias":"Name","length":"45"},{"name":"Description","type":"esriFieldTypeString","alias":"Description","length":"140"},{"name":"Latitude","type":"esriFieldTypeDouble","alias":"Latitude"},{"name":"Longitude","type":"esriFieldTypeDouble","alias":"Longitude"},{"name":"TriangAccu","type":"esriFieldTypeString","alias":"TriangAccu","length":"20"},{"name":"SatHorWKID","type":"esriFieldTypeString","alias":"SatHorWKID","length":"8"},{"name":"SatVerWKID","type":"esriFieldTypeString","alias":"SatVerWKID","length":"8"},{"name":"GridWKID","type":"esriFieldTypeString","alias":"GridWKID","length":"8"}],"features":[{"attributes":{"Name":"North","Description":"","Latitude":"-33.63610000","Longitude":"151.33165000","TriangAccu":"","SatHorWKID":"4326","SatVerWKID":"","GridWKID":""},
"geometry":{
"rings":[[
[151.31426667,-33.64595000],
[151.29100000,-33.64000000],
[151.33166667,-33.58195000],
[151.33365000,-33.64341667],
[151.31426667,-33.64595000]
]]
}}]}