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-22 14:02:02

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

OpenSeaMap symbols

Hello everyone,
I am trying to build a tile server in a windows machine with the OpenSeaMap data. I set up my postgresql database and populated with the world.osm data (found in another post) and the water polygones. I also set up mapserver(ms4w) along with p.mapper framework. After customizing the .map file in order to connect to the postgis db I was able to view the various layers in the browser.
Below is the layer for the points:
    LAYER
      CONNECTIONTYPE postgis
      NAME "seamarks1"
      # Connect to a remote spatial database
      CONNECTION "user=postgres dbname=seamarks host=localhost password=metricos1979 port=5432"
      PROCESSING "CLOSE_CONNECTION=DEFER"
      # Get the lines from the 'geom' column of the 'roads' table
      DATA "way from planet_osm_point using srid=900913 using unique osm_id"
      STATUS ON
      TYPE POINT
      TOLERANCE 6
      TOLERANCEUNITS pixels
      CLASS
      Name 'seamarks1'
      COLOR 0 130 250
      OUTLINECOLOR 0 130 250
      SYMBOL 'square'
      SIZE 5
      END  # Class
    END

As you may see I display them as symbols 'square'. How may I render them as the true nautical icons. Lets assume that I want to render the points from this table to the anchor berth symbol(all of them as a starting point), How can I do this?
Should I download the icons as .svg or .png files?
Or the world.osm file includes the information needed to render them in the appropriate icons?

Thanks

Last edited by lepipasd (2016-02-22 14:04:25)

Offline

#2 2016-02-23 10:13:59

malcolmh
Member
From: Hull, UK
Registered: 2012-09-05
Posts: 181

Re: OpenSeaMap symbols

You can find symbols here: https://github.com/OpenNauticalChart/jo … icons/svg/. In order to select the symbol to be displayed, you will have to set up some rules to match a symbol with the tags on a particular seamark.

Last edited by malcolmh (2016-02-23 17:31:40)


Malcolm Herring, Developer

Offline

#3 2016-02-23 15:37:30

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

Re: OpenSeaMap symbols

First of all, thanks for the responce. Allow me to make some more questions on the subject.

1. I have found and download svg icons from https://github.com/OpenSeaMap/renderer (in the searender file). Are the same with the svg files in  https://github.com/OpenNauticalChart/jo … icons/svg/ ?

2. What about the orientation of the icons in the map?

3. I noticed that some nodes are missing from world.osm (which I have downloaded from tiles.openseamap.org/seamark/world.osm today).

To be more specific:

a.I imported the .osm file in QGIS (as a vector file). Then I focused on the area around Pireaus port in order to compare the nodes I see in QGIS with the ones from OpenSeaMap site. I do not have all the nodes regarding the marina tag (see here which icon I mean https://wiki.openstreetmap.org/wiki/File:Marina.png).

b. I used the osm2pgsql command line tool in order to import world.osm data in the postgis db. Below is my customized default.style:

     # This is the default osm2pgsql .style file that comes with osm2pgsql.
     #
     # A .style file has 4 columns that define how OSM objects end up in tables in
     # the database and what columns are created. It interacts with the command-line
    # hstore options.
    #
    # Columns
    # =======
    #
    # OsmType: This is either "node", "way" or "node,way" and indicates if this tag
    # applies to nodes, ways, or both.
    #
    # Tag: The tag
    #
    # DataType: The type of the column to be created. Normally "text"
    #
    # Flags: Flags that indicate what table the OSM object is moved into.
    #
    # There are 5 possible flags. These flags are used both to indicate if a column
    # should be created, and if ways with the tag are assumed to be areas. The area
    # assumptions can be overridden with an area=yes/no tag
    #
    # polygon - Create a column for this tag, and objects the tag with are areas
    #
    # linear - Create a column for this tag
    #
    # phstore - Don't create a column for this tag, but objects with the tag are areas
    #
    # delete - Drop this tag completely and don't create a column for it. This also
    # prevents the tag from being added to hstore columns
    #
    # nocache - Deprecated and does nothing
    #
    # If an object has a tag that indicates it is an area or has area=yes/1,
    # osm2pgsql will try to turn it into an area. If it succeeds, it places it in
    # the polygon table. If it fails (e.g. not a closed way) it places it in the
    # line table.
    #
    # Nodes are never placed into the polygon or line table and are always placed in
    # the point table.
    #
    # Hstore
    # ======
    #
    # The options --hstore, --hstore-match-only, and --hstore-all interact with
    # the .style file.
    #
    # With --hstore any tags without a column will be added to the hstore column.
    # This will also cause all objects to be kept.
    #
    # With --hstore-match-only the behavior for tags is the same, but objects are
    # only kept if they have a non-NULL value in one of the columns.
    #
    # With --hstore-all all tags are added to the hstore column unless they appear
    # in the style file with a delete flag, causing duplication between the normal
    # columns and the hstore column.
    #
    # Special database columns
    # ========================
    #
    # There are some special database columns that if present in the .style file
    # will be populated by osm2pgsql.
    #
    # These are
    #
    # z_order - datatype int4
    #
    # way_area - datatype real. The area of the way, in the units of the projection
    # (e.g. square mercator meters). Only applies to areas
    #
    # osm_user, osm_uid, osm_version, osm_timestamp - datatype text. Used with the
    # --extra-attributes option to include metadata in the database. If importing
    # with both --hstore and --extra-attributes the meta-data will end up in the
    # tags hstore column regardless of the style file.

    # OsmType  Tag          DataType     Flags

     node,way   area         text         # hard coded support for area=1/yes => polygon is in osm2pgsql
     node,way   natural      text         polygon  # natural=coastline tags are discarded by a hard coded rule in osm2pgsql
     node,way   seamark:type   text         linear
     node,way   seamark:information   text         linear
     node,way   seamark:name   text         linear
     node,way   seamark:mooring:category   text         linear
     node,way   seamark:harbour:category   text         linear
     node,way   seamark:sea_area:category   text         polygon
     node,way   seamark:obstruction:category   text         linear
     node,way   seamark:small_craft_facility:category   text         linear
     node,way   seamark:bridge:category   text         linear
     node,way   seamark:recommended_track:orientation   text         linear
     node,way   seamark:shoreline_construction:category   text         linear
     node,way   seamark:restricted_area:restriction   text         polygon
     node,way   seamark:restricted_area:category   text         polygon
     node,way   seamark:faiway:minimum_depth   text         linear
     node,way   seamark:weed:category   text         linear
     node,way   seamark:cable_overhead:category   text         linear
     node,way   seamark:navigation_line:category   text         linear
     node,way   seamark:source   text         linear
     node,way   seamark:cable_submarine:category   text         linear
     node,way   seamark:pipeline_submarine:product   text         linear
     node,way   seamark:calling-in_point:channel   text         linear
     node,way   seamark:light:group   text         linear
     node,way   seamark:light:range   text         linear
     node,way   seamark:light:colour   text         linear
     node,way   seamark:light:height   text         linear
     node,way   seamark:light:category   text         linear
     node,way   seamark:light:character   text         linear
     node,way   seamark:light:reference   text         linear
     node,way   seamark:light:sequence   text         linear
     node,way   seamark:radar_transponder:group   text         linear
     node,way   seamark:radar_transponder:category   text         linear
     node,way   seamark:light:period   text         linear
     node,way   seamark:light:1:category   text         linear
     node,way   seamark:light:1:group   text         linear
     node,way   seamark:light:1:range   text         linear
     node,way   seamark:light:1:colour   text         linear
     node,way   seamark:light:1:height   text         linear
     node,way   seamark:light:1:period   text         linear
     node,way   seamark:light:1:radius   text         linear
     node,way   seamark:light:1:sequence   text         linear
     node,way   seamark:light:1:character   text         linear
     node,way   seamark:light:1:sector_start   text         linear
     node,way   seamark:light:1:sector_end   text         linear
     node,way   seamark:light:2:group   text         linear
     node,way   seamark:light:2:range   text         linear
     node,way   seamark:light:2:colour   text         linear
     node,way   seamark:light:2:height   text         linear
     node,way   seamark:light:2:period   text         linear
     node,way   seamark:light:2:radius   text         linear
     node,way   seamark:light:2:sequence   text         linear
     node,way   seamark:light:2:character   text         linear
     node,way   seamark:light:2:sector_start   text         linear
     node,way   seamark:light:2:sector_end   text         linear
     node,way   seamark:topmark:shape   text         linear
     node,way   seamark:topmark:colour   text         linear
     node,way   seamark:fixme   text         linear
     node,way   seamark:beacon_lateral:colour   text         linear
     node,way   seamark:beacon_lateral:system   text         linear
     node,way   seamark:beacon_lateral:category   text         linear
     node,way   seamark:beacon_special_purpose:shape   text         linear
     node,way   seamark:rock:water_level   text         linear
     node,way   seamark:buoy_special_purpose:shape   text         linear
     node,way   seamark:buoy_special_purpose:colour   text         linear
     node,way   seamark:buoy_lateral:shape   text         linear
     node,way   seamark:buoy_lateral:colour   text         linear
     node,way   seamark:buoy_lateral:system   text         linear
     node,way   seamark:wreck:category   text         linear
     node,way   seamark:wreck:water_level   text         linear
     node,way   seamark:beacon_special_purpose:colour   text         linear
     node,way   seamark:beacon_special_purpose:category   text         linear
     node,way   seamark:calling-in_point:traffic_flow   text         linear
     node,way   name   text         linear
     node,way   z_order      int4         linear # This is calculated during import
     way        way_area     real                # This is calculated during import

and the command I use: osm2pgsql -c --hstore -d [dbName] -U postgres –W –H localhost -S [C:\path to default.style] [C:\path to world.osm]

After doing all that I import data to QGIS from the database and compare again the nodes with the nodes in OpenSeaMap site.Again I do not have all the nodes regarding marina tag. I am not sure if other nodes are missing too but from my search I believe that only nodes with marina tags are missing.
For example in Akra Nikolaos (a harbour in Paxos island) the node with marina tag is missing. Also in Aigina (island in the area of Pireaus port) these nodes are missing, I may only see the nodes regarding lights and other staff.

Am I doing something wrong during importing data in the db or when importing data in QGIS from the .osm file?

I would appreciate your advice and help.

best regards,
    Jim

Offline

#4 2016-02-23 17:26:15

malcolmh
Member
From: Hull, UK
Registered: 2012-09-05
Posts: 181

Re: OpenSeaMap symbols

Many marina tags are on areas, not nodes. The online map displays the marina icon at the centre of the area.

Many icons in searender, particularly buoys & beacons, are not suitable as stand-alone usage as they do not have any colour.

Last edited by malcolmh (2016-02-23 17:31:53)


Malcolm Herring, Developer

Offline

#5 2016-02-24 11:46:18

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

Re: OpenSeaMap symbols

I view the contents of the planet_osm_polygon table in my db and there exist marina tags as values of the seamark:harbour:category column. But I also have the marina tag in the osm_planet_line table also.

Is that correct or I made a mistake in the flags I used in the default.style file?

I noticed also that near Piraeus port there is an area with osm_id:196120592 and seamark:type:anchorage tag which is stored in the planet_osm_line table. Should I enforce it to be placed in the polygons table by adding a line in the default.style file like this:
node,way   seamark:type:anchorage   text  polygon ?
Should I check for every tag that I want to display whether it is an area or a line and then customize the default.style appropriately(match flags with tags)?

I also miss the routes (dotted lines) near Pireaus port.

So, the step of importing osm data to the postgis db is crucial in order to populate each table (planet_osm_point, planet_osm_line, planet_osm_polygon, planet_osm_roads) of the db with the appropriate data (nodes to planet_osm_point, ways to planet_osm_line, ways that are areas to planet_osm_polygon, relations to planet_osm_roads). I described the procedure that I followed in my previous post.
I used the osm2pgsql tool for this and the customized default.style file.

Is this the recommended way? Do you (openseamap) use the same tool?
How may I verify that the tables of my db are populated with the right data?(I have: planet_osm_point: 207228 rows , planet_osm_line: 20195 rows , planet_osm_polygon: 2328 rows , planet_osm_roads: 191 rows)

Finally I view OpenSeaMap through mozilla and chrome. In mozilla the marina tags are not displayed!(again I checked Pireaus port).

Thanks again for your consideration, I will keep the effort and make some tests with the default.style file.

Offline

#6 2016-02-24 12:33:27

malcolmh
Member
From: Hull, UK
Registered: 2012-09-05
Posts: 181

Re: OpenSeaMap symbols

I am not familiar with the tools that you are using. My renderer (searender) is a custom-written program to process the data in world.osm, which is an extract of planet.osm of all objects that have a "seamark:type=*" tag. The objects that are rendered with an icon may be on nodes, ways or areas. In the case of nodes, the icon is centred on that node, on open ways the icon is positioned on the mid-point of the way and for areas the icon is placed at the centroid of the area. The renderer does not process multipolygons - this is being addressed in a new renderer that I working on.


Malcolm Herring, Developer

Offline

#7 2016-02-24 14:30:19

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

Re: OpenSeaMap symbols

I downloaded the svg symbols from https://github.com/OpenNauticalChart/jo … icons/svg/ but their names are not explanatory in order to find the one I want. Let's say I want the light_minor symbol. Do I have to search them all one by one or there exists a faster way to find it. Is there a list in Wikipedia that explains its names? e.g. D17_small represents ..... and so on.

If I understand it right, you do not use a postgis db in which you store the world.osm data. Instead you process the world.osm with the searender directly. May I find this program in GitHub? 

Why the nodes (or areas) with the marina tag are not (all) displayed  in Mozilla but are displayed in Chrome? (check the area around Piraeus port). I checked this also in Plymouth port. All nodes, ways are the same in mozilla, chrome and qgis (view editor I use). But in Brighton I see the light_minor, the buoy_lateral which is exactly what I see in openseamap site via mozilla. But with chrome I may see the node(or area) with the marina tag.

Last when displaying world.osm in qgis I do not see the routes(dotted lines) that start from ports: In Plymouth port I do not have  the Plymouth-Santander line, the Plymouth -Roscoff line, also in Brighton I do not have the route Newhaven to Dieppe. Instead I have lines with  cable_submarine tag which I may not see in the OpenSeaMap site (you have chosen not to display these lines probably). Are the routes included in world.osm?

I see nodes and lines in the land which is weird. I have lines (on land area) with navigation_line tag and nodes with beacon_special_purpose tag. Is navigation_line the tag for the routes that I mentioned in the above paragraph? Does it mean that I have elements displayed in the wrong position?

I tried another approach: Instead of importing in postgis world.osm (with osm2pgsql) I downloaded from geofabrik.de the latest pbf regarding Greece and use the osm2pgsql tool with this data. I used the default.style mentioned in previous post (in order to extract the elements with the seamark:type=* tags ). Now I may see all the elements, (the routes from the ports, the elements with the marina tag) which I could not view before.

Now the problem is that for larger area (Europe all the whole planet) this process will take a lot of time. Is there a better and faster method for accomplishing that?

Last edited by lepipasd (2016-02-24 16:12:19)

Offline

#8 2016-02-25 08:13:01

malcolmh
Member
From: Hull, UK
Registered: 2012-09-05
Posts: 181

Re: OpenSeaMap symbols

The symbols are arranged using the indexing of IHO INT-1 (http://www.iho.int/iho_pubs/standard/S- … 5_2012.pdf). So for light_minor, INT-1 Section P is lights & P1 is major & minor lights. The cross-reference to OSM tags is on the Wiki: https://wiki.openstreetmap.org/wiki/Sea … _Reference.

world.osm only contains objects with a "seamark:type=*" tag. Natural & cultural features in OSM do not have these tags.


Malcolm Herring, Developer

Offline

#9 2016-02-25 13:28:54

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

Re: OpenSeaMap symbols

Dear malcolmh,
you have been very helpful and I want to tell that I appreciate that.

For the symbols I have one more question (for now): Is there an attribute(a tag?) which determine the orientation of the symbol when placed on the map?

For the world.osm: The ferry routes that I couldn't view do not have a seamark:type tag, they have instead a route tag with ferry as value, waterway tag with seaway value and service tag with conventional value. That's why I couldn't view the routes from the world.osm. I cannot figure out why I cannot sea the elements with the marina tag. When loading world.osm in QGIS I see the same elements that I see when view openseamap from mozilla (e.g. in mozilla some marina tags are missing).

For now I work with a small data set (Greece) I have all the elements, so, styling the elements according to their tag is now my goal and I would like to know whether exists an attribute in the elements which specifies in which angle (orientation) the symbol should be placed in the map.

IMPORTANT QUESTION: In the directory named P,  P1.major.svg and P1.minor.svg are the symbols for the star and P10.1_yellow.svg is the symbol for the yellow light. So I have to combine both of them in order to get the symbol for the minor_light. Should I do this via the style that I will apply to the elements that I want to be rendered as minor_lights? That means that I have to combine two svg files for one element. Is there a way to apply one svg to one element? I mean, does exist a symbol with the star and the light?



One last question: Which tool (method) do you use in order to create world.osm? Osmosis?

Last edited by lepipasd (2016-02-25 13:52:38)

Offline

#10 2016-02-26 07:46:40

malcolmh
Member
From: Hull, UK
Registered: 2012-09-05
Posts: 181

Re: OpenSeaMap symbols

Only notice marks have an orientation tag. All other icons are displayed unaltered.

world.osm is intended for generation of the seamark layer of a multi-layered map. You have the choice whatever base map you want for your application. The base map would have to use the full planet.osm data as its data source.

I don't understand what you mean by "in mozilla some marina tags are missing". OSM maps do not display tags. Please explain what you are doing to see tags in a browser.

Each seamark may be may made up from several icons. They have transparant backgrounds so that they can be overlaid.

I use a local instance of OverPass with the query: "(rel['seamark:type'];>;way['seamark:type'];>;node['seamark:type'];);out meta;"


Malcolm Herring, Developer

Offline

Board footer

Powered by FluxBB