Support number type for "Feature.Id" property
See original GitHub issueAs per the RFC:
3.2. Feature Object
o If a Feature has a commonly used identifier, that identifier
SHOULD be included as a member of the Feature object with the name
"id", and the value of this member is either a JSON string or
number.
Would it possible for GeoJSON.Net to support a number value for Feature.Id
, in addition to a string value?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
[2.1] Feature ID datatype · Issue #94 · mapbox/vector-tile- ...
We recently received a request to Support text ids for Feature IDs on our MVT server. Looking at the spec, it appears there...
Read more >Using UUID as feature ID for MVT tiles (PostGIS)
The first column matching name and valid type (smallint, integer, bigint) will be used as Feature ID, and any subsequent column will be...
Read more >TypeScript + OpenLayers 7: Set and get feature id fails
I assign the id in the Polygon class; I read the id in the RemovePolygonButton class. import Map from 'ol/Map' import OSM from...
Read more >Sources | Style Specification | Mapbox GL JS
A map or layer source states which data the map should display. Specify the type of source with the "type" property, which must...
Read more >Replace auto-generated OBJECTID with my own ID fie...
ArcGIS auto-generates a `OBJECTID` attribute, and I'm hoping I can replace this value with an `id` feature property in my payload.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @dalbani and @matt-lethargic !
Could it be possible to say that
The problem here is that now Id MUST be a string, even if it represents a number. It could be changed to object, and we tell NewtonSoft.Json to serialize it the way it should.
@matt-lethargic’s PR is neat and works. OK with @dalbani for the downside of getting back a string.
I wish I had more time to test the Issue100 branch, but I don’t ! I don’t know enough pure GeoJSON.Net lib (I’m more in the spatial contribs) but for sure it’s a breaking change. (Imagine someone uses string manipulation on the Id property in its code (like Id.Length), changing Id to object would surely destroy (at least) the planet.