Giter Club home page Giter Club logo

Comments (7)

bryanjos avatar bryanjos commented on September 22, 2024

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.

larsbutler avatar larsbutler commented on September 22, 2024

@jerel

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.

niahoo avatar niahoo commented on September 22, 2024

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.

bryanjos avatar bryanjos commented on September 22, 2024

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.

niahoo avatar niahoo commented on September 22, 2024

But this is not stoehorning, the Feature type exists for this sole purpose : have geometry and properties in one entity ...

from geo.

bryanjos avatar bryanjos commented on September 22, 2024

Looking at the spec and thinking on it a bit, I think adding properties to the types should be fine.

from geo.

bryanjos avatar bryanjos commented on September 22, 2024

Fixed in 4647ed3

from geo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.