579{
584 text *ver;
585 int version = 110;
586
587 POSTGIS_DEBUG(2, "LWGEOM_force_sfs called");
588
589
590 if ((PG_NARGS() > 1) && (!PG_ARGISNULL(1)))
591 {
592 ver = PG_GETARG_TEXT_P(1);
593
594 if (!strncmp(VARDATA(ver), "1.2", 3))
595 {
596 version = 120;
597 }
598 }
599
602
603 result = geometry_serialize(ogeom);
604
605 PG_FREE_IF_COPY(geom, 0);
606
607 PG_RETURN_POINTER(
result);
608}
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
LWGEOM * lwgeom_force_sfs(LWGEOM *geom, int version)