0

I have a big JSON file, from a converted shp file (through http://mapshaper.org/) of region coordinates for Australian Local Government areas.

The problem is that the region areas are super complex and result in lines of coordinates over 200,000 characters long. The JSON file for one state (NSW) is 55mb in size.

These are obviously all too big to be used in any web application.

As I want to draw the polygons on Google Maps, I need to come up with a better way to represent these coordinates. Maybe even a way to simplify the shapes, down to 10% of their points or something?

  • What GIS software do you have besides Google Maps? – Michael Stimson Nov 22 '17 at 5:11
  • None at all. I got my data (shapefile) from the Australia data.gov.au site and ABS site (abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/…). – Christian Nov 22 '17 at 5:13
  • 1
    I would suggest now is a good time to obtain QGIS, it's free, then have a read of gis.stackexchange.com/questions/25914/… I haven't tried to veiw/edit GeoJSON files in QGIS, I anticipate they would be quite unwieldy, if this is the case it would be less frustrating to export to Esri SHP files, smooth and then export to GeoJSON or KML. – Michael Stimson Nov 22 '17 at 5:21
1

Alternatively, if you don't specifically need to use Google Maps, you could sign up for a Free account at www.arcgis.com which will allow you to load the shapefile directly into a map (needs to be zipped). This will allow more functionality than Google Maps in way of interacting with your data once it is in a web map.

0

Using the comments and links provided in this question, I came up with a bit of a hybrid solution.

First, the functionality in QGis was tricky to use, error-prone and time-consuming, so I looked for an alternative to reducing the size of the regions. I found simplify-geojson.

using mapshaper.org I converted my shapefile to geojson, then used simplify-geojson with a tolerance of 0.001 to generate my new JSON.

simplify-geojson -t 0.001 NSW_LGA.json > NSW_LGA_SIMPLIFIED.json

As I didn't want JSON, I uploaded it again to mapshaper and exported it as a shapefile.

Once this was done, I could add my shapefile to Google Earth and save my place as either a kmz or kml.

The final step was simply adding a layer to my Google Map and importing the kml or kmz into the layer.

It took some trial and error with this process and with the tolerance on simplifying my regions. But in the end, it's a positive result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.