1809{
1811 double dist;
1812 LWGEOM *inlwgeom, *outlwgeom;
1814
1815 POSTGIS_DEBUG(2, "LWGEOM_segmentize2d called");
1816
1817 ingeom = PG_GETARG_GSERIALIZED_P(0);
1818 dist = PG_GETARG_FLOAT8(1);
1820
1821
1824 {
1825 PG_RETURN_POINTER(ingeom);
1826 }
1827
1828 if (dist <= 0)
1829 {
1830
1831
1832 elog(ERROR, "ST_Segmentize: invalid max_distance %g (must be >= 0)", dist);
1833 PG_RETURN_NULL();
1834 }
1835
1836 LWGEOM_INIT();
1837
1840 {
1841
1843 PG_RETURN_POINTER(ingeom);
1844 }
1845
1847 if (!outlwgeom)
1848 {
1849
1850 PG_FREE_IF_COPY(ingeom, 0);
1851 PG_RETURN_NULL();
1852 }
1853
1854
1857
1859
1860
1862
1863 PG_FREE_IF_COPY(ingeom, 0);
1864
1865 PG_RETURN_POINTER(outgeom);
1866}
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
void lwgeom_free(LWGEOM *geom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define POLYHEDRALSURFACETYPE
LWGEOM * lwgeom_segmentize2d(const LWGEOM *line, double dist)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)