[osmosis-dev] Single node ways

Toby Murray toby.murray at gmail.com
Fri Nov 9 05:41:06 GMT 2012


On Thu, Nov 8, 2012 at 10:58 PM, Brett Henderson <brett at bretth.com> wrote:
> Hi Toby,
>
> On 5 November 2012 16:25, Toby Murray <toby.murray at gmail.com> wrote:
>>
>> It seems osmosis intentionally drops ways with only one node in them
>> when importing[1]. From another thread[2] on this mailing list, I
>> understand this is because postgis does not handle such things very
>> well. However, when consuming diffs, single node ways do make it into
>> the database. In some situations this seems to cause errors when
>> querying the data, but not every time.
>>
>> So first of all, there is an inconsistency between how the load
>> process and the diff process handles these ways. But is there any
>> other way to handle this besides dropping them completely? There are a
>> couple of uses of the pgnsapshot schema that assume that it is a
>> lossless way of storing OSM data and as far as I know, it is - except
>> for this one exception. While single node ways are definitely a bug,
>> they happen with unfortunate regularity, mostly due to bugs in editing
>> software. Would it be acceptable to add in a phantom node 3cm away
>> from the first oneor something, just while building the geometry? I
>> think that happens in SQL while applying diffs which would make it
>> more difficult since you don't actually want to insert nodes that
>> don't exist... Thoughts?
>>
>> [1]
>> https://github.com/ToeBee/osmosis/blob/master/pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/CopyFilesetBuilder.java#L186
>> [2]
>> http://gis.19327.n5.nabble.com/osmosis-dev-one-node-ways-td5338301.html
>
>
> Dropping the single node ways is messy.  A phantom node in the generated
> linestring might be a better workaround.  If nobody has any better ideas I'm
> open to it being changed.  Are you able to create a patch?
>
> Brett
>

I'll see what I can come up with this weekend. At first glance, it
looks like it shouldn't be too hard to slip something into
WayGeometryBuilder.

Toby



More information about the osmosis-dev mailing list