[postgis-users] am I misunderstanding distance() or a bug?

strk at refractions.net strk at refractions.net
Fri May 19 12:40:03 PDT 2006


On Fri, May 19, 2006 at 11:15:23AM -0600, Jessica M Salmon wrote:
> strk,
> 
> Thanks for getting back about this.
> 
> Say all the multipolygons in the textfile I sent yesterday are in a table
> called 'tester' and the geometry column is called 'surface'. The query
> goes:
> 
> burn=# select gid, distance(surface,
> geomfromewkt('SRID=102008;POLYGON((-1564405.53393287
> 917321.560021817,-1564415.14129266 917224.014860812,-1564443.59416661
> 917130.21830564,-1564489.79912671 917043.774905315,-1564551.98054226
> 916968.006631232,-1564627.74881634 916905.825215674,-1564714.19221667
> 916859.620255568,-1564807.98877184 916831.16738162,-1564905.53393284
> 916821.560021817,-1565003.07909385 916831.167381611,-1565096.87564902
> 916859.620255551,-1565183.31904935 916905.825215649,-1565259.08732344
> 916968.0066312,-1565321.268739 917043.774905277,-1565367.47369911
> 917130.218305598,-1565395.92657306 917224.014860768,-1565405.53393287
> 917321.560021772,-1565395.92657308 917419.105182779,-1565367.47369914
> 917512.901737953,-1565321.26873905 917599.345138283,-1565259.0873235
> 917675.113412371,-1565183.31904942 917737.294827936,-1565096.87564911
> 917783.499788049,-1565003.07909394 917811.952662006,-1564905.53393293
> 917821.560021817,-1564807.98877193 917811.952662033,-1564714.19221675
> 917783.499788101,-1564627.74881642 917737.294828011,-1564551.98054233
> 917675.113412466,-1564489.79912676 917599.345138395,-1564443.59416664
> 917512.901738078,-1564415.14129268 917419.105182911,-1564405.53393287
> 917321.560021907,-1564405.53393287 917321.560021817))')) from tester;
>   gid   |     distance
> --------+------------------
>  157005 |  3302.3130998938
>  156976 | 2796.66571778937
>  156960 | 3129.29569126052
>  156952 | 3129.29569126052
>  158672 | 3302.31313583379
>  158676 | 3302.31313583379
>  158698 | 3302.31313583379
>  158742 | 3302.31313583379
>  158755 | 64.5620095554829
>  158773 | 3302.31313583379
>  158776 | 3302.31313583379
>  158788 | 6375.76370576306
>  158800 | 6375.76370576306
>  158818 |                0
>  158819 |                0
> (15 rows)
> 
> According to both Udig (eyeballing distance) and Jump, item 158800 is about
> 18 meters away, not 6km.

Can you send WKT for item 158800 so we can test ?
Best is if you file a bug report, complete with postgis version,
possibly attaching an SQL file with the form:

	-- expecting '18' by eyeballing 
	select distance('...', '...')

--strk;



More information about the postgis-users mailing list