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…”:
At the bottom, select “OSM”, then “File: Open…” to load your .osm file. Do this for each one:
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:
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.)
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.
토론
2012년 5월 25일 17:29에 Mele Sax-Barnett님의 의견
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.
2013년 1월 26일 18:22에 aseerel4c26님의 의견
Thanks Richard! I have linked this page at osm.wiki/Potlatch_2#How_to_use_Potlatch_2
2017년 7월 12일 20:02에 net-buoy님의 의견
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.
2017년 7월 12일 20:07에 net-buoy님의 의견
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.
2017년 7월 13일 08:00에 Richard님의 의견
Do you have a link to the shapefiles?
2018년 2월 1일 19:01에 dpsspatial님의 의견
Richard, this is great!
2018년 2월 1일 19:20에 dpsspatial님의 의견
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…