Hello, have successfully created vector mbtiles with tilemaker. How can I now integrate navigation marks from OpenSeaMap. Got seamark planet.osm and converted to .pbf. How do config.json and process.lua write for this case?

asked 13 Jun, 23:17

wkmhv's gravatar image

wkmhv
1111
accept rate: 0%


Add some Lua code to look for the tags you're expecting. For example, you could add this within node_function:

local seamark = node:Find("seamark_type") if seamark=="buoy_lateral" then node:Layer("seamarks", true) node:Attribute("type", seamark) node:Attribute("name", node:Find("seamark:name") end

Use code like this in node_function and way_function to identify the tags you want, and write them to vector tiles.

Then make sure the layers you're writing to are in the json layer config, e.g.:

"seamarks": { "minzoom": 8, "maxzoom": 14 },

That's all you need - this will write the data to the vector tiles.

Of course, this doesn't magically make the data render on-screen - that bit's outside the scope of tilemaker and is up to you. Use a style editor like Maputnik to choose the icons, colours etc. for the new data you've added to your vector tiles.

permanent link

answered 15 Jun, 08:35

Richard's gravatar image

Richard ♦
30.1k44268403
accept rate: 19%

why it founds only the first seamark ("man_made") with name "clock"

<node id="430222786" lat="54.1491789" lon="-4.4759688" version="6" timestamp="2016-05-20T20:49:47Z" changeset="0"> <tag k="name" v="Jubilee Clock"/> <tag k="amenity" v="clock"/> <tag k="display" v="analogue"/> <tag k="historic" v="monument"/> <tag k="man_made" v="clock"/> </node>

function node_function(node)

    --local seamark = node:Find("seamark_type")
    local seamark = node:Find("man_made")

--if seamark=="buoy_lateral" then
    --node:Layer("seamarks", true)
    --node:Attribute("type", seamark)
    --node:Attribute("name", node:Find("seamark:name"))
--end

if seamark~="" then
print ('found seamark')
print (seamark)
 node:Layer("seamarks", true)
 node:Attribute("type", seamark)
 node:Attribute("name", node:Find("seamark:name"))
end

end

kmhv@ubuntu:~/tilemaker-master$ tilemaker --input isle-of-man-latest.osm.pbf --output server/isle-of-man1.mbtiles --config config.json --process process.lua mbtiles file exists, will overwrite (Ctrl-C to abort, rerun with --merge to keep) Bounding box -5.43455, -3.68872, 53.7324, 54.6706 Layer waterway (z11-14) Layer transportation (z8-14) Layer building (z14-14) Layer poi (z13-14) Layer seamarks (z11-14) Resizing osm store to size: 64M
Reading .pbf isle-of-man-latest.osm.pbf Total blocks: 33 Resizing osm store to size: 128M
Resizing osm store to size: 192M
found seamarkoup 0 ways 0 relations 0
clock Sorting nodesroup 0 ways 0 relations 0
Total blocks: 5 Resizing osm store to size: 256M
Resizing osm store to size: 320M
Sorting waysgroup 0 ways 8000 relations 0
Total blocks: 1 Resizing osm store to size: 384M
Stored 217719 nodes, 27726 ways, 82 relations
Shape points: 0, lines: 0, polygons: 0 Generated points: 1, lines: 9798, polygons: 12049 Zoom level 13, writing tile 492 of 492
Filled the tileset with good things at server/isle-of-man1.mbtiles

permanent link

answered 15 Jun, 22:20

wkmhv's gravatar image

wkmhv
1111
accept rate: 0%

You need to work out which keys & tags to parse (i.e., you can't just work from Richard's example). For instance most of the Isle of Man semarks seem to use "seamark:type" not seamark_type. See https://overpass-turbo.eu/s/18qj

(16 Jun, 13:37) SK53 ♦

This work's

node_keys = {"seamark:type"}

function node_function(node)

    local seamark = node:Find("seamark:type")

if seamark~="" then
    node:Layer("seamarks", true)
    node:Attribute("type", seamark)
    node:Attribute("name", node:Find("seamark:name"))
    node:Attribute("range",node:Find("seamark:light:range"))
end

end

(16 Jun, 18:02) wkmhv
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×11
×8
×1

question asked: 13 Jun, 23:17

question was seen: 263 times

last updated: 16 Jun, 18:02

powered by OSQA