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

Jessica M Salmon jmsalmon at fs.fed.us
Fri May 19 10:15:23 PDT 2006


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.

-Meghan




                                                                           
             strk at refractions.                                             
             net                                                           
             Sent by:                                                   To 
             postgis-users-bou         PostGIS Users Discussion            
             nces at postgis.refr         <postgis-users at postgis.refractions. 
             actions.net               net>                                
                                                                        cc 
                                                                           
             05/19/2006 10:09                                      Subject 
             AM                        Re: [postgis-users] am I            
                                       misunderstanding distance() or a    
                                       bug?                                
             Please respond to                                             
               PostGIS Users                                               
                Discussion                                                 
             <postgis-users at po                                             
             stgis.refractions                                             
                   .net>                                                   
                                                                           
                                                                           




On Thu, May 18, 2006 at 11:51:08AM -0600, Jessica M Salmon wrote:
> Hi.
>
> I have a series of multipolygons, and I'm looking at the distance to a
> polygon. I'm expecting the minimum distance present from any element of
the
> multipolygon to the polygon. The results I am getting seem to differ from
> this. I am including a text file of the multipolygons. Below is the
> polygon:

What's the exact query you uses ?

--strk;
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list