Shared borders of (multi) polygons represented as duplicated ways

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Shared borders of (multi) polygons represented as duplicated ways

Stefan Baebler
Hi!

While preparing a dataset for a community import (https://wiki.openstreetmap.org/wiki/Slovenia_Landcover_Import_-_RABA-KGZ ) we ran into 2 kinds of related problems that originate from Shapefile's different representation of polygons:

a) duplicated ways: when no tags are present on two overlaping ways, but ways are members of different relations JOSM reports this as an error. This is common mostly with nested multipolygon relations, where one relation's outer way is the other's inner member.

b) Ways on same position: this is similar to previous, but some tags differ, making the match not exact. JOSM reports this as warning. This is more common, because it doesn't require that many levels of nesting, A simple meadow in a multipolygon forest is enough.

The illustraded description is in the issue of ogr2osm (my first choice for preparing the dataset):
https://github.com/pnorman/ogr2osm/issues/28 (not fixed yet).

Vincent promptly fixed the JOSM's OpenData plugin for importing shapefiles and adjusted validation logic: https://josm.openstreetmap.de/ticket/10743 , so we might go this way (shp -> JOSM instead of ogr2osm -> JOSM or any other editor), but it will require adjusting the data preparation scripts, and more importantly, relying on the end users (community importers) for using the latest (development) builds of JOSM with latest OpenData plugin to fix the data during the import.

While editing existing OSM data I noticed that this is quite common problem in OSM database, even if not coming in via imports (manual edits).

My questions are:
Are duplicated ways considered erronous and to be avoided at all costs or are they tolerable?
Are any tools (osm inspector and similar) detecting these problems?
Are there any plans to fix such topological errors (if considered as such) in existing data by bots (automated edits)?
Is ogr2osm being used for other imports with similar problems? 
Is ogr2osm being actively maintained?

thanks,
Stefan


_______________________________________________
dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Shared borders of (multi) polygons represented as duplicated ways

Paul Norman
On 11/21/2014 8:58 AM, Stefan Baebler wrote:
> Is ogr2osm being actively maintained?
Yes - but I don't have time to add new features like #28. I'd welcome a
PR doing so, but have no ETA of when I would get to it.

_______________________________________________
dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Shared borders of (multi) polygons represented as duplicated ways

Stefan Baebler
Paul, thanks for fast response! I perfectly understand you, it's normal for opensource :)

Imports from shapefiles are nothing new and have been going on with various tools for many years. I wanted to discuss with commuity whether this situation is anomaly or something tolerable as at least two major OSM tools (JOSM and ogr2osm)  have this same problem (JOSM is only fixed in development version), and probably had it for years. Is it dev@ -only issue or should it be discussed more broadly on talk@ ?

From the bugfix perspective it should probably be one more step of merging (eg MergeWays()) after two prior merges (mergePoints() and mergeWayPoints()).

greets,
Stefan
.

On Fri, Nov 21, 2014 at 6:21 PM, Paul Norman <[hidden email]> wrote:
On 11/21/2014 8:58 AM, Stefan Baebler wrote:
Is ogr2osm being actively maintained?
Yes - but I don't have time to add new features like #28. I'd welcome a PR doing so, but have no ETA of when I would get to it.

_______________________________________________
dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/dev


_______________________________________________
dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Shared borders of (multi) polygons represented as duplicated ways

Paul Norman
On 11/21/2014 10:09 AM, Stefan Baebler wrote:
> From the bugfix perspective it should probably be one more step of
> merging (eg MergeWays()) after two prior merges (mergePoints()
> and mergeWayPoints()).
Yes - and this shouldn't be too computationally expensive, as there
aren't that many ways, at least compared to points.

The key is that any case where two ways are the same is that the objects
either are the same or one will be converted into a multipolygon (i.e.
has an inner)

_______________________________________________
dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Shared borders of (multi) polygons represented as duplicated ways

Jochen123
On Fri, Nov 21, 2014 at 11:57:47AM -0800, Paul Norman wrote:
> On 11/21/2014 10:09 AM, Stefan Baebler wrote:
> >From the bugfix perspective it should probably be one more step of merging
> >(eg MergeWays()) after two prior merges (mergePoints() and
> >mergeWayPoints()).
> Yes - and this shouldn't be too computationally expensive, as there aren't
> that many ways, at least compared to points.

I am not sure this is enough. We might have to split up linestrings, too. Say
you have something like this:

    A---B
    |   |
    D---C
    |   |
    E---F

with linestrings A-B-C-D-A and D-C-F-E-D. In this simple case two closed ways
with the same nodes as those linestrings is fine, ie both using the nodes D and
C. But in a more complex case with more nodes and maybe some other lines
involved, we probably want two multipolygons which share a way D-C (and have
separate ways D-A-B-C and D-E-F-C, respectively), don't we? But then we have
to split up those linestrings.

Jochen
--
Jochen Topf  [hidden email]  http://www.jochentopf.com/  +49-173-7019282

_______________________________________________
dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Shared borders of (multi) polygons represented as duplicated ways

Paul Norman
On 11/24/2014 9:29 AM, Jochen Topf wrote:
> But in a more complex case with more nodes and maybe some other lines
> involved, we probably want two multipolygons which share a way D-C (and have
> separate ways D-A-B-C and D-E-F-C, respectively), don't we? But then we have
> to split up those linestrings.

No - multipolygons which do not consist entirely of closed ways are not
generally desirable in the output. I wouldn't mind a switch to do that
kind of splitting, which would cover the simple case you outlined too,
but it wouldn't be the default.

_______________________________________________
dev mailing list
[hidden email]
https://lists.openstreetmap.org/listinfo/dev