259 for (i=1; i<poly->
nrings; i++)
276 const char* gmltype =
"";
298 for (i=0; i<col->
ngeoms; i++)
346 for (i=0; i<col->
ngeoms; i++)
348 subgeom = col->
geoms[i];
350 switch (subgeom->
type)
462 opts->is_patch ?
"<%sPolygonPatch" :
"<%sPolygon",
486 for (i=1; i<poly->
nrings; i++)
501 opts->is_patch ?
"</%sPolygonPatch>" :
"</%sPolygon>",
552 for (i = 0; i < col->
ngeoms; ++i)
554 subgeom = col->
geoms[i];
611 for (i = 0; i < poly->
nrings; ++i)
614 i ?
"<%sinterior>" :
"<%sexterior>",
617 subgeom = poly->
rings[i];
649 i ?
"</%sinterior>" :
"</%sexterior>",
691 const char* gmltype =
"";
709 for (i=0; i<col->
ngeoms; i++)
711 subgeom = col->
geoms[i];
757 for (i=0; i<tin->
ngeoms; i++)
786 for (i=0; i<psur->
ngeoms; i++)
819 for (i=0; i<col->
ngeoms; i++)
821 subgeom = col->
geoms[i];
824 switch (subgeom->
type)
844 lwerror(
"asgml3_collection: unknown geometry type");
870 for (i = 0; i <
cur->ngeoms; ++i)
873 subgeom =
cur->geoms[i];
904 for (i = 0; i < sur->
ngeoms; ++i)
906 subgeom = sur->
geoms[i];
926 memset(&gmlopts, 0,
sizeof(gmlopts));
964 lwerror(
"Cannot convert %s to GML2. Try ST_AsGML(3, <geometry>) to generate GML3.",
lwtype_name(geom->
type));
984 memset(&gmlopts, 0,
sizeof(gmlopts));
1070 memset(&gmlopts, 0,
sizeof(gmlopts));
1088 memset(&gmlopts, 0,
sizeof(gmlopts));
int ptarray_remove_point(POINTARRAY *pa, uint32_t where)
Remove a point from an existing POINTARRAY.
#define LW_GML_SHORTLINE
For GML3, use <LineString> rather than <Curve> for lines.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_GET_Z(flags)
#define POLYHEDRALSURFACETYPE
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
void ptarray_free(POINTARRAY *pa)
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
#define LW_TRUE
Return types for functions with status returns.
This library is the generic geometry handling section of PostGIS.
int lwline_is_empty(const LWLINE *line)
int lwpoint_is_empty(const LWPOINT *point)
int lwpoly_is_empty(const LWPOLY *poly)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static const POINT3D * getPoint3d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT3D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
static void asgml3_compound(stringbuffer_t *sb, const LWCOMPOUND *col, const GML_Options *opts)
static void asgml3_curvepoly(stringbuffer_t *sb, const LWCURVEPOLY *poly, const GML_Options *opts)
static void asgml2_ptarray(stringbuffer_t *sb, const POINTARRAY *pa, const GML_Options *opts)
static void asgml3_multi(stringbuffer_t *sb, const LWCOLLECTION *col, const GML_Options *opts)
static void asgml3_gbox(stringbuffer_t *sb, const GBOX *bbox, const GML_Options *opts)
lwvarlena_t * lwgeom_to_gml2(const LWGEOM *geom, const char *srs, int precision, const char *prefix)
static void asgml2_point(stringbuffer_t *sb, const LWPOINT *point, const GML_Options *opts)
lwvarlena_t * lwgeom_extent_to_gml3(const LWGEOM *geom, const char *srs, int precision, int opts, const char *prefix)
lwvarlena_t * lwgeom_extent_to_gml2(const LWGEOM *geom, const char *srs, int precision, const char *prefix)
static void asgml2_poly(stringbuffer_t *sb, const LWPOLY *poly, const GML_Options *opts)
static void asgml2_gbox(stringbuffer_t *sb, const GBOX *bbox, const GML_Options *opts)
static void asgml3_poly(stringbuffer_t *sb, const LWPOLY *poly, const GML_Options *opts)
static void asgml3_collection(stringbuffer_t *sb, const LWCOLLECTION *col, const GML_Options *opts)
static void asgml3_circstring(stringbuffer_t *sb, const LWCIRCSTRING *circ, const GML_Options *opts)
static void asgml2_collection(stringbuffer_t *sb, const LWCOLLECTION *col, const GML_Options *opts)
static void asgml3_multisurface(stringbuffer_t *sb, const LWMSURFACE *sur, const GML_Options *opts)
static void asgml3_psurface(stringbuffer_t *sb, const LWPSURFACE *psur, const GML_Options *opts)
static void asgml3_multicurve(stringbuffer_t *sb, const LWMCURVE *cur, const GML_Options *opts)
static void asgml3_triangle(stringbuffer_t *sb, const LWTRIANGLE *triangle, const GML_Options *opts)
static void asgml2_line(stringbuffer_t *sb, const LWLINE *line, const GML_Options *opts)
static void asgml3_line(stringbuffer_t *sb, const LWLINE *line, const GML_Options *opts)
static void asgml3_ptarray(stringbuffer_t *sb, const POINTARRAY *pa, const GML_Options *opts)
static void asgml3_point(stringbuffer_t *sb, const LWPOINT *point, const GML_Options *opts)
static void asgml2_multi(stringbuffer_t *sb, const LWCOLLECTION *col, const GML_Options *opts)
static void asgml3_tin(stringbuffer_t *sb, const LWTIN *tin, const GML_Options *opts)
lwvarlena_t * lwgeom_to_gml3(const LWGEOM *geom, const char *srs, int precision, int opts, const char *prefix, const char *id)
void stringbuffer_release(stringbuffer_t *s)
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
lwvarlena_t * stringbuffer_getvarlena(stringbuffer_t *s)
void stringbuffer_init_varlena(stringbuffer_t *s)
static void stringbuffer_append_double(stringbuffer_t *s, double d, int precision)
static void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
static void stringbuffer_append_char(stringbuffer_t *s, char c)