Select to view content in your preferred language

Symbolizing features based on geoJSON colour attribute - how to do that?

561
1
03-15-2023 04:43 AM
JakubWabinski
New Contributor III

Hello everyone,

I have a number of JSON files that will be converted into geoJSON standard. One of the attributes contain information about the designed colour to be used for symbolization within feature class. This colour is provided as a string value in HEX format, e.g. "#FF0000". 

Is there any way (using arcpy) to symbolize the output features within a class (I plan to use JSON to Features) based on the colour value?

To give an example, let's say I have a geoJSON file as below, describing two point features with the colour attribute. How, using the given file, can I create a point feature class within which these two point features would be coloured red and green (based on the hex codes)?

Thank you in advance!

 

 

{"type":"FeatureCollection",
"features":[

{"type":"Feature","properties":{"colour": "#FF0000"},
"geometry":{"type":"Point","coordinates":[45.45,-25.25]}},

{"type":"Feature","properties":{"colour": "#00FF00"},
"geometry":{"type":"Point","coordinates":[46.46,-22.22]}}

]
}

 

0 Kudos
1 Reply
JakubWabinski
New Contributor III

Okay, that issue seems to be more complicated than I thought. 

Anyway, I found some sort of a workaround - attribute driven symbology: https://support.esri.com/en/technical-article/000024233

This works exactly as I want, i.e. it uses the HEX colour value from an attribute and the uses it to paint the output but... The problem is that I need to have it scripted.

Has anyone tried scripting and automatizing this feature?

0 Kudos