On Fri, Jan 04, 2013 at 01:49:44PM +0100, Paweł Paprota wrote: > Here's an interesting problem I'm trying to tackle now in OWL... > > You have two linestrings and the task is to determine if they are > "similar" or not. Similar means spatially "the same" as looked at by > human eye at zoom level 18 on a slippy map :-) > > Note that the two geometries are not equal in ST_Equals sense. They > don't have to intersect but can intersect or even be almost the same > save for one node slightly moved. > > OWL right now shows some changes that in fact are non-changes - e.g. > using simplify way feature of JOSM changes way nodes but preserves > (or only very slightly changes) way geometry. It is not a change > worth processing and showing to the user.
You can create a buffer (with ST_Buffer) around one geometry and then see whether the other geometry is inside this buffer or not. Unfortunately that is a rather expensive operation, so it might be too slow for your use. If the number of nodes in a way didn't change you could optimize by just comparing them coordinate by coordinate. > I tried ST_HausdorffDistance[1] from PostGIS but for now it does not > yield useful results or maybe I am misinterpreting them. > > Any ideas? > > http://www.postgis.org/docs/ST_HausdorffDistance.html The documentation says "This is the Hausdorff distance restricted to discrete points for one of the geometries." I am not sure what the consequences of that are, but it might be too restrictive for your use. Jochen -- Jochen Topf [email protected] http://www.remote.org/jochen/ +49-721-388298 _______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/dev

