This is my first foray into mapping. I’ve used OSM as an end user, and I have just set up a tile server on a virtual machine as an experiment using the instructions at Switch2OSM. What I am learning is that there are probably many ways to approach my goal so I need some advice.
I need to put together a web-based (commercial) Intranet application which overlays some live status data on top of a map of the area.
The map area is probably around 1 square mile.
What is the best way to obtain (or generate) and present the tiles, in such a way that they can be maintained with updates from OSM (we’d be actively feeding changes into OSM as part of this - it’s an area under active development).
At the end user level I just need a pan/zoomable map with layers on it that include site data. (That data is sensitive hence why the application itself will not be accessible outside the organisation; map updates will need to be downloaded offline and pushed across to the server somehow.)
I take it that all map components need to be isolated in a the local intranet. Running updates for a small area might be more complicated than just refreshing the entire downloaded map once a day, which can be done readily by downloading one of the Geofabrik extracts cutting out the desired bounding box & just rerunning osm2pgsql again. For small areas the downtime will be slight (and as long as you dont invalidate tiles until it’s completed, users may not notice).
If the map layer can be served externally then I’d just use a regular leaflet call & make the standard OSM base map a background layer.
Yes, everything needs to be isolated. (That might not be a hard rule when it comes to it but it’s the basis on which we’re planning it for now.)
Updates don’t need to be frequent and don’t necessarily need to be automated. Most likely, someone will tell us there’s an inaccuracy, we’ll submit the change to OSM then pull the data onto our servers once it’s propagated. (Or: If there’s a way that we can use the change immediately ahead of it updating at the OSM end that would be better still.)
At this point in my OSM journey that means relatively little to me but I’ll work it out!
But before I get that far: Is this the best way for me to approach it for such a small area? Could (should?) I be taking the data offline and converting it into an intermediate zoomable format (svg?) that I use in the application without the need to incorporate a tile server?
I do want the application to be responsive at the user level (where the browser might not be running on particularly powerful kit) so I’m guessing that a tile server on powerful hardware will reduce the demands at the client end, but as a novice to this I’m trying to avoid too much guessing!
I think the basics of buillding a tile server would offer highly responsive maps with relatively little pain (the instructions are copious & take about an hour to work through). Any vector-based approaches (including SVG) introduce all sorts of less-well worked out technology stacks (there are vector tile based formats, but nothing consistent enough to document on the switch2osm site).
Geofabrik are a small German company who provide daily updated extracts of various parts of the world from OSM (by country, and regions inside a country). Using their extracts is pretty much the standard way lots of people consume the data, particularly if they want a small subset.
osm2pgsql is the main program for transforming raw OSM data into a format in PostGIS which can be rendered. It allows both full refresh & incremental updates. One of it’s more important purposes is converting osm raw data into polygons: it’w hard to find any other tool which does this as well (well over 10 years of development, use by the main OSM tool chain etc. mean that it is pretty much the reference implementation). For manipulating raw OSM data there are other different tools: Osmium (most recent & most powerful), Osmosis (Java based, but cumbersome & being replaced by Osmium) or osmconvert (light while monolithic C program which is v. easy to get running). As in your use-case the primary need is for something which cuts a bbox of data from a larger file, the last one is probably the one to start with.