[Tilesathome] Making automated OSM to oceantiles.dat
Robert (Jamie) Munro
rjmunro at arjam.net
Mon Oct 13 11:58:59 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Maarten Deen wrote:
> I was thinking of making some script that can automatically write some output
> for oceantiles.dat to at least get data where mixed tiles are located.
> Unfortunatly, I'm not so well versed in perl (but reading all the nice examples
> in the svn does get me a long way) and I'm also not very sure as to how to
> tackle this.
>
> The thought is easy: every tile that contains a node which is part of a way that
> is tagged natural:coastline is a mixed tile. So get every way that is tagged
> natural:coastline, then get all nodes associated with that way, for every node
> get the location and then calculate the tile xy in z12 from that.
>
> Now, the more difficult part is to get these nodes. In order to get nodes, you
> first have to traverse the .osm file to get all ways with natural:coastline,
> then remeber the node refs and then traverse the file again to get the nodes.
> Or read everything in one stride, keeping the nodes in memory.
> This seems to be a very memoryintensive task, especially if you want to do the
> world.
>
> What would be a good approach for this? Build my own database and do a simple
> query to get the nodes I need from there? That sure would make it a lot easier.
> Or is there a database somewhere that I can query?
I think the close-areas.pl script should report back to the server when
it encounters a coastline. It can report the status of the tile being
processed (which will be mixed) and the 4 tiles surrounding it. It may
sometimes think the surrounding tiles are coloured when they are mixed,
but that doesn't matter, because if a tile is mixed, it doesn't have to
ask about the coastlines. I would store the information returned by
close-areas in a database. Then to answer the question of what color a
non-coastline tile should be, look left, right, up, and down along the
row until you hit coastline (a simple indexed search), and return the
nearest hit. Incomplete and faulty coastlines may well cause artifacts
to spread across the map. That will be a powerful incentive to fix them.
Robert (Jamie) Munro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkjzKfIACgkQz+aYVHdncI3fJACfXxu0S7l+fKSD3WelJrKhkrKG
misAoPefv7DGEjR6OVG/Mvo5S9ZVNuN3
=mejl
-----END PGP SIGNATURE-----
More information about the Tilesathome
mailing list