-
Notifications
You must be signed in to change notification settings - Fork 62
It would be great to be able to specify the id field for GeoJSON #32
Comments
it's pretty easy to change the id field later and from a quick paruse of On Mon, Aug 1, 2016 at 10:47 AM AlexArcPy [email protected] wrote:
|
Well, if you have as field name OID, then you get as I've tried |
its actually a field of type oid not name oid that it looks for, and where did you see that in the docs? I might be looking in the wrong place. |
I know that it is looking of ObjectID field type :) whatever, it is pulling those 1,2,3 etc into id which are completely useless in GeoJSON. You would want to have some something meaningfull. My bad, it does say that it's possible to use the feature.properties. Good catch, thanks! By the way, got it working with feature.properties.%field_name%. Cool. Anyway, as an improvement, it would be great to be able to pull values from another field into id. :P |
feel free to open a pull, though bear in mind ids can only be strings or numbers so not every field can be the id. Also since id's are 100% optional if you have software relying on them, you may want to open issues with those libraries. |
Currently, the
OID
field of a feature class is used when converting the feature class to a GeoJSON. However, most often this unique ID doesn't have any meaning and it would be great to choose the field that will become the id for features in GeoJSON. When doing plotting and map bindings with such Python libraries asfolium
andvincent
, having a meaningful id is required.I solve this for my needs by editing the line
https://github.com/project-open-data/esri2open/blob/master/Install/esri2open/parseRow.py#L16
with the field name I want to have as id in the output GeoJSON.
replaced
self.oid=getOID(self.fields)
with
self.oid='FIELD_NAME'
The text was updated successfully, but these errors were encountered: