Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3350 closed enhancement (fixed)

Add option to osm2pgsql to keep data tagged as natural=coastline

Reported by: springmeyer Owned by: jburgess777@…
Priority: major Milestone:
Component: utils Version:
Keywords: osm2pgsql Cc: dane@…


Data tagged natural=coastline data is discarded (filtered out) in osm2pgsql based on the assumption that this information will be pulled from the coastline error checker application after being further processed.

But, it is foreseeable that users may prefer the raw ways to be imported, particularly to be able to store linestrings of the coastlines.

The attached patch adds a -K,--keep-coastlines option that if passed will skip the default behavior of discarding coastline data.

Attachments (1)

osm2pgsql_keep_coastlines_option.diff (3.8 KB) - added by springmeyer 5 years ago.
Add option to osm2pgsql to avoid skipping coastlines

Download all attachments as: .zip

Change History (5)

comment:1 Changed 5 years ago by TomH

  • Owner changed from tom@… to jburgess777@…
  • Status changed from new to assigned

Changed 5 years ago by springmeyer

Add option to osm2pgsql to avoid skipping coastlines

comment:2 Changed 5 years ago by springmeyer

It should be noted to anyone interested in this patch that your mileage will vary using the coastlines this way. The coastline error checker does some sophisticated topological processing of the data to try to make it more usable, and raw coastlines imported directly into the database may not meet expectations.

comment:3 Changed 5 years ago by jburgess777@…

  • Resolution set to fixed
  • Status changed from assigned to closed

Thanks for the patch Dane. I applied it with a minor modification to split out the island handling in r24605. I don't know whether my change is strictly necessary but it prevents these lines from being skipped when you keep the coastlines.

I noticed that when you enable the option there are also many more polygons, presumably from small islands and lakes which are all tagged with natural=coastline. There are also a few extra points from nodes tagged with natural=coastline.

comment:4 Changed 5 years ago by springmeyer

  • Cc dane@… added

Hi Jon,

Thanks so much for the review, and applying it!

In my testing I noticed that closed islands did seem to remain (as polygons), but nevertheless seems wise to enforce that for predictability and code clarity.



Note: See TracTickets for help on using tickets.