We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Creating printable maps

00:00

Formal Metadata

Title
Creating printable maps
Subtitle
From OpenStreetMap data to large scale maps on paper
Title of Series
Number of Parts
95
Author
License
CC Attribution 4.0 International:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
There are a lot of online services that produce nice maps from OpenStreetMap data, but only very few that generate output suitable for printing. This talk is going to present MapOSMatic, a service that produces large scale single and multi page high resolution maps.
Keywords
MappingGradientLattice (order)DatabaseComputer engineeringFile formatSelf-organizationLetterpress printingEndliche ModelltheorieTexture mappingObservational studyCASE <Informatik>Chemical equationXMLComputer animation
Self-organizationMappingDifferent (Kate Ryan album)Neighbourhood (graph theory)CurvatureTexture mappingThresholding (image processing)Lecture/Conference
Graph (mathematics)MappingImage resolutionTouchscreenPlanningPixelBus (computing)WebsiteGraphics softwareUniformer RaumFile formatNeighbourhood (graph theory)Computer animation
Shared memoryFile formatMedical imagingTexture mappingDifferent (Kate Ryan album)Probability density functionComputer iconComputer animation
Right angleTexture mappingBitMappingPoint (geometry)QuicksortPlanningScale (map)WebsiteComputer animation
Multiplication signMappingDifferent (Kate Ryan album)Web 2.0Computer configurationFront and back endsTexture mappingQuicksortProjective planeVolumenvisualisierungWebsiteComputer animationXML
File formatFront and back endsWeb 2.0QuicksortProbability density functionProcess (computing)Web pageMultiplication signTexture mappingWebsiteForestSampling (statistics)XMLComputer animation
WebsiteProcess (computing)Computer fileCodeComputer animation
Revision controlSoftwareMixed realityAdditionAuthorizationCuboidCheat <Computerspiel>Overlay-Netz2 (number)XMLComputer animation
Texture mappingUser interfaceInterface (computing)Multiplication signSlide rule1 (number)MappingExterior algebraBitSpacetimeXML
Web pageOverlay-NetzType theorySingle-precision floating-point formatTexture mappingRule of inferenceVolumenvisualisierungRepository (publishing)Greatest elementDifferent (Kate Ryan album)Subject indexingWebsiteAreaObservational studyMaxima and minimaCycle (graph theory)Adaptive behaviorSource codeXML
Texture mappingAddress spaceOverlay-NetzTrailEmailGreatest elementComputer configurationSlide ruleFormal languageResultantForm (programming)LengthArtistic renderingXMLSource codeJSONProgram flowchart
WebsiteMobile appEmailRevision controlSpacetimeAddition
Texture mappingBitProjective planeSoftwareWebsiteRoutingArtistic renderingMetric systemObservational study
RoutingQuicksortData storage deviceReverse engineeringTexture mappingDifferent (Kate Ryan album)Open setArtistic renderingAreaNumbering schemeMappingMereologyRootSystem administratorTopostheorieTransportation theory (mathematics)Focus (optics)
Texture mappingTransportation theory (mathematics)Hill differential equationLevel (video gaming)PlanningOverlay-NetzMappingSoftwareZoom lensWater vaporRight angleComputer animationXML
Revision controlTexture mappingVotingBlock (periodic table)Time zoneLimit (category theory)Green's functionComputer animation
InformationOverlay-NetzWebsiteMappingRoutingBootingCurvatureQuicksortArea
RoutingDegree (graph theory)Sheaf (mathematics)Different (Kate Ryan album)Texture mappingOverlay-NetzAngleContrast (vision)Google Street ViewFourier seriesEngineering drawing
DatabaseCircleMathematicsDigital electronicsTexture mappingSlide rulePlanningInterface (computing)Functional (mathematics)Regular graphExtension (kinesiology)CodeWebsiteShape (magazine)Connectivity (graph theory)Parameter (computer programming)Connected spaceDivisorInformationArtistic renderingPlug-in (computing)Context awarenessContent (media)Scaling (geometry)VolumenvisualisierungObject (grammar)ResultantComplete metric spaceProxy serverSource codeElectric generatorPoint (geometry)Line (geometry)MultiplicationWeb pageComputer animation
InformationMatrix (mathematics)Vector graphicsComputer programmingObject (grammar)HeptagonQuicksortCircle
Object (grammar)Position operator2 (number)Process (computing)BitMultiplication sign1 (number)Lecture/Conference
Probability density functionPosition operatorOverlay-NetzStandard deviationVolumenvisualisierungComputer fileDifferent (Kate Ryan album)PlanningSelectivity (electronic)Letterpress printingInterface (computing)InformationTexture mappingSubject indexingCycle (graph theory)User interfaceOcean currentCuboidComputer iconNeighbourhood (graph theory)
Instance (computer science)Probability density functionMultiplication signTexture mappingInformationPoint (geometry)Physical lawComputer animation
Instance (computer science)Stack (abstract data type)Set (mathematics)XMLComputer animation
Electronic mailing listNeighbourhood (graph theory)Functional (mathematics)Computer fileShape (magazine)Directory serviceInsertion lossGraphical user interfaceMappingIntegrated development environmentDatabaseMetadataMereologyGroup actionProjective planeLine (geometry)NeuroinformatikSpeech synthesisCuboidVirtual machineUnit testingResultantWeb 2.0Server (computing)Local ringAreaField (computer science)DebuggerInformationBinary fileAdditionSoftware testingSoftware bugInternet service providerSoftwareTexture mappingInterface (computing)XMLComputer animation
MappingSoftware testingVirtual machineBitFormal grammarPhysical lawInterface (computing)VolumenvisualisierungExpert systemLocal ringFigurate numberWeb browserEndliche ModelltheorieConnected spaceComputer fileState of matterUser interfaceSlide ruleInternetworkingComputer animation
Goodness of fitTexture mappingTouchscreenExecution unitOpen setOpen sourceField (computer science)Process (computing)Computer animation
Connectivity (graph theory)State of matterComponent-based software engineeringDatabaseWebsiteLine (geometry)Open setPlanningSlide ruleComputer fileIterationMultiplication signInformationTable (information)Flow separationDefault (computer science)Game controllerXMLComputer animation
MappingLevel (video gaming)MathematicsLetterpress printingInternet service providerTexture mappingRotationSphereDirection (geometry)Orientation (vector space)PlanningPixelVector graphicsDebuggerMaxima and minimaLimit (category theory)Image resolutionSubsetPlug-in (computing)CodePatch (Unix)Link (knot theory)Subject indexingTerm (mathematics)Field (computer science)VolumenvisualisierungWebsiteUser interfaceNeighbourhood (graph theory)TheoryOverlay-NetzTrailDatabaseHill differential equationAreaImplementationSoftware bugQuicksortState of matterAdditionDifferent (Kate Ryan album)Block (periodic table)Slide ruleVotingMobile WebCellular automatonKey (cryptography)
Texture mappingMultiplication signNeighbourhood (graph theory)Control flowProcess (computing)VolumenvisualisierungUniform resource locatorLecture/Conference
Endliche ModelltheorieTexture mappingComputer animation
Computer animation
Transcript: English(auto-generated)
Yes, so this is about how to create maps like this with a printer like this. And first to me, I'm Hartmut Holzkrefer, I live in Bielefeld, Germany.
Yes, exactly. I studied electric engineering and computer science in Bielefeld and I've been an OpenStreetMapper since 2007. Next weekend it's actually exactly 10 years
and I work for a living as a database support engineer for MariaDB. And I always love to have a city map whenever I had a new flat, just to know where I am and what's outside when I leave the door.
And I also got this printer here rather cheap. It was an old HP model and when its successor came out, this one fell in price from about 1200 to 1600 euros to only 400 euros.
That's when I said, okay, I'll buy it. I don't know whether it will work for me but I'll take the risk. And after a while I was really able to print full format maps with it. And about two years ago I was asked by an organisation working with refugees in my town
whether I could create neighbourhood maps for the different shelters they were operating. So this is not a shelter neighbourhood map, this is a neighbourhood map for my own flat.
That is hanging on the other side of the big map you've seen before. And this is to show our guests when we have guests in the house, where the neighbour has the bus stops, the bakery and stuff like that.
So when I was first asked to produce these neighbourhood maps, the very first plan was we just take a screenshot and then we edit it with some graphics program and we are done. As you can see this works for small paper formats but not for big formats as the pixels become too big.
It would only work if you had a very high resolution screen to take a screenshot from. So plan A failed almost immediately so we needed to plan B.
And plan B was on the OpenStreetMap website. We have this share icon here where you can export an image as PDF or different formats and you can select the size of the map you want to export here.
That already worked a bit better but still there's a slight missing. So the problem here was there's only one map style here. You can only get the original OpenStreetMap style,
not even the three other map styles that are on the OpenStreetMap.org website itself. And it is pretty hard to get the right aspect ratio here so that the export really fits your paper. And it's also a bit of guesswork to get the right map scale here
so that you don't have resizing artefacts on the map. So plan B also failed, sort of. And then plan C was to look what other options are there. At the time there were a few different web front-ends that would create printable maps.
But the only one that really worked out as I needed it was mapposmatic which was a project that was developed by some French guys from about 2009 to 2013.
And it uses the mappnik renderer just as the OpenStreetMap website itself does so you can use the same map styles. And it provided more than just the default style. I think the original one provided four or five styles. And it has a pretty easy to use web front-end
and in the end it can produce different formats like so it can render on a single page or it can create multi-page booklets
and it can render as PNG or as PDF or as SVG. SVG was interesting because it could then take that into Inkscape and then put all these side markers you've seen there on the markers on the map.
So that sort of worked out but it was also a very time consuming process. Also the problem with the original site was that it was still running but it was not really maintained so the code base was pretty old and especially the style files used were also pretty old.
So you still had the old OpenStreetMap style where highways were green and stuff like that just like OpenStreetMap looked in 2013. So in the end I decided to set up my own fork of the site
to get all the software and all the style sheets used up to date. There was original instructions for installation where a mix of you need Ubuntu 10.10 with these packages or 12.10 with these packages and all these packages you need to compile yourself
as the versions in Ubuntu are not current enough and now it works with original packages of the box so there's no need to compile anything anymore. All the style sheets are up to date. There are some additional style sheets and also an overlay feature where you could put
a second style sheet on top of a first one. You'll see that later. And I applied lots of small fixes and small improvements too. So this is a quick run through how to create a map with this web interface.
First you can either search for a city and only the dark entries here are valid. The grey ones are not usable but here we have a dark one for Passau. All these slides are all about Passau because that was where I gave the talk last time
and Passau has a river, St. Augustine doesn't so the maps will look a bit more pretty. So the alternative is instead of just selecting a city name and have the map auto-sized is like in the OpenStreetMap export
you can define your own map area and then the next step is to decide the layout which is either single page big map or you can print a multi-page booklet
and for the single page formats you can also have a speed index on the right side or on the bottom side. Then we have a wide collection of style sheets now. I've tried to support every MapNIC style sheet for which I could find an open repository.
I have some example renderings in a minute. And there's also a collection of overlays that I will also describe in detail later and stuff like overlays for fire hydrants, for max speed, for different types of routes,
for hiking, cycling, mountain biking. And what you see there is an adaption of the Surveillance by Surveillance website that allows you to map surveillance cameras and OpenStreetMap and then when you've selected how your map is supposed to look like
you then select the paper size, whether you want to have it portrait or landscape. Sorry for the German slide here. Optionally you can upload one GPX track you want to have on the map as an overlay
and then in the final form you can define the title that is printed on top here. You can select the language that is used for the copyright notices on the bottom. And optionally you can give a mail address that I use to send you a notification
when rendering has finished with a URL where to pick up the results. So you can either sit in front of your computer and wait for the rendering to finish or you can have an email sent to you when it is finished. So this is a quick run through of the different app styles.
This is original OSM style as it is on the OSM website. I also have a black and white version of that. We'll see that later when we come to the plugins. It is often better to have a black and white base layer when you put additional stuff on top.
This is the German style sheet that is used in OpenStreetMap DE. France also has their own style sheet and what's special about the France style is that they do very detailed rendering of sports sites
like football stadiums or golf courts. This was a style sheet that came with the Mappo asthmatic software itself. And then there are a few more. This is the humanitarian project style as it is also on OpenStreetMap.org.
The hike and bike map style puts a bit more focus on hiking routes like here. So foot passes and bicycle routes. This is a style from Russia that focuses on being more useful for bicycles.
This is the open topo map that tries to mimic the style that is used in German administration for official maps. This is the open river boat map.
It has a focus on stuff that is important for people who travel along rivers with their boats. So it has special features for rendering harbours and stuff like that. Unfortunately in that part of Passau there is no harbour so we don't see that, but you get the idea.
Then there is a special map for skiing called pistol map. Again you don't see any skiing features here in Passau. Here I did a second rendering of a different area. This is the village of St. Moritz
with all the different ski routes and all the transportation for skiing put on top of the map. You also see that it uses hill shading so you get an idea of what the landscape looks like.
There are some fun styles that were created by some people like this one. It is supposed to look as if you had drawn the map with a pencil by hand. This is supposed to look like a floor plan of a spaceship
but it doesn't work at the zoom level. These were all the base maps you can use with the software right away. Then there is also a collection of overlays. The first one I did was the fire overlay.
This one has all the fire departments and all the fire hydrants. It is useful for fire departments to quickly see where the next hydrant to get water from.
We can skip that. That was the very first version of that style sheet. This is the style I created to look similar to the Ito speed map.
It renders max speed. Green is zones where you are only allowed to drive 30 km. Orange is regular 50 km city limit. Red is 80 to 100 km. Everything that is still white doesn't have any speed information in the map yet.
This is a good thing to find where you still have gaps where information is missing. This one is an overlay that renders all hiking routes in an area.
This style is inherited from the Weymark trails website. You can have printed hiking maps like this one that is usually also hanging from a wall in our flat that has all the hiking routes in our city.
Most of them we tracked ourselves. Then there is what you have also seen in the preview, the surveillance map. This shows a section of the map where we have four different surveillance cameras,
three dome cameras that can scan 360 degrees and one fixed mounted camera that only has a straight viewing angle. This overlay is actually special as it is not easily possible to do this in Mapnik itself
because Mapnik does not have any feature to draw circles or circle segments. From the database side it is not easy to create circles either.
Running way too fast I think. We have seen circles and circle segments here. This is not possible or not easy to do in Mapnik itself or to have the database generate circular shapes.
What I actually did here is to bypass Mapnik completely. Mapnik renders the base map. Then we take the result and then use Python and Cairo graphics to put all the camera information on top in Python code
not using a Mapnik style sheet at this point. For this I have created a simple Python plugin interface to extend the rendering component of MaposMatic.
When you look at the source code you have the OCD's map is the rendering component of the website that has a layout folder where all the rendering for single multi-page rendering is in
and then there is a new subfolder now rendering plugins. There you can implement additional renderers like the surveillance renderer that have to implement that layout here.
Such a plugin only needs to provide one Python function named render. This gets a renderer object and in the renderer object is all the information about the map itself like the extent of the map, the upper, lower, east and west bounds,
the scale factor and things. It has a database connection that you can readily use to submit your own database queries. As a second parameter it gets the Cairo graphics content context that the additional rendering shall now happen on.
I did not put code examples in the slides here but if you are interested you can have a look at the code. All this was just an extension of the regular MaposMatic interface as it had already been developed in France.
I also wanted to do these neighbourhood plans. Originally I did an SVG export then loaded the SVG in Inkscape then did all these let's flip back to many slides
so this one here. Originally I would render the map just on this size then manually would put in all these sidebar items manually put in using Inkscape or another vector graphics program
to put in all these markers, set all these square information by hand, I put the UHIR circle by hand but it turned out that Inkscape is not really good at working with really large SVG documents.
So it sort of felt like back in the early days when I had my first 386 with CorelDRAW and 2MB so you pick an object, you drag it a few seconds later it appears at the new position you see I've dragged it a bit too far, you drag it back.
So very time consuming process. Sorry, that's almost like a something.
So this was one of the early ones I did. What I did is I also extended the renderer that I can pass in a file that has all these marker positions
then automatically puts as an overlay the markers using CorelDRAW graphics, the UHIR marker also generates the sidebar index and everything and there is also a web interface for this. Currently it is a separate thing
and here you can put all the different markers you want to have on the map and you have a selection of different standard icons and when you've placed all the things you want to have in this neighborhood plan
then there is a little print icon here and that will automatically wrong button automatically determine the right bounding box needed so that all markers fit so you don't even have to select that and after you submit the print
usually one or two minutes later sometimes it takes a bit longer you get back a PDF that is ready for printing and it already has all these marker and sidebar information correctly put in. So once I had this finally done and working
creating such a neighborhood plan didn't take an hour or two I did it manually with Inkscape but now it is just a matter of five minutes at best to put all the points of information
you want to have on the map and another five minutes max to get the printable PDF back so big time saver and the even bigger advantage for me is now I can explain to other people how to use it and to use it themselves and just give me the PDF
once they think it is complete and I print it and I do not have to do all this editing myself anymore whereas the original workflow I couldn't possibly explain to someone else so now I am running my own instance of this
that is publicly available the original maposmatic instance unfortunately had several data based failures over the last two years and has now completely been offline since May also so we are back in the situation where there is only one public instance
but what I did is I also provided means so that you can run your own local instance of the full software stack and why would you want to do this? Well, maybe you have special customized style sheets that you want to render
that I do not support or you want to be able to create maps offline or you maybe want to keep your results private so the neighborhood plans these are private on purpose
but the general maposmatic interface has a list of all the maps it ever rendered and the last hundred or so are even preserved and it is downloadable so everyone can download whatever map you created
or maybe you want to work on this software yourself and want to provide bug fixes or add new features and need a test environment for this and if you wanted to set this all up by yourself you would have to install MapNIC you would have to gather all the required style sheets
and the extra files these need so for example there are extra shape files for coastlines sometimes in OSM data itself coastlines are broken and you have large parts of countries flooded so we do not take coastlines from the live database
but from specially exported shape files which have been tested to be correct as far as rendering goes or you may need height information like for hilt shading and the contour lines these are not in OpenStreetMap itself but are imported from
space shuttle radar data provided by NASA and lots of other stuff you also need to import StreetMap data into a local postage database using an XML or
PBF planet file if you want to render maps for the full planet or a smaller extract for the area you are interested in you need to import this into the database with the OSM2PGSQL import tool you may need to add additional OSM2PGSQL import style files
that define which fields should be in the database and you need a local web server that provides the front end so a lot of things to set up and so for this I created
something that almost works out of the box at least it works for me works on my computer and that is I created a virtual machine set up using VirtualBox and Vagrant and for this you just need to check out that project from GitHub
and in the project directory you have to provide an OpenStreetMap data file that needs to have this special name so it needs to be in the portal binary format or you want to have that anyway as these files are smaller than XML files
and you can for example download extracts from GeofabricTE they provide OpenStreetMap extracts for all countries and for Germany, also for all states and for the larger states like North America, also the districts
and then you just say Vagrant up and depending on how fast your machine is and how fast your internet is to download all the extra files that are needed it takes about half an hour to two hours to get ready
and once it's ready okay there's a slide missing once it's ready you connect to localhost port 8000 with your browser and you have the same web interface as on the public side and also most of the style files of the public side ready to use
but you can only render maps for the OpenStreetMap extract you exported so on my public side I have the whole planet and for my local testing I only have the district of Detmold where I'm living yep
so what have I learned over the last two years working with this stuff is paper maps are a bit more complicated to create than a map on screen when you use open layers or leaflet but all the necessary tools to create a good paper map are there
and are open source and having a map front and that simplifies the process is a very good thing to have so if you just want to have a standard map you can skip over most of these dialogue fields I showed you just select city name, paper size, have it rendered
and it was harder than originally expected to get this working especially to get all the software components up to date but now that it all works I'm pretty happy that I did it even if it was harder than expected
I think it was worth it and there is well, one of the slides ended up in my speaker notes so there was supposed to be one more slide that has feature plans and open issues one thing I have, I have
contour data now so height contour lines for all of the planet these were donated by OpenPistoMap who had done a very good full import for their website and I could get the database
table with all the height information for the planet from them because importing all this laser data yourself is a very time consuming thing OpenSnowMap people say it took them several months, several tries sometimes took a week for each iteration to get it done perfectly with old files
so I'm happy that I didn't have to do that too but what I do not have yet for a very small area just for Switzerland, Austria and southern Germany is the hill shading
this I want to extend to the full planet then I have been thinking about a bring your own style sheet feature so right now it is only possible to upload custom GPX track as an overlay but in theory it should also be possible to allow
that you upload your own MapNIC XML style sheet and have that rendered instead of the prepared styles the user interface still could use some improvements I especially want to merge the two front ends for general printing
for this neighbourhood plan thing and for that I would especially need that render plugins cannot only draw on the map but also add their own index terms so that you do not only have the sheet index but that the plugin can add
and by the way all the fire departments in the cities are here and some limits I've been hitting one is when you want to have a professional printer print a map
these usually only accept PNG or JPEG, no vector images some of them have ridiculous size limits but even if they allow for large PNGs the maximum resolution I can offer right now is 300 dpi
as at higher resolution Cairo graphics hits hard limits as it can only produce PNGs by a maximum size of 32,000x32,000 pixels so that would require changes in the low level tools used
and one thing I would especially like to have would be plans that do not have north up but that are rotated so that you have your direction of use like some cities have these orientation plans
where you have your here and also not this is north but this is the direction you are looking in so something that is on top of the map is a place you can reach by just walking straight and Mapnik unfortunately does not support this yet it can only, mostly only flip and have south on top for the southern hemisphere
but you can't do rotation at will the only thing you could do was it would be to transform the map data when importing it into the database already but then you had one fixed rotation and would not be flexible
so unfortunately there was someone who had written a patch for this in the past but the patch is referenced in the Mapnik bug tracker but when they switched to GitHub they also imported all the
the bug tickets from the old bug tracker into the GitHub bug tracker but all the attachments got lost so the ticket is there, there is a post oh I have an experimental implementation for this and here is the patch and that is a dead link and the person who submitted the patch does not respond to email or anything
so somehow this code is totally lost unfortunately I am afraid and one third thing is right now when you have a professional print service
and want to have a map printed you have to download the png from my website then upload it at their website and put all the extra information in and I thought it would be nice for print services to have a direct interface so that they get some additional business
and I could just put an optional field in forward this rednet map to that print service for printing but the two services I contacted so far would only be interested if you would produce at least 100 posters per day
and that's more like what I produce per month so somehow commercially they are not interested in it and you can print maps at a professional service but you have to go to all the steps yourself no automation in that
yeah that's about it and as you see I have the printer here with me so if you want to have a map of your neighborhood or special place I can offer to print one in the breaks here not during talks obviously and now it's time for questions
yeah I'm already rendering a map on your server okay so any questions?
so if you want to create render jobs this is the URL no questions? come on
okay I'm still around if you have questions later or want a printed map okay so thank you for your great talk