[OSM-dev] OSM coastline on PostGIS + MapRenderer?

Lars Ahlzen lars at ahlzen.com
Tue Sep 7 18:07:47 BST 2010


On 9/7/2010 12:38 PM, Lennard wrote:
> On 7-9-2010 17:39, Mulone wrote:
>
>> I imported the OSM data for Ireland in my postGIS db.
>> I noticed that there is no coastline, which isn't great to render an
>> island.
>> Is there a way to get an XML file containing the coastline and import it
>> into postGIS?
>
> natural=coastline, as a tag, is hardwired to be dropped in osm2pgsql. If
> you want that tag to survive the import, you'll have to remove that bit
> from the code and recompile/reimport. Then you'll have a bunch of ways
> in your DB with natural=coastline, and you'll have to build a polygon
> out of them.

Sometimes that's what you want, though. For example, in TopOSM I draw a 
dark blue line along the coastline, like on many printed maps.

It is possible to import coastlines with a standard osm2pgsql. I rename 
the tag values, import, and rename them back. A bit of a hack, but it works.

See: 
http://svn.openstreetmap.org/applications/rendering/toposm/import_planet

- Lars

-- 
Lars Ahlzen
lars at ahlzen.com



More information about the dev mailing list