Re: osm-tile-server
On 06/09/15 17:38, Ruben Undheim wrote:
> I've been working some days on a native Debian package for setting up
> an OSM tile server.
> The idea is to be able to support several tile providers, but
> currently only tilelite is supported.
>
> The code is here: https://github.com/rubund/osm-tile-server
>
> It consists of three binary packages:
>
> osm-tile-server:
> Meta-package which Depends on osm-tile-server-base and Recommends
> osm-tile-server-tilelite
>
> osm-tile-server-base:
> This package sets up the postgres database, the db user and
> provides the user with a debconf interface to select region to import
> into the database. When the region is selected, a download from
> Geofabrik and import may be started at once, or delayed until the user
> wants to get it done (by calling "osm-tile-server-process")
>
> osm-tile-server-tilelite:
> This package contains basically systemd service file for starting a
> tilelite background daemon connected to the database configured with
> osm-tile-server-base. It also contains a sysvinit startup script.
>
> There will also hopefully be a osm-tile-server-mod-tile after a while..
>
> The idea is then to be able to run. "apt install
> osm-tile-server-tilelite" and then "dpkg-reconfigure
> osm-tile-server-base", select a region, and have a fully functional
> tile server with the selected region.
>
> Because of #797975, it doesn't work in sid right now, so the best way
> to test it is to run Jessie, and first build and install
> openstreetmap-carto there.
>
> I would like to get some feedback on this - if it sounds like a
> reasonable way to proceed, or if I'm completely off track. What else
> could be done?
This sounds really good! I was working towards this direction also, this
is why I packaged openstreetmap-carto. I have also written some
documentation on the wiki as a stopgap measure until tileserving can be
better supported through packages.
https://wiki.debian.org/OSM/tileserver
https://wiki.debian.org/OSM/tileserver/jessie
https://wiki.debian.org/OSM/tileserver/sid
More recently I have been trying to add a debconf frontend to tilelite,
which does work to a certain extent, although I have not worked on it
for a few weeks (and I cannot remember what needs doing next).
https://anonscm.debian.org/cgit/pkg-grass/tilelite.git/log/?h=debconf
I have still not figured it out in my own head how exactly this stuff
would all work together, and it might be worth dumping a load of
information in to a wiki page to see if we can figure it out (and write
something down in the process).
> Christopher Baines: Do you think that there is a way to include some
> basic shapefiles together with openstreetmap-carto so that tilelite
> will be able to start after a basic install of openstreetmap-carto
> even before downloading all the big files?
So, if I understand what you are getting at here, you don't want to
start tilelite until openstreetmap-carto is usable.
Now currently, usable means that the package is configured, and the user
has selected to download the data files.
But, as tilelite does not depend on openstreetmap-carto, if you have a
metapackage that pulls in both of them, the packages could be configured
the other way around, which would mean tilelite would start before
openstreetmap-carto is configured, and the data files fetched.
Having the data files in the openstreetmap-carto package, or a package
it depends on would solve this, but I am not sure if this is possible at
the moment, as one of the files downloaded is around 413MB, which might
get rejected by the Debian archive maintainers.
What I would recommend currently is a multi-stage approach.
The first stage is installing the stylesheet.
The second stage is creating and populating the database.
The third stage is getting the rendering and tile serving components setup.
The reasoning behind this order is that, importing the data in to the
database depends on having the stylesheet available (as you may need the
style file).
I think this could work as follows.
$ sudo apt install openstreetmap-carto
User inputs the string "scotland" as the name of the database, and
selects to download the shapefiles.
$ sudo apt install osm-tile-server-database
The MVP (minimal viable product) for this would be to get from the user:
- The name of the database
- The location of the style file (could also give the option to use the
default)
- The location of the data
This would then create the database, and run osm2pgsql to import the data.
$ sudo apt install tilelite
The user then gives the details about the mapnik xml file (and the other
information e.g. port and url).
The tileserver is now running.
I have found it hard to find time to work on Debian recently, and
specifically the OSM stuff recently as I am no longer working on any
related projects. I am going to try to get around to doing some stuff on
openstreetmap-carto soonish though.
Reply to: