osmcode / osmium-tool

Command line tool for working with OpenStreetMap data based on the Osmium library.
https://osmcode.org/osmium-tool/
GNU General Public License v3.0
483 stars 104 forks source link

Waterway relations export #268

Closed mkgrgis closed 1 year ago

mkgrgis commented 1 year ago

What version of osmium-tool are you using?

osmium version 1.13.1
libosmium version 2.16.0
Supported PBF compression types: none zlib lz4

What operating system version are you using?

Linux 5.10.0, Linux 5.14.0 and other near versions. Fedora, Debian, Ubuntu.

Tell us something about your system

4CPU, 2CPU, 3Gb, 5Gb

What did you do exactly?

export osmium export --config='osmium.conf' --show-errors -f pg Hydrographie.osm -o Hydrographie.pg

What did you expect to happen?

Some stable PostGIS output as multilinestring for both main_stream and side_stream in https://wiki.openstreetmap.org/wiki/DE:Relation:waterway z. b. https://www.openstreetmap.org/relation/123822 .

Also see about unstable tagging schemes such as type=site https://github.com/osmcode/osmium-tool/issues/223 and from man osmium export

Multipolygon and boundary rela‐ tions will be translated into multipolygons. This transformation is not loss-less, especially information in non-multipolygon, non-boundary relations is lost.

What did happen instead?

Output loss, no waterway relations. I am not able to build collect area queries for waterways connected to some big waterway from relation.

What did you do to try analyzing the problem?

  1. Carefully read manual page
  2. Experimental export for .osm with waterway relations and search by object id.
joto commented 1 year ago

I don't understand what you are saying here. You are quoting the section in the man page that says that only relations of type multipolygon/boundary are handled but not other relation types. But you still expect them to work?

mkgrgis commented 1 year ago

... quoting the section in the man page that says that only relations of type multipolygon/boundary are handled but not other relation types. But you still expect them to work?

Yes, I think waterway relation tagging type=waterway is stable and popular and this behaviour enhancement (don't loss this relations) can be introduced in a new release.

joto commented 1 year ago

Ah, okay, this is a feature request.

Adding more specialized processing for these kinds of relations is not something we can do in Osmium. You'll need much more configurability than what's available or possible in Osmium.

I suggest you have a look at osm2pgsql which can do all sorts of fancy things with OSM relations and can be used to create MultiLinestrings from those relations.

mkgrgis commented 1 year ago

Thanks, @joto ! I have understood 89 020 waterway examples is not the same as 760 174 boundaries or 5 959 178 mutipolygons and it's hard to add linear validator to existing boundary/multipolygon ring validator. osm2pgsql was slower than osmium in 2021, but not critical slow. I'll try now. Thanks for fast utility!