Hi Toby, On 11 November 2012 19:11, Toby Murray <[email protected]> wrote:
> Well I looked at this tonight. It looks like postgis is perfectly > happy creating a linestring for a single node way. However it is not > considered valid. So doing a st_isvalid() on the resulting linestring > returns false. I am not sure what all the implications of this are > however it looks like it is something that needs to be handled > regardless. I have over 200 of them in my database right now. The few > I looked at are ways with several nodes in them that are all at the > same location. > That's good to know. This is all vaguely familiar, but it's been several years since this was all written so I'm hazy on the details. > I also noticed that not only are there ways with only one node in > them... there are also ways with zero nodes in them! These are also > being dropped right now. Completely removing the object count check > successfully imports the zero node ways as well. Interestingly, the > linestring is actually considered valid. However there is a function > st_isEmpty() which identifies it as an empty geometry. > > So unless we want to do stricter checking to ensure no invalid > linestrings make it in, I propose just removing the check for node > count and letting all ways into the database, invalid/empty > linestrings and all. > It sounds good to me. Osmosis typically tries to maintain data accuracy with no surprises, so I'm not particularly happy with the current situation of dropping ways even if they are invalid. Jochen Topf was the one who originally introduced the checks in WayGeometryBuilder to ensure a Way contained at least two nodes. He might have some thoughts on whether we can remove the checks. Perhaps it was simply introduced to avoid the additional overheads of having to do st_isvalid() checks? > > Is there any chance that these behaviors will be different on > different versions of postgres/postgis? I'm using 9.1/2.0.1 > I don't know, but I suspect it will be the same. Brett
_______________________________________________ osmosis-dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/osmosis-dev
