Extract 2500 geoJSON polygons to map flyers

I searched but cannot find a solution.

I have a 170 MB GeoJSON file. It contains about 2500 polygons. Somehow I need to display it on the flyer card. Obviously, in this amount I have no chance.

What will be the easiest way to visualize this data? Can I create a complete transparent png that can simply be visualized on a world map. The huge size is due to the complexity and number of polygons. At the moment, I do not need this to be interactive.

Thanks Brian

+4
source share
4 answers

The easiest way is to create your own map tiles based on this data. There are several ways to achieve this, but I suggest you use TileMill . It is free and very easy to use. So basically you would:

  • Use TileMill and specify the GeoJSON file as the data source

  • Customize the map display (e.g. polygon color) with a special CSS-like language inside TileMill

  • Creating Fragments

  • Download the new TileLayer to the Leaflet map that links to your files

I actually wrote a tutorial some time ago that uses .shp instead of GeoJson, but should be pretty similar:

http://build-failed.blogspot.pt/2012/03/custom-map-tiles-part-2-tilemill.html

+13
source

I can not argue with the recommendation of psousa. For a simple presentation, TileMill is a great idea.

However, if you want to overlay your polygons on another card, I think the only way is to use Mike Bostock TopoJSON and D3.

TopoJSON Home: https://github.com/mbostock/topojson/wiki

An example on the scale you're talking about: http://bl.ocks.org/mbostock/4206573

You will need to inspect Mike's great examples on github to see how to combine the flyer with the D3 overlay.

I am doing this successfully with hundreds of complex polygons. There was no need to break into thousands ... yet.

+7
source

There is also geojson-vt , which apparently can for shingles without a server on the fly - after a short load time.

demo gif from github

+5
source

Just one modest offer. I successfully loaded 10,000+ polygons and attribute queries, deploying my own Geoserver and PostgreSQL DB + PostGIS instance and creating WMS (not WFS), as you can see in the image.

10000+ polygons

But this is impractical to implement, especially if the geoisone data is the source (and only) data

In this regard, I would answer the second psousa question to use TileMill.

+3
source

Source: https://habr.com/ru/post/1491231/


All Articles