Comments (5)
it's pretty easy to change the id field later and from a quick paruse of
the folium docs they just use 'feature.id' in there examples, there doesn't
seem to be any reason you cant replace that with
'feature.properties.FIELD_NAME'
On Mon, Aug 1, 2016 at 10:47 AM AlexArcPy [email protected] wrote:
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 as folium and vincent, 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'—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#32, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ABE4n2NzB6FLmetv1wzsRVWnirNUH9Ffks5qbgbmgaJpZM4JZqSG
.
from esri2open.
Well, if you have as field name OID, then you get as id
values from the ObjectID, which are integers. If I wanted to have state names, for instance, I had to pull the state names from another field, not the ObjectID field. Doable in Python parsing the GeoJSON, but much easier to do it right from the beginning.
I've tried feature.properties.FIELD_NAME
, good point. Didn't work for me. In the docs, they say that it always should be feature.id
, so you do need to have id
in GeoJSON.
from esri2open.
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.
from esri2open.
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
from esri2open.
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.
from esri2open.
Related Issues (16)
- Toolbox has a hard code path in it. HOT 1
- consider adding TopoJSON HOT 10
- Tooblbox doesn't capture error messages HOT 4
- more coordinates
- CSV/JSON library HOT 16
- Mongo HOT 2
- Support the simplestyle spec
- License Typo HOT 2
- Options HOT 2
- Converts DateTime to Date only
- 10.3 Cannot add layer directly from a map
- no module named esri2open HOT 1
- Geometry, Shape_Area, Shape_Length
- license HOT 7
- Projection and Datum HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esri2open.