OpenSeaMap Forum

For new registrations: Please create and activate an account. Afterwards send an email to forum.openseamap@gmail.com including a short message and your username to get write access to this forum. Thanks!
Für neue Registrierungen: Bitte erstelle einen neuen Account und schalte ihn frei. Anschließend sende eine kurze Mail mit deinem Nutzernamen an forum.openseamap@gmail.com um Schreibzugriff für dieses Forum zu bekommen. Danke!

You are not logged in.

#1 2016-02-16 11:29:09

lepipasd
Member
Registered: 2016-02-16
Posts: 36

OpenSeaMap PostGIS Tile Server

Hello everyone,

I want to create a tile server. The goal is to display the whole planet but I am only interested about maritime data: list of lights, total-tides, depth of sea, radio signals, harbors.

After some search I have found that all OpenSeaMap objects in planet.osm have a "seamark:type=*" tag. I also read in another post here that there also exists a pre-extracted OSM file with all the OpenSeaMap objects which can be downloaded from:

tiles.openseamap.org/seamark/world.osm

1st question: Does this file (world.osm) include all the necessary data mentioned above?

1. I created a postgresql db with postgis extension enabled.

create database gis_sea;
\connect gis_sea;
create extension postgis;
create extension hstore;

2. With osm2pgsql I imported the above mentioned data(world.osm) in the db. I used the default.style that comes with osm2pgsql.

osm2pgsql -c -d gis_sea -U postgres -W -H localhost -S default.style world.osm
five tables were created (planet_osm_line, planet_osm_point, planet_osm_polygon, planet_osm_roads, spatial_ref_sys)
Then with postgis shapefile and dbf loader 2.2 plugin of pgadmin III, I imported coastlines (lines.shp from http://openstreetmapdata.com/ ) in the db.

3. Finally I displayed the db created, in QGIS but I see only bullets on the map. No icons for the lights, beacons etc.

Is this the right way to import the OpenSeaMap data in the db?

What must I do in order to display the OpenSeaMap layer correctly?

Should I customize the default.style which I use in step 2 in order to inlude the seamark tag?

Is it a better approach to use a filter("seamark:type=*" tag) on the planet PBF file instead of the pre-extracted OSM file with all the OpenSeaMap objects?

Last edited by lepipasd (2016-02-17 09:01:18)

Offline

#2 2017-03-07 16:36:31

WLDLZI
Member
Registered: 2017-03-07
Posts: 1

Re: OpenSeaMap PostGIS Tile Server

Hello

I have build a tile server alongside the description https://switch2osm.org/serving-tiles/ma … ver-14-04/ , running on a Raspberry 3, to serve maps locally. To fill the postgis DB, I have used data from GEOFABRIK for all countries around the Baltic Sea.

This are my questions:
1.    Somewhere I found a information that OpenSeaMap Data are already part of the OpenStreetMap “planet.pbf” file, and therefore also part of smaller .pbf files (e.g. Europe). Is this Information true?

or
2.    do I have to load “tiles.openseamap.org/seamark/world.osm“ to my gis DB in ordert o render seamarks as well?

3.    Currently I use OSM Bright as a style sheet, but this style sheet does not show/render any seamark into the tiles.
Do you know of any style sheet, that is able to render OSM_Bright together with seamarks into one set of tiles?

any help or hint is well appreciated

thanks Richard

Offline

#3 2017-03-08 19:32:53

Axel
Administrator
Registered: 2015-11-13
Posts: 49

Re: OpenSeaMap PostGIS Tile Server

Hi,

lepipasd wrote:

I want to create a tile server. The goal is to display the whole planet but I am only interested about maritime data: list of lights, total-tides, depth of sea, radio signals, harbors.
After some search I have found that all OpenSeaMap objects in planet.osm have a "seamark:type=*" tag. I also read in another post here that there also exists a pre-extracted OSM file with all the OpenSeaMap objects which can be downloaded from:

http://tiles.openseamap.org/seamark/world.osm

1st question: Does this file (world.osm) include all the necessary data mentioned above?

This file contains all the seamark objects from the OpenStreetMap database, yes.
As far as I know it does not contain any depth data.

lepipasd wrote:

1. I created a postgresql db with postgis extension enabled.
2. With osm2pgsql I imported the above mentioned data(world.osm) in the db. I used the default.style that comes with osm2pgsql.
3. Finally I displayed the db created, in QGIS but I see only bullets on the map. No icons for the lights, beacons etc.

Is this the right way to import the OpenSeaMap data in the db?

What must I do in order to display the OpenSeaMap layer correctly?

Should I customize the default.style which I use in step 2 in order to inlude the seamark tag?

Is it a better approach to use a filter("seamark:type=*" tag) on the planet PBF file instead of the pre-extracted OSM file with all the OpenSeaMap objects?

You now have a database with some data extracted from the OpenStreetMap database.
Such a database does not contain any information about the rendering of any kind.

You need
a) a render ruleset for QGIS to display the seamark objects with the appropriate symbols
or b) a other render engine that has a proper stylesheet

As far as I know neither of them exists so far.

WLDLZI wrote:

This are my questions:
1.    Somewhere I found a information that OpenSeaMap Data are already part of the OpenStreetMap “planet.pbf” file, and therefore also part of smaller .pbf files (e.g. Europe). Is this Information true?

True.

WLDLZI wrote:

3.    Currently I use OSM Bright as a style sheet, but this style sheet does not show/render any seamark into the tiles.
Do you know of any style sheet, that is able to render OSM_Bright together with seamarks into one set of tiles?

Same problem as above: No.

You can find our renderer for the seamark tiles here: https://github.com/OpenSeaMap/renderer/
The core is implemented in C. Some Java programs are used as helpers.

The base mechanic:

- get the OSM data including the seamarks
The scripts query a local overpass instance to get the `world.osm` already mentioned above.
- cut this file into smaller chunks to get prepared to create tiles
The core part is done by `jsearch`.
- render the data as SVG
This is done by the `searenderer`
- convert the result into PNG
`jtile` is the tool

Regards,
Axel


Axel Utech, OpenSeaMap developer

Offline

Board footer

Powered by FluxBB