Comments (7)
There is no limitation that would prevent that. It would just be ignored unless used by something like the Geo.JSON module. I think adding properties is fine.
If another request for adding a GeoJSON specific item comes up, I'm leaning towards making something that follows the spec exactly that wraps around the Geo structs.
from geo.
Is there a PostGIS (or other) limitation that would prevent us from adding properties to the Geo structs?
The GeoJSON RFC states that "FeatureCollection and Geometry objects, respectively, MUST NOT contain a "geometry" or "properties" member." This came up in a discussion I had with one of the RFC authors.
It seems that the general theme here is a lack of support for metadata. Your cases is pretty custom, but there are some cases where metadata is vital to retaining information when converting between formats (GeoJSON to/from EWKT/EWKB, for example). Relevant issues:
I would really like to see some official guidance for how to include metadata/extensions in the GeoJSON schema. I'll have to go and do a bit of research.
from geo.
Hi,
That's exactly what the Feature
geojson type is for. It has two members, geometry
and properties
.
FeatureCollection
has only one member (besides type
) : features :: [Feature]
.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "Hanoi",
"month_notes": [2, 2, 3, 4, 3, 2, 2, 2, 3, 4, 5, 3],
"location": "Hanoi, Vietnam",
"country": "vietnam"
},
"geometry": {
"type": "Point",
"coordinates": [
105.8341598,
21.0277644
]
}
},
...
Any plans to implement it ?
from geo.
I've been thinking about this a lot and I think instead of trying to shoehorn geojson features into the geometry types, maybe it would be cleaner to create struct(s) around geojson itself. Maybe that's a better direction to move towards
from geo.
But this is not stoehorning, the Feature type exists for this sole purpose : have geometry and properties in one entity ...
from geo.
Looking at the spec and thinking on it a bit, I think adding properties
to the types should be fine.
from geo.
Fixed in 4647ed3
from geo.
Related Issues (20)
- is .tool-versions necessary? HOT 1
- Support for `Feature` and `FeatureCollection` to Geo.JSON HOT 2
- Geo.WKB and raw binaries HOT 5
- GeoJSON default SRID not set HOT 1
- The new 'Feature' does not retain the SRID property when encoding HOT 1
- Flatten GeometryCollection into non-complex geometries HOT 1
- Add box2d type HOT 1
- Unable to decode WKB of MultiLineString with no coordinates
- ArgumentError in Geo.WKB.Encoder.do_encode/2(geo 3.4.2) HOT 2
- Multi Linestring with 'EMPTY' in the point throwing error HOT 3
- GeoJSON coordinates are not check nor converted to a numeric value
- Fix handling of GeoJSON Z and M coordinates HOT 1
- Feature GeoJSON with Geometry object of type GeometryCollection is not supported HOT 2
- Feature object with null geometry is not supported HOT 2
- Addition of Circle Geometry HOT 1
- Move Ecto specific code to geo_ecto HOT 7
- Improve WKB and WKT encoder/decoder HOT 1
- Using geometry types with sqlite_ecto2 HOT 2
- Issue parsing geometry HOT 2
- Geo.JSON does not support PointZ HOT 6
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 geo.