Self host osm tiles - openstreetmap

I want to host osm tiles and styles by my self on my server. I got a really nice style here
https://github.com/CartoDB/basemap-styles#1-web-raster-basemaps
It's free for use under observation of the license requirements. But i don't know how to make the next step.
I allready implemented the map on my site with using leaflet and this code (just the tile implementation part)
L.tileLayer(' url ', {}).addTo(map);
How to go on to replace this hosted version to go on to self hosted one?

You need to set up your own tile server by following the steps at switch2osm. This is an rather advanced step and requires a sufficient powerful system with fast storage and large memory. At least if you want to server tiles for the whole world. Smaller extracts have lower requirements.
Alternatively switch to vector tiles, e.g. Mapbox GL. It allows you to influence the rendering style without having to set up a large infrastructure for serving the data.

Related

How to implement dynamic vector tile sever

In my application, the backend (written in Java using spring boot) is serving REST API which expose a service that returns thousands of coordinates (based on filters it gets from the client). My frontend is using this API and then displays the results in Mapbox map.
The performance is not good enough for 100K of points and more, and we want to use vector tiles instead.
Since the data is dynamic, we would want our backend to act as a vector tile server, is this possible?
What's needed in order to server vector tile requests? Is there a library that can help?
Yes, this is possible. It's pretty straightforward to accept a request for a vector tile, then generate that tile and serve it back. It gets a little bit more complex when you factor in caching for performance, and trying to avoid redundant work.
I'm mostly familiar with JavaScript libraries, but mapbox-vector-tile-java looks like it will handle the part of turning geometry into a Mapbox vector tile.

Tile styling in Open Street Map (with Leaflet)

Is it possible to use different colors for Tiles in Open Street Map?
In Google Maps API you can style the map - is there a same feature in Open Street Map or even better are there any different tile templates on the web for download and use in OSM?
OpenStreetMap project provides map data. In order to display web maps OSM data needs to be pre-processed and rendered. Depending on whether you use raster (for example default leafler) or vector tiles (mapbox-gl) steps to modify styles are completely different. Raster styles are usually generated using mapnik rendering library with mod_tile and apache web server. OSM data needs to be imported into PostgreSQL database. Depending on the amount of data you want to process it can take different time from couple of hours for single city to days for the whole planet and require very good hardware (6-8 cores/ 32 GB ram and higher). Then you need to edit special CartoCSS styles to change map appearance. Vector maps and tiles is completely different story but it will require comparable efforts to create your custom map style.
What I suggest is to go and find OSM maps provider that have different styles from default OSM by the way here is an excerpt their tile usage policy (https://operations.osmfoundation.org/policies/tiles/):
OpenStreetMap data is free for everyone to use. Our tile servers are not.
So look at these providers, they can save you a lot of time and money:
https://openmaptiles.org
https://getmaps.io
https://stadimaps.com
and others from https://switch2osm.org/providers/

Serving a large dataset with minimal bandwidth

I want to serve a large spatial dataset, preferably without webgl support, over minimal bandwith. I've seen many examples doing so. For example:
https://interaktiv.morgenpost.de/europakarte/
What would be the best way to achieve something like this? Is it possible without hosting my data on mapbox, maybe host the data on AWS S3? How should I approach this?
I found a solution. There's a technology called an UTFGrid, which are tiles in JSON format. These tiles can be generated in many ways, for example by using TileMill and MB-util. These tiles are very small, but enable the user to see featureinfo on hover. Once these tiles are generated they can be hosted anywhere you want, AWS S3 or your own web-server.

How to intagrate Open Street map editor iD withe geoserver data or planet osm database

I am trying to create my own map with the help of osm data and geoserver,successfully partially completed it with my own SLD..Now I need a web editor for edit that map data .I select "iD" for it. i don't know how to configure it with my planet osm data base
You need to keep in mind, that your current setup is designed to work for rendering only (so an OSM like basemap).
So what you IMHO need:
OSM API services
This is called rails port and is a bit tricky, as it's pretty unusal to clone the whole OSM infrastructure for "usual devs". Please be aware that you also need to think about how you want to deal with your and the official data, as you create some 'fork' of the planet and create a parallel world dataset (update workflow, sharealike license, ...)
Own iD instance
You should also host your own iD instance (or adapt the JOSM settings for each user) so you can contribute via your own API services from step 1.

Map rendering using OpenStreetMap

Does OpenStreetMap just provide GIS data? To render maps and have a browser based UI to show maps with data, would a developer need to use something like Mapnik?
OpenStreetMap provides data yes, and you'll need specific tools to make map with them. You first need to put the data in a true GIS format, which OSM is not. Think about PostGIS, an osm2pgsql tool is designed for that. Then, you'll need a rendering tool, i.e. a cartographic engine. You can use Mapnik or MapServer. Tilemill or Kosmtik can help you designing your map styles.
Take a look here.
yo can export data form OpenStreetMap and render your own map.
Take a look at
http://www.slideshare.net/jones139/rendering-openstreetmap-data-using-mapnik
http://www.slideshare.net/artemp/mapnik-sotm-2007
There's a fuller list of rendering libraries for OpenStreetMap data here, both free and commercial.
http://wiki.openstreetmap.org/wiki/Renderer
Disclosure: I am the developer of one of them.
OpenStreetMap provides map data out to a wide sprawling ecosystem of different downloads and tools offering developers different map-making and map using possibilities. Here is a diagram I drew which captures some of this:
So the data comes out of the core of OpenStreetMap, in the form of 'planet downloads', one big unwieldy blob of XML (and diffs), but from there it fans out into a range of other offerings to developers, many of which are provided by 3rd parties. Taken together "OpenStreetMap & Friends" provide lots of possibilities.
If you are inclined to run your own rendering system, then yes, Mapnik is a good choice. Powerful and scaleable (most successful OSM tile servers run Mapnik), but takes a bit of setting up. You normally load OSM XML data into PostGIS, and run mapnik from that (tutorials on switch2osm.org)
If you are not inclined to run your own rendering system (for more lightweight web development tasks this seams reasonable!) you don't have to! You can configure LeafletJS or OpenLayers or others to fetch map tiles from a tile server run by somebody else. There are many providers. See the providers list on switch2osm.org and the Tile Servers list.