I need geoJSON formatted paths for states, provinces, and regions within multiple countries. Most readily available geoJSON data is for US states and country level boundaries, not regions within the country. This geoJSON will be used to create a geographic visualization using D3.js.
Most readily available geoJSON data is for US states and country level boundaries, not regions within the country. This geoJSON will be used to create a geographic visualization using D3. js. www.boundaries-io.com for GeoJson boundaries.
Launch geojson.io from http://geojson.io/#map=2/20.0/0.0. I will be using a polygon in this instance. Draw your AOI by clicking desired points on the map to outline your AOI. Once you complete the polygon it will be shaded and the associated JSON will be generated in the output area to the left.
With the Data layer, you can add GeoJSON data to a Google map in just one line of code. map. data. loadGeoJson('google.
GeoJSON is an open standard geospatial data interchange format that represents simple geographic features and their nonspatial attributes. Based on JavaScript Object Notation (JSON), GeoJSON is a format for encoding a variety of geographic data structures.
This process is now simplified (July 2014) compared to the steps I see in the accepted answer. It now seems much easier to get this data. I at first floundered around the web hoping I could just download a bunch of standard maps in GeoJSON format, but came up empty other than standard US/Canada offerings. As of right now there doesn't seem to be a lot available in straight GeoJSON. Instead you take an older, widely used format to generate GeoJSON. This is easy, and a good path to take. We'll be working with shape files and converting them to GeoJSON.
First download a shape file for the geographic area you are interested in. A shapefile is a digital vector storage format for storing geometric location and associated attribute information. (http://en.wikipedia.org/wiki/Shapefile)
There are lots of sources of these. These are sources I found useful:
GADM - Download data by country or one giant file for the world. Each zip you download has multiple shape files inside starting at number 0 and increasing. The higher the number the higher the detail level. Like country, state, county, etc. (http://www.gadm.org/country)
Another download site (http://www.naturalearthdata.com/downloads/)
Download US State, County, Sub-County data as driven by the census bureau - http://census.ire.org/data/bulkdata.html
Once you have your shape file, drag and drop it into the webpage at http://www.mapshaper.org. Here you can drag a slider to change the vector resolution. My experience was that 10% resolution looked great still for web maps, 25% was near perfect. File size was greatly reduced, so I would recommend using it. My Massachusetts map went from 800kb of GeoJSON data to 80kb after reducing resolution.
Click the GeoJSON button on mapshaper and the file is automatically exported for you.
Optional - Once you have a shape file, you can edit it for free in a tool like Quantum GIS (QGIS).
You can also hand map GeoJSON data at this website. http://geojson.io/#map=2/20.0/0.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With