[postgis-devel] lwgeom_getsrid()

Sandro Santilli strk at keybit.net
Thu Aug 11 00:10:03 PDT 2011


On Thu, Aug 11, 2011 at 12:55:11AM +0000, Bryce L Nordgren wrote:
> /*
>  * get the SRID from the LWGEOM
>  * none present => -1
>  */
> extern int lwgeom_getsrid(uchar *serialized);
> 
> I'm getting a little turned around with all the different forms I can find
> geometries in. What is (uchar *) and how does it relate to PG_LWGEOM, LWGEOM
> and friends? Specifically, if I have a (LWGEOM *), how do I get a (uchar *)?
> This seems to be the only "accessor" method which doesn't take (LWGEOM *).

I think all the "serialized" and "inspected" functions should be
moved to liblwgeom_internal.h. You shouldn't be using those forms,
surely not to get a SRID out of an LWGEOM.
Current way to get it is trough LWGEOM.srid, altought we may add
an lwgeom_get_srid(const LWGEOM*) to go along the existing
lwgeom_set_srid(LWGEOM*, int).

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list