[postgis-users] Re: problem with BOX3D query

Eduardo Luís Garcia Escovar eduardo.escovar at 3wt.com.br
Mon May 8 14:14:43 PDT 2006


 From the PostGIS manual:

GeomFromText(text,[<srid>])

    Makes a Geometry from WKT with the given SRID.

    OGC SPEC 3.2.6.2 - option SRID is from the conformance suite


Is 'BOX3D(-111.80 33.30,-111.75 33.35)'::box3d a valid WKT?

Regards,

Eduardo

Randy George escreveu:
> Hi Patricio,
> 	
> 	Thank you very much! Mystery solved! 
>
> I had copy/pasted Box3D from the PostGIS pdf manual and failed to notice
> that the apostrophe changes:
> pdf ’ = hex 92 instead of hex 27 '
> once I change to hex 27 apostrophe everything works as expected.
>
> >From pdf manual:
> SELECT
> AsText(GEOM) AS GEOM
> FROM ROADS_GEOM
> WHERE
> GEOM && GeomFromText(’BOX3D(191232 243117,191232 243119)’::box3d,-1);
>
> Note the apostrophe!
>
> SELECT the_geom FROM streets
> WHERE the_geom && SetSRID(’BOX3D(-111.80 33.30,-111.75 33.35)’::box3d,4269);
> will not work
>
> but
> SELECT the_geom FROM streets
> WHERE the_geom && SetSRID('BOX3D(-111.80 33.30,-111.75 33.35)'::box3d,4269);
> will work as expected.
>
> Interestingly - 
>
> SELECT the_geom FROM streets
> WHERE the_geom && GeomFromText('BOX3D(-111.80 33.30,-111.75
> 33.35)'::box3d,4269);
> Produces response:
> ERROR:  function geomfromtext(box3d, integer) does not exist
> HINT:  No function matches the given name and argument types. You may need
> to add explicit type casts.
>
> So manual may need to be updated?
>
> Thanks
> Randy
>   



More information about the postgis-users mailing list