[postgis-users] RE: newbie PostGIS SQL question

kulbinder dio kulbinderdio at gmail.com
Sun Oct 8 13:20:12 PDT 2006


thanks Aleš,
tried but got the following  ERROR:  Operation on two geometries with
different SRIDs
I hadn't set an SRID, so I changed 4326 to -1 and I didn't get a syntax
error anymore but the query also didn't return any results.

Then this evening during a long drive back from the airport I had an idea
and I was right for once. I'd made a stupid mistake in the records I had
inserted into my table, I had got the lat and lng coordinated around the
wrong way for my POINT. I corrected that and your modified query worked. My
stupidity cost me over 4 hours, oh well, I'll put it down to experience.

thanks again
dio



On 10/8/06, "Ing. Aleš Daněk" <ales.danek at cad-programs.com> wrote:
>
> Hello kulbinder dio
>
> I think that problem in your SQL is missing SRID definition. Try this
> SQL which do you want:
>
> select * from admin_obce where the_geom &&
> geomfromewkt('SRID=4326;POLYGON((14.3175807572347
> 50.1188657131289,14.3177258253264 50.1188803817051,14.3178371331499
> 50.118892032579,14.3179856640012 50.118907010321,14.3175807572347
> 50.1188657131289))');
>
> Function GeomFromEWKT create geometry (in this case type polygon) with
> 4326 srid (WGS84). Than you can match extents of your geomatry and this
> one using && function.
>
> aldama
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20061008/f2216c5a/attachment.html>


More information about the postgis-users mailing list