[Fwd: Re: [postgis-users] Double type and Buffer]

Daniel Faivre daniel.faivre at camptocamp.com
Thu Jan 22 05:18:03 PST 2004



Hello,


At first, check if your postgis version include the GEOS lib. Check if 
your buffer function is really present (for exemple, by looking at 
functions in pgaccess). If not, reinstall the correct postgis version, 
including geos lib. Do not forget to install postgis functions, by 
executing the postgis.sql request.

Did you tried without a cast statement ? it's the more efficient.
I've tried following request:
select BUFFER (GeometryFromText('LINESTRING(-0.0007 40.0216,-0.0006 
40.5009)', -1) , CAST (1000.01 as double precision))
and it works perfectly

-- 
Daniel Faivre
Ohceo - Camptocamp
04 79 75 28 19
180 rue du Genevois
73000 Chambéry le Haut




Natalia wrote:

>Hi everybody!
>
>    I need to use a BUFFER function (buffer (geometry,distance)) but i have 
>a problem with the distance(double type). In the documentation, it's said that 
>distance must be a double. I have done a explicit CAST to double 
>precision but postgis says :
>    "Function 'buffer(geometry, float8)' does not exist
>Unable to identify a function that satisfies the given argument types
>You may need to add explicit typecasts "
>
>My query is:
>    SELECT node_id
>    FROM mytable
>    WHERE within( the_geom ,BUFFER (
>       GeometryFromText('LINESTRING(-0.0007 40.0216,-0.0006 40.5009)', -1) ,
>       CAST (1000.01 as double precision)
>       )   ) = 1
>
>    I have also tried to put other numbers like 0.999999999, 0.99999, other 
>CAST, creating a line and gets its length (because this function return 
>a double) but the same error appears.
>I'm using 7.2.1 version, the binary compiled for Windows2000.
>Any idea?
>Thanks in advance!
>Natalia
>
>





More information about the postgis-users mailing list