mapping – discontinuity https://discontinuity.ca Adina Bogert-O'Brien Fri, 09 Jan 2015 16:49:56 +0000 en-US hourly 1 https://wordpress.org/?v=5.5.3 DIY Guidebook – Parsing OSM data https://discontinuity.ca/?p=154 Fri, 09 Jan 2015 16:28:31 +0000 https://discontinuity.ca/?p=154

I used the Geofabrik package of OpenStreetMap data for Berlin as a basis for several layers in my map. Once I unpackaged the file to a simple .osm, it’s over 700 MB. I did try to open this in QGIS, but… that didn’t work so well. Fortunately, you can filter the file before bringing it […]]]>

I used the Geofabrik package of OpenStreetMap data for Berlin as a basis for several layers in my map. Once I unpackaged the file to a simple .osm, it’s over 700 MB. I did try to open this in QGIS, but… that didn’t work so well.

Fortunately, you can filter the file before bringing it into your mapping software using osmfilter. The OSM wiki and/or the query feature on openstreetmaps.org will help you figure out how to filter for what you’re interested in.

For example: I wanted to grab all the museums that OpenStreetMap knows about. I looked on the OSM wiki for museums. This page shows that museums will be labelled with the tag “tourism=museum”. Then I ran this command:

./osmfilter berlin-latest.osm --keep="tourism=museum" -o=museums.osm

This runs the osmfilter script (located in the folder in which I’m executing the command) on the berlin-latest.osm. It exports a file museums.osm that includes only those objects with the tag “tourism=museum”.

I separated the transit information I wanted to import into stations and lines. It’s also divided by operator and type (S-Bahn, U-Bahn, tram, etc). To get the U-Bahn stations, for example, I ran

./osmfilter berlin-latest.osm --keep"railway=station AND station=subway" -o=ubahnstations.osm

For the tram lines, I ran commands like this:

./osmfilter berlin-latest.osm --keep"route=tram AND operator=BVG" -o=trams/TramWays.osm

./osmfilter trams/TramWays.osm --keep"ref=M1" -o=trams/M1.osm

I could definitely also have left the tram routes all as one file and done filtering in QGIS to change the colour, but this way seemed easier.

Here’s how it looks after I import some layers this way:

QGIS with imported layers

]]>
DIY Guidebook – Brainstorming and Project Introduction https://discontinuity.ca/?p=138 Fri, 09 Jan 2015 14:02:42 +0000 https://discontinuity.ca/?p=138 Rob and I get many guests in our place in Berlin. We have a pile of guidebooks, museum pamphlets, and other stuff for people to look through while they’re here, but I like to give them a personalized guidebook with stuff I really like in it.

I’ve had the Moleskine City Notebooks before, but they have the persistent habit of walking off. This is a paaaain, especially after I’ve entered all kinds of information into the book by hand. Also, I always make mistakes when writing in the books – apartment on the wrong side of the street, wrong labels on the pages, tram lines going the wrong place – and there’s no eraser for my felt tipped pens.

Modern technology means I shouldn’t have to do this! I will make a little booklet out of A4 folded once to give to guests. This way they can write in it and take it home and I can generate custom maps if I want.

Project plan:

  • make maps including index overlay in QGIS
  • generate text pages in LaTeX
  • use LaTeX or some other plugin to generate a pdf for printing and binding (proper page ordering)

What I’d eventually like to do is:

  • write a script so I can have a booklet be generated automatically (query QGIS, export to image, concatenate to pdf)
  • have map layers be selectable in the script (some people don’t like coffee, some people are really into transit history, etc)

Some problems I’ve already encountered:

  • QGIS isn’t the most stable program. I have some paths and nodes imported from OSM, but I don’t think it’s an unreasonable amount? Anyway, being patient and saving often seems to be enough to keep me from losing too much data.
  • The OpenLayers plugin acts a little strange when exporting maps. The resolution of the exported maps is usually pretty crap, and sometimes the maps are offset from where they should be. I’d like to solve this one by using a georeferenced image / images at useful resolutions.
  • I don’t seem to understand how the scale bars in the exported images work. They seem to be wrong most of the time, which suggests I’m doing something wrong.
]]>