41

I would like to be able to use openstreetmap data for a specific region as a source and "draw" from that the map of infrastructure improvements - mostly roads.

I want it to be self-hosted (not spoiling any data on the real OSM servers), want to have quite big flexibility and detail level in the editing process and it would be nice to render it in a pretty way.

I'm not familiar with lots of GIS software. Actually it's not that important to have OSM data as the source, it could be a satellite image as well. The important things - flexible drawing bound to real coordinates and visualization of the map.

Where could I start?

Hope this question makes sense here :)

4
  • What platform are you looking at? Can you use Google Maps to draw shapes? Jul 29, 2010 at 22:07
  • Jared, do you mean the simple "My Maps" interface of Google Maps? That's not enough for me :) I need much greater level of detail. Or do you mean something else?
    – arconaut
    Jul 29, 2010 at 22:10
  • For what part of the world do you want to do this? There is a lot of road data in the public domain, in some parts of the world.
    – djq
    Nov 17, 2010 at 22:07

12 Answers 12

17

The OpenStreetMap .osm XML data type can be parsed and rendered in a number of software packages. For a somewhat turnkey custom map tile drawer, I suggest: http://tiledrawer.com --- a product that uses Amazon's EC2 and by Michal Migurski -- who provides other pointers in this thread :)

You might also check out "Build your own OpenStreetMap Server" http://weait.com/content/build-your-own-openstreetmap-server It uses an Ubuntu 10.04 / PostGIS / Mapnik stack.

Of course, please do look at the OpenStreetMap license before building. http://wiki.openstreetmap.org/wiki/OpenStreetMap_License.

3
  • Thanks, I came across TileDrawer myself once, but as I understand I need to have an Amazon EC2 instance for that. I don't want to do that for now, maybe I'm just too lazy :)
    – arconaut
    Jul 29, 2010 at 21:47
  • I've read that you can run the EC2 image on your own machine using VirtualBox.
    – James
    Feb 16, 2012 at 15:59
  • Tiledrawer's website was abandonded, the Github repo is still there but also inactive: github.com/migurski/Tile-Drawer (see also in the OSM Wiki)
    – chrki
    May 22, 2018 at 18:11
12

I've found exactly what I needed: Maperitive. This application can load OSM data (*.osm can be saved by JOSM f.i.) and render nice images based on very flexible and customizable rules.

4
  • I've found that Maperitive hangs if I try to load an .osm.bz2 file or even an .osm.pbf file. The files I've tried have been around 185MB, so nothing near the size of the planet.osm.bz2 file (19GB!) which I really need. How did you load the files? Jan 6, 2012 at 15:09
  • Drew, I think I've only tried much smaller areas.
    – arconaut
    Jan 6, 2012 at 15:30
  • Maperitive is closed source, build on top of .Net, doesn't work on linux. But it definitively has one advantages over Mapnik: easier styling.
    – Vanuan
    Jan 6, 2013 at 13:15
  • 3
    I suggest TileMill as an open source alternative.
    – Vanuan
    Jan 9, 2013 at 19:33
9

Two possibilities, depending on how much of the OSM data itself you want to edit.

One is to host your own OSM server, with a copy of the data that you can freely edit. The software for this is known as "The Rails Port", can be found here: http://wiki.openstreetmap.org/wiki/The_Rails_Port

Another is to use OSM's tiled cartography as a background for your own data. I'm not really qualified to answer this one, but you may find that tools like QGIS (http://www.qgis.org) can provide for tracing of new shapes based on an OSM base map.

9

Map creation is divided into several steps:

  • entering the geodata (which are points, lines and polygons with appropriate tags)
  • styling (specify feature appearance on the map)
  • rendering into a raster image (transform geodata and style into an image using rendering software)

You would want a tool that does all the quirks for you behind an easy to use UI. But unfortunately, there is no such tool (hopefully, there will be). So, you have to pick a dedicated tool for each step.

I use the following combination of tools/workflow:

Entering/downloading the geodata

  • JOSM editor:
    • download a map from the osm server
    • edit a map
    • upload your changes to the osm server (why won't you share your work?)
    • save a map to a *.osm file
  • PostGIS/osm2pgsql
    • update the import style file if needed
    • import a map to the local server

If you don't want to share your work, you can setup the local OSM server and make JOSM work with it (making saving a map to a *.osm file and using osm2pgsql unnecessary). Still, be aware of the license if you use parts of OSM data.

Styling

Styling consists of two steps:

  • setup layers/datasource
  • customize lines/poligons/points/text output.

There are two formats to style a map: "raw" mapnik style file and CartoCSS.

  • Mapnik is a rendering library which powers OSM site.
    • Setup and edit mapnik style file
    • open the style file in the mapnik viewer

A "raw" Mapnik style file is cumbersome to edit, and CartoCSS a simpler alernative. CartoCSS (previously Cascadenik) is convertable to mapnik style file. Tilemill is a tool I use to edit/preview CartoCSS.

  • Tilemill.
    • Style/preview your map in tilemill
    • export to mapnik *.xml file.

Rendering

  • Custom python script for mapnik
    • Update bounding box/zoom level/size
    • render map to *.png file.

[Optional] Bring your map online

Of course, you can just use a large *.png file for your map, but imagine how long it would take to download it! So you split your map into tiles at different zoom levels.

  • Tilemill -> Mapnik -> MBTiles -> Mapbox

    • You can bring your map online by using Tilemill and MapBox.

Unfortunately, to update your map according to new OSM edits, you'll still have to download and render it locally.

So, there's a better solution: CartoDB. CartoDB supports CartoCSS. With it you don't need to install anything locally. Just import your data into it, style with CartoCSS and click share button. There's a free db size limit though. But since it's open source you can host it on your own. There's another limitation: you can only visualize either points or lines or polygons.

PS

Every tool has its own limitations, so try to experiment.

3

Look at http://codebrainz.ca/index.php/2009/09/27/installing-mapnik-and-friends-on-ubuntu-904/ for a detailed explanation.

2
  • Thanks, I might actually look into that. Although I'm not a linux guy and it might turn out too painful for me :)
    – arconaut
    Jul 29, 2010 at 21:51
  • 2
    actually most of the tools mentioned in the article would work on a windows or mac machine.
    – Ian Turton
    Jul 29, 2010 at 23:37
3

If you are looking for a good custom map-editor, then have a look at OCAD, it's a professional map drawing software. There is an older version available for free on the download page.

It doesn't have any special support for OSM, but you can always use an image exported from OSM as a background.

3

There is a simpler option for you to play around with Open Street Map data in OSM format. You can try out FME from Safe Software (www.safe.com)

For more information you can read about OSM support here: http://blog.safe.com/2010/03/sharing-your-data-on-openstreetmap/

I have used FME a couple of times to create demo datasets for training for my region using FME and OSM data

~SRG

3

The default OSM tiles are in a "Google tiling" format these are called Tile Map Service (TMS). At the moment, you can't use QGIS for TMS. But you can access OSM derived WMS by looking at other 3rd party service. Some are linked here: http://wiki.openstreetmap.org/wiki/WMS#Public_WMS_Servers

1
2

You can use The Style Editor from Cloudmade (commercial arm of OSM)

Free to sign up and use as an individual.

With a very good User Interface will be able to create your own style of map. When you have customised your map with your colours etc you can use it to embed or create a link to the page with your customised map.

See the blog post http://mapperz.blogspot.com/2009/03/cloudmade-map-editor.html (more updates there)

1
1

The official OSM maps get styled with TileMill and rendered with Mapnik. Both tools are extremely powerful and flexible. What is good for OSM, should be good for you!

Unfortunately the setup procedure for TileMillis a complicating, at least if you want to render OSM data. There are a lot of descriptions for Ubuntu or Mac, but the comments in forums show, that the procedure is tricky on Windows.

You find a detailed description about Map rendering with TileMill on Windows in the Wiki of TopoMapCreator.

It follows the classical procedure:

  • Step A: Downloading and installing required software (Mainly a Postgresql/PostGis database)
  • Step B: Downloading and importing OSM data to the database
  • Step C: Downloading and processing land polygons
  • Step D: Creating a TileMill project
  • Step E: Styling and exporting the map with TileMill

More on the Wiki of TopoMapCreator.

1

Another way to make custom maps with OSM data is with the Mapsense.js library and the Mapsense Earth vector tiles. There's a UI for picking colors at http://styler.mapsense.co/ and demos showing the css and javascript at developer.mapsense.co/examples/

One benefit of an API like this is that you can add anything else you want with javascript/d3 (satellite imagery, other geo/topojson, etc).

Full disclosure: I work at Mapsense. :)

0

If you want to just create a static map image, you might want to check this way to create an .svg inkscape file out of .osm s, it is kind of slow, though. You can then open the .svg, or if you want convert it to any other format (png?) or even load it to 3d studio or Blender :)...

(Also, JOSM seems to have a plugin that does osmarender, but I haven't managed to run it this one time I tried...)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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