Archive for June, 2014

Making a basemap with OSM data, some notes

Creating a zoomable map with openstreetmap data that covers the entire world is doable even if you’re a single-person entity without your own server infrastructure. You’ll have to use a provider like AWS to scale up to the level of performance that you’ll need, of course. As with any cartography project, minding the data becomes about 50% of the work and multi-zoom basemaps of the world are certainly no exception to that rule.

blogpostosm

A tool like imposm or osm2pgsql is usually required to parse data from a source like geofabrik (pbf). At Boundless we’ve had some great success with imposm3, though it is still in the experimental phase, but so far proves to be much faster than imposm2. The benefit of imposm is that you don’t dump everything into 3 tables like osm2pgsql; instead you dump it into any number of tables based on data type, usually around 25 tables (you customize the download via a json file with whatever parameters you want to specify). This makes querying faster. You also get “diff support,” which means that you can easily incorporate updates from OSM diff files, thus enabling easy updates however often you want to update. (We haven’t tested that in imposm3 yet.)

Going along with the “data is 50% of the project” maxim, you need to become familiar with PostGIS in order to deal with this data. You need to be able to use a viewer like pgAdmin and/or get familiar with the command-line tools both for viewing the tables and their contents so that you can actually use and style the data but also to manipulate the data if needed.

For example, performance is often enhanced if you create attribute indexes on any attributes that you are using for styling. Let’s say I’m showing parks at a high zoom level. My GeoServer SLD that contains the styling rules for my map might specify that type=parks in table landusages needs to be green with a dark green outline. The table landusages may benefit from an attribute index being created on the type field.

blogpostosm3

Personally, I believe the very best way to get familiar with all the tools that I’ve mentioned above is to play with them yourself in a real-world environment. For this my favorite two options are 1) learn on your own (I love Boundless’s new online training courses) and 2) attending a maptime near you. And on a final note, don’t try to download and parse the entire world’s worth of OSM data your first time. 😉 Start with a city, county, or small state of interest and scale up from there.

Spending even a few nights beginning to fool around with OpenStreetMap, imposm2 or imposm3, PostGIS, and/or GeoServer will make you more marketable. Investing in this knowledge acquisition will certainly pay dividends.

No Comments

The Second Edition is Available



The long-awaited (at least by me) second edition of GIS Cartography: A Guide to Effective Map Design is finally in stock and available for purchase.

With Special Thanks to the Following For Their Contributions:
Kyle Schaper
Mamata Akella
Cezar Buterez
Michael Bowser
James Whitacre
Matt Layman
David Nash
Allison Bailey
Matt Stevenson
Elliot Hartley
Evan Centanni
Hans van der Maarel
Jack Dangermond
J. Edward Pickle
Dave Imus
Karsten Venemann
and many more

With extra-special thanks for the cover map conceived and designed by Dan Bowles.

You may want this book for its two new chapters on projections and zoom-level design. Many of the examples were updated and a lot of the text was updated.

Memories:
And Now, a Picture From A Satisfied Customer, in which someone sends me a picture of their baby looking at the 1st edition! If this doesn’t motivate someone to write a 2nd edition, nothing will. Afterall, somebody is actually reading it! Okay, looking at it. Okay, drooling on it and probably chewing on it. But still.

Quietness, in which a cat symbolizes quiet typing time and an undercurrent of impatience at the long process of writing a book is hinted at.

Ice Cream and Topology, in which I promise myself an ice cream cone for finishing and describe how one of the example maps was updated. Yes, I did get the ice cream, though I think I went with Cold Stone ice cream cupcakes (6 pack) instead, which I’m sure we can all agree was the better choice.

Party Time, in which I finish writing. Also featuring a globe, a wig, and a glass of wine.

No Comments