problem with buffer srid

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with buffer srid

Galois
Hi!
 
    I´m wondering what happens when you make a buffer from a geom with a srid. I´ve just buffered one geom but it has no srid (-1), is it normal? I´ve got a line table ( from which i buffered) and a point table ( which want to compare with the buffer), both the same srid. But the buffer maked from the line geom don´t have srid assigned and postgis doesn´t permit me to compare.
My answer is, how can i buffer something and obtein the resuls with the source-srid?
 
Thanks in advance,
 
 
Galois
Reply | Threaded
Open this post in threaded view
|

Re: problem with buffer srid

Markus Schaber
Hi, Galois,

"Galois" <[hidden email]> wrote:

>     I´m wondering what happens when you make a buffer from a geom with a srid. I´ve just buffered one geom but it has no srid (-1), is it normal? I´ve got a line table ( from which i buffered) and a point table ( which want to compare with the buffer), both the same srid. But the buffer maked from the line geom don´t have srid assigned and postgis doesn´t permit me to compare.

So you say, that buffering loses the srid? I'm tempted to regard this
as a bug.

> My answer is, how can i buffer something and obtein the resuls with the source-srid?

setsrid(buffer(yourgeom, 42), getsrid(yourgeom))


Regards,
Markus

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

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

Reply | Threaded
Open this post in threaded view
|

Re: problem with buffer srid

Paul Ramsey-2
Markus Schaber wrote:
> Hi, Galois,
>
> "Galois" <[hidden email]> wrote:
>
>>     I´m wondering what happens when you make a buffer from a geom with a srid. I´ve just buffered one geom but it has no srid (-1), is it normal? I´ve got a line table ( from which i buffered) and a point table ( which want to compare with the buffer), both the same srid. But the buffer maked from the line geom don´t have srid assigned and postgis doesn´t permit me to compare.
>
> So you say, that buffering loses the srid? I'm tempted to regard this
> as a bug.

I would too, but it doesn't occur on my version:

  select asewkt(buffer(setsrid(makepoint(0,0),4326),1));

What version are you using that exhibits this behavior?

>> My answer is, how can i buffer something and obtein the resuls with the source-srid?
>
> setsrid(buffer(yourgeom, 42), getsrid(yourgeom))
>
>
> Regards,
> Markus
>


--

   Paul Ramsey
   Refractions Research
   http://www.refractions.net
   [hidden email]
   Phone: 250-383-3022
   Cell: 250-885-0632