1836{
1838 double dist;
1839 LWGEOM *inlwgeom, *outlwgeom;
1841
1842 POSTGIS_DEBUG(2, "LWGEOM_segmentize2d called");
1843
1844 ingeom = PG_GETARG_GSERIALIZED_P(0);
1845 dist = PG_GETARG_FLOAT8(1);
1847
1848
1851 {
1852 PG_RETURN_POINTER(ingeom);
1853 }
1854
1855 if (dist <= 0)
1856 {
1857
1858
1859 elog(ERROR, "ST_Segmentize: invalid max_distance %g (must be >= 0)", dist);
1860 PG_RETURN_NULL();
1861 }
1862
1863 LWGEOM_INIT();
1864
1867 {
1868
1870 PG_RETURN_POINTER(ingeom);
1871 }
1872
1874 if (!outlwgeom)
1875 {
1876
1877 PG_FREE_IF_COPY(ingeom, 0);
1878 PG_RETURN_NULL();
1879 }
1880
1881
1884
1885 outgeom = geometry_serialize(outlwgeom);
1886
1887
1889
1890 PG_FREE_IF_COPY(ingeom, 0);
1891
1892 PG_RETURN_POINTER(outgeom);
1893}
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)