[postgis-users] problem in Distance function

Markus Schaber schabi at logix-tt.com
Thu Aug 17 06:21:26 PDT 2006


Hi, Temiz,

temiz wrote:

> I tried this. But I got:
> ~~~~~~~~~~~~~~~~~~
> SELECT *
> FROM sgr_nuf_bina1
> WHERE
> wkb_geometry && Expand(GeomFromText('POINT(28.28547 38.66539)',-1),100)
> AND
> Distance(GeomFromText('POINT(28.28547 38.66539)',-1),wkb_geometry )< 100
> ~~~~~~~~~~~~~~
> ERROR:  Operation on two geometries with different SRIDs
> 
> what might  the problem be ?

It seems that your geometries ares stored with a srid different than -1.

you can use "select count(*),srid(wkb_geometry) from sgr_nuf_bina1 group
by srid(wkb_geometry)" to see counts of the actual srids of your
geometries (in OpenGIS compliant databases, all are the same for a
single table.)

Use that srid value in GeomFromText instead of the -1 argument, and it
should work.

HTH,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-users mailing list