... | ... | @@ -18,4 +18,21 @@ You might have noticed the file you downloaded — which is a ZIP archive contai |
|
|
|
|
|
Obviously, our little web map doesn't need to be quite this precise enough to see every little bend in every river that forms a state border. Fortunately, just about every GIS tool out there has tools to shrink file sizes by dramatically simplifying shapes. A good and widely available algorithm is Visvalingam’s Algorithm, for which you can find a very nice, visual explanation [here](https://bost.ocks.org/mike/simplify/).
|
|
|
|
|
|
*Un*fortunately, most of those tools are not topology-aware: they're going to process, for example, the Georgia-Alabama border once for the Georgia shape and once for the Alabama shape, possibly making slightly different decisions for each, leading to small gaps or overlaps. This is where [MapShaper](https://mapshaper.org) comes in. |
|
|
\ No newline at end of file |
|
|
*Un*fortunately, most of those tools are not topology-aware: they're going to process, for example, the Georgia-Alabama border once for the Georgia shape and once for the Alabama shape, possibly making slightly different decisions for each, leading to small gaps or overlaps. This is where [MapShaper](https://mapshaper.org) comes in.
|
|
|
|
|
|
MapShaper is available as a [Node.js-based CLI](https://www.npmjs.com/package/mapshaper), but it's easiest to use through its simple, free web interface that processes everything in-browser.
|
|
|
|
|
|

|
|
|
Simply drag in your zipped Shapefile...
|
|
|
|
|
|

|
|
|
Import with default settings...
|
|
|
|
|
|

|
|
|
Choose "Simplify" from the top toolbar. You can play around with what algorithm works best, but I'd recommend just going with "Visvalingam / effective area".
|
|
|
|
|
|

|
|
|
This will give you a slider that you can use to visually find the highest acceptable level of simplification. The percentage shown by the slider is the percentage of points retained — so a rough proxy for file size. If you find this a little arbitrary, you could open the console and run the [`-simplify` command](https://github.com/mbloch/mapshaper/wiki/Command-Reference#-simplify) with its `interval=` option, which lets you specify a tolerance in meters (presumably that means square meters for Visvalingam) or latitude/longitude degrees.
|
|
|
|
|
|

|
|
|
Once you're done, hit "Export" and choose "GeoJSON" as your format. |