gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.53k stars 819 forks source link

[docker] Add tiles server #2928

Closed OnkelTem closed 6 years ago

OnkelTem commented 6 years ago

This is to stake out a place for an upcoming PR with further enhancements of docker infrastructure - adding a tiles server, because currently we don't have one. Let me briefly describe what we have now and what I'm doing.

Currently we use the following containers:

They currently live in the root directory but after finishing works on #2913 (#2914) they will hopefully reside in the docker/ subdirectory (making the mess in the root directory a bit less overwhelming :) ).

While these facilities are enough for developing styles, we can't do one simple thing: serve tiles for whatever software takes them, including for example web applications or QGis. (There's one more thing we can't do atm: print maps using Nik4 for example, but this is a topic for another discussion.)

So the idea is to create one more image to run a container with tiles server:

Thinking about the contents of this image makes it obvious that it shouldn't depend on the kosmtik container but since it uses the same set of fonts it's imagined that fonts should be shared between these two containers via a separate fonts volume.

Another thing to consider - is how to cache renderd tiles. I think a new volume should be introduced for that.

There are other things to think about. Soon I'll post a PR and we can see at how docker environment works and organized.

kocio-pl commented 6 years ago

In my opinion that can be very useful tools, but it's outside the scope of this style. Docker image was meant as a simple installation of the development environment and I think it should stay like this in general.

But of course Docker architecture makes it easy to build bigger services composed of small, well defined boxes (microservices) and it would be good to use the full potential of this tool.

I think you could start a new project, named like osm-docker (probably under OSM account) to make it easy to find it and add more such images. More styles using the same database comes to mind, but also different editing tools (TileMill?) or different outputs (Magnacarto instead of Mapnik, serving different vector tiles...). That would make it easier to develop, test and deploy new tools.

OnkelTem commented 6 years ago

More styles using the same database comes to mind, but also different editing tools (TileMill?) or different outputs (Magnacarto instead of Mapnik, serving different vector tiles...).

That's exactly what I started with few days ago :) But then I realized that I can barely imagine that someone would want to install all the styles. Also I faced a problem I couldn't really overcame: openstreetmap carto comes with its own tagging tool and osm2pgsql style. I don't have any deep knowledge of them and what they would really affect, but this signaled to me that even database would be different for different styles. So is there really a way to build such a universal system with one database and many styles?

And while I still think it would be really good idea to develop a pluggable architecture where you can add styles in an ad-hoc manner (or even edit tools - like your said and that's cool!), this task I postponed for later when I get at least openstreetmap-carto working at full power. That's why I focused here.

As for this particular change - adding a tiles server - it doesn't look for me like a big deal really. I consider it more like a missing chain. I personally can't make much use of kosmtik as my goal was to create a tiles-layer in QGis to draw a map of some ancient cultures and for that I needed BOLD rivers seen from far distances/low zoom-levels :)

matthijsmelissen commented 6 years ago

In my opinion that can be very useful tools, but it's outside the scope of this style. Docker image was meant as a simple installation of the development environment and I think it should stay like this in general.

+1 I believe the thing you're proposing would be very useful, but only tangentially related to what we're working on within the scope of this repository. It might be only a couple of lines of code, but it might be a large maintenance burden (just look at the number of support questions we already get related to the Docker installation we currently have, I'd only expect it to increase).

OnkelTem commented 6 years ago

@math1985 Sounds reasonable for me.

So let's move then all docker stuff into a new project called osm-docker as @kocio-pl proposed? I don't mean that it's gonna be an immediate change - far from that thought. But later, the goal. What do you think?

randyhbh commented 6 years ago

@OnkelTem You think that using Docker and QGis, will be posible to translate osm-style raster tiles to vectorial ones?

OnkelTem commented 6 years ago

@RandyHBH No, I didn't think about using vector in QGis except of my own - the map I'm drawing. I just want to feed QGis with tiles. Also note that I'm very new to QGis and might not know some really cool things it can do.

kocio-pl commented 6 years ago

Some remarks from me:

kocio-pl commented 6 years ago

I think we can safely close this issue here. Some things can be still discussed here if needed, but I prefer it to be in the new project as soon as it's established.

OnkelTem commented 6 years ago

Ok. Thank you for the feedback. Actually I expected that this area is much bigger under the surface, then it looks at first.

So I really eager to start building this "Lego". Would it be fine to start with openstreepmap-carto as the first/default style? And what tools do you think I should consider to add in that default setup?

Let me enumerate some obvious things:

anything else?

I think that depending on a used style almost every step can go differently, e.g.

kocio-pl commented 6 years ago

So I really eager to start building this "Lego".

Great! I would be happy to test it.

Would it be fine to start with openstreepmap-carto as the first/default style?

I guess this is the obvious choice. :smile:

d3netxer commented 6 years ago

@OnkelTem Did you get started with this yet?

kocio-pl commented 6 years ago

See this project:

https://github.com/OnkelTem/osmcarto-docker