Nothing Special   »   [go: up one dir, main page]

OpenStreetMap logo OpenStreetMap

The other week Development Seed posted some fresh new data for Jalisco, Mexico, together with instructions on how to use JOSM to get it into OpenStreetMap.

Of course, like most good things, it’s much easier and shinier to do it in Potlatch. At which point you might ask “What? You can open .osm files in Potlatch?”. Yes, you can, and here’s how you do it.

First of all, go to https://github.com/mapbox/osm-jalisco/downloads and grab the .osm files. Camino_2011 doesn’t download when I try it, but the other two are fine.

Now open Potlatch in the part of Mexico which you want to edit. Here’s a handy link.

Go to the “Background” menu, and click “Vector file…”:

The background menu

At the bottom, select “OSM”, then “File: Open…” to load your .osm file. Do this for each one:

Adding a new layer

You’ll see them appear as layers in the list. By default they’re shown in ‘Potlatch’ style, which means they look the same as the rest of the map. You can choose any currently-loaded stylesheet to show them in, but I like to use ‘GPS’, which displays them as a clear cyan line:

Setting the style

Close the window and go back to the map. Look! Your .osm file is being displayed!

It’s being shown as a background layer. In other words, it won’t be uploaded next time you save. (Because unthinking imports are bad, right kids?) So to add it to the map, you need to pull it through from the background layer to the main map.

Couldn’t be easier. Just alt-click. (Or, if you’re using a Linux system that reserves alt for its own nefarious purposes, shift-control-click.)

Et voila

And that really is all there is to it.

Even more awesome

This is just scratching the surface, but there’s lots more you can do with vector background layers. Basically, Potlatch does the hard work of making data usable, so you don’t have to faff around with a bunch of preprocessing scripts.

You can open from local disc (like this) or fetch from the Internet. You can open .osm, .gpx, .kml or - yes - even shapefiles. (If loading from local disc, put the .shp, .dbf and .shx files in a .zip).

Wrong projection? No problem: P2 can reproject from OSGB or NAD83 (and we’re happy to add new projections if needs be).

Data too dense? Just enable the ‘Simplify’ button and Potlatch will run a Douglas-Peucker line simplification over it, at the strength you’ve specified in the Options dialogue.

And the cleverest thing of all: MapCSS-based tag transformations. You can supply a stylesheet-like text file that tells Potlatch how to map tags in the source data to OSM standards. Use MapCSS selectors as normal, and the special ‘set’ and ‘delete’ instructions to control the output. It’s best expressed through an example, so here’s one I used for OS VectorMap District data.

Discussion

Comment from Mele Sax-Barnett on 25 May 2012 at 17:29

Richard, this is great! I will definitely be sharing this strategy with GIS folks I meet all the time that are interested in putting public/open data into OSM.

Comment from net-buoy on 12 July 2017 at 20:02

I tried to use your method to upload some .shp files, and they will not upload using the shapefile radio button either as NADS or as WGS84. They do appear in the menu if I select them as GPX files… but then they do not appear in the background at all.

Comment from net-buoy on 12 July 2017 at 20:07

by the way, I can import the shape files into JOSM, but the difficulty in getting JOSM to work through firewalls etc make it a hassle to use. However, JOSM can save the imported shape files as a wsm file… but there appears no way to use the wsm file as a background in Potlatch.

Comment from Richard on 13 July 2017 at 08:00

Do you have a link to the shapefiles?

Comment from dpsspatial on 1 February 2018 at 19:01

Richard, this is great!

Comment from dpsspatial on 1 February 2018 at 19:20

Actually - now seeing the Potlatch took all the columns from the imported data, which I wasn’t aware it was doing. Will have to go in and clean this up, if possible…

Log in to leave a comment