-
Notifications
You must be signed in to change notification settings - Fork 50
Dymo
Dymo determines optimal placement for densely-packed city name labels, and results in layouts make your maps look like they’ve been touched by a cartographer. “Maplex quality labeling for point features” via simulated annealing.
It's an expensive, whole-world process that combines font choices, name precedence and placement hints. It can take many days to place labels for the whole world, though for limited runs of a few hundred labels for a small map takes just minutes.
- Label placements can be used in Mapnik or QGIS or ArcMap or MaPublisher or...
- Order your SHP by population descending for cities! (--font-field flag)
- Outputs SHP for the label placement by the 20 web map zoom levels
- Can burn the labels into your raster tiles or push to browser to render client side via GeoJSON and other formats
###Download and install
Dependencies first. Build PIL from source as easy_install version didn't have the right flag for the font metric.
Download from http://www.pythonware.com/products/pil/ the newest "(all platforms)" version. Expand that archive and cd into the directory and run:
python setup.py install
Now for the Modest Maps dependency:
easy_install modestmaps
Now for Dymo proper:
easy_install dymo
Note: you could use pip instead, like: pip install dymo
, etc.
###Convert the resulting GeoJSON to SHP
Once for labels footprint bbox, then once for townspot point location.
ogr2ogr -f "ESRI Shapefile" labels/z9-labels.shp labels/z9-labels.json
ogr2ogr -f "ESRI Shapefile" labels/z9-points.shp labels/z9-points.json
NOTE: To reduce file size of the resulting GeoJSON files, check out LilJSON.