Giter Club home page Giter Club logo

Comments (6)

JasonSanford avatar JasonSanford commented on August 18, 2024

But GeoJSON geometry objects don't need a properties member do they? Are you thinking of a Feature?

from geojson-google-maps.

saxman avatar saxman commented on August 18, 2024

Looks like this might be a "feature" of TopoJSON, which doesn't support GeoJSON features. The topojson.object function attaches properties to GeoJSON geometry objects.

For context, as a proof of concept, I'm generating GeoJSON from Esri Shapefiles (Natural Earth) using GDAL, converting the GeoJSON to TopoJSON for serving, converting back to GeoJSON in the browser, and using GeoJSON.js to generate the google.maps.Polygons for rendering.

Perhaps better to fork for this use case?

from geojson-google-maps.

JasonSanford avatar JasonSanford commented on August 18, 2024

Interesting. I'd be interested in seeing the exact files you're working with. Can you easily set up something reproducible with JSFiddle or something like http://bl.ocks.org/4554134 ?

from geojson-google-maps.

saxman avatar saxman commented on August 18, 2024

Code at:
https://github.com/saxman/google_maps/tree/master/natural_earth

If you take a look at the ne_10m_admin_0_countries.topojson.js file, you can see the properties in the GeometryCollection.

More context on why topojson does this:
topojson/topojson#7

from geojson-google-maps.

JasonSanford avatar JasonSanford commented on August 18, 2024

Yeah, I guess I just have reservations about honoring something that's not in the GeoJSON spec here. If we start checking for a properties member of a geometry, what's keeping us from honoring any other random key value pairs in a geometry?

from geojson-google-maps.

JasonSanford avatar JasonSanford commented on August 18, 2024

Or maybe I'm not looking at things correctly and topojson/topojson#7 puts these properties in a proper Feature and not the geometry.

from geojson-google-maps.

Related Issues (16)

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.