81 size_t prefixlen = strlen(prefix);
85 size = (
sizeof(
"<Box>/") + (prefixlen*2) ) * 2;
86 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
90 ptr += sprintf(ptr,
"<%sBox", prefix);
92 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
94 ptr += sprintf(ptr,
"/>");
112 size += (
sizeof(
"<Box><coordinates>/") + (prefixlen*2) ) * 2;
113 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
117 if ( srs ) ptr += sprintf(ptr,
"<%sBox srsName=\"%s\">", prefix, srs);
118 else ptr += sprintf(ptr,
"<%sBox>", prefix);
120 ptr += sprintf(ptr,
"<%scoordinates>", prefix);
122 ptr += sprintf(ptr,
"</%scoordinates></%sBox>", prefix, prefix);
136 size_t prefixlen = strlen(prefix);
141 size = (
sizeof(
"<Envelope>/") + (prefixlen*2) ) * 2;
142 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
146 ptr += sprintf(ptr,
"<%sEnvelope", prefix);
147 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
149 ptr += sprintf(ptr,
"/>");
164 size += (
sizeof(
"<Envelope><lowerCorner><upperCorner>//") + (prefixlen*3) ) * 2;
165 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
166 if (
IS_DIMS(
opts) ) size +=
sizeof(
" srsDimension=. .");
170 ptr += sprintf(ptr,
"<%sEnvelope", prefix);
171 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
172 if (
IS_DIMS(
opts) ) ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
173 ptr += sprintf(ptr,
">");
175 ptr += sprintf(ptr,
"<%slowerCorner>", prefix);
177 ptr += sprintf(ptr,
"</%slowerCorner>", prefix);
185 ptr += sprintf(ptr,
"<%supperCorner>", prefix);
187 ptr += sprintf(ptr,
"</%supperCorner>", prefix);
189 ptr += sprintf(ptr,
"</%sEnvelope>", prefix);
274 size_t prefixlen = strlen(prefix);
277 size += (
sizeof(
"<point><coordinates>/") + (prefixlen*2) ) * 2;
278 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
287 ptr += sprintf(ptr,
"<%sPoint", prefix);
288 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
291 ptr += sprintf(ptr,
"/>");
294 ptr += sprintf(ptr,
">");
295 ptr += sprintf(ptr,
"<%scoordinates>", prefix);
297 ptr += sprintf(ptr,
"</%scoordinates></%sPoint>", prefix, prefix);
318 size_t prefixlen = strlen(prefix);
321 size += (
sizeof(
"<linestring><coordinates>/") + (prefixlen*2) ) * 2;
322 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
332 ptr += sprintf(ptr,
"<%sLineString", prefix);
333 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
337 ptr += sprintf(ptr,
"/>");
340 ptr += sprintf(ptr,
">");
342 ptr += sprintf(ptr,
"<%scoordinates>", prefix);
344 ptr += sprintf(ptr,
"</%scoordinates></%sLineString>", prefix, prefix);
366 size_t prefixlen = strlen(prefix);
368 size =
sizeof(
"<polygon></polygon>") + prefixlen*2;
369 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
372 size += (
sizeof(
"<outerboundaryis><linearring><coordinates>/") + ( prefixlen*3) ) * 2;
373 size += (
sizeof(
"<innerboundaryis><linearring><coordinates>/") + ( prefixlen*2) ) * 2 * poly->
nrings;
375 for (i=0; i<poly->
nrings; i++)
388 ptr += sprintf(ptr,
"<%sPolygon", prefix);
389 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
392 ptr += sprintf(ptr,
"/>");
395 ptr += sprintf(ptr,
">");
396 ptr += sprintf(ptr,
"<%souterBoundaryIs><%sLinearRing><%scoordinates>",
397 prefix, prefix, prefix);
399 ptr += sprintf(ptr,
"</%scoordinates></%sLinearRing></%souterBoundaryIs>", prefix, prefix, prefix);
400 for (i=1; i<poly->
nrings; i++)
402 ptr += sprintf(ptr,
"<%sinnerBoundaryIs><%sLinearRing><%scoordinates>", prefix, prefix, prefix);
404 ptr += sprintf(ptr,
"</%scoordinates></%sLinearRing></%sinnerBoundaryIs>", prefix, prefix, prefix);
406 ptr += sprintf(ptr,
"</%sPolygon>", prefix);
434 size_t prefixlen = strlen(prefix);
438 size =
sizeof(
"<MultiLineString></MultiLineString>");
441 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
443 for (i=0; i<col->
ngeoms; i++)
445 subgeom = col->
geoms[i];
448 size += (
sizeof(
"<pointMember>/") + prefixlen ) * 2;
453 size += (
sizeof(
"<lineStringMember>/") + prefixlen ) * 2;
458 size += (
sizeof(
"<polygonMember>/") + prefixlen ) * 2;
486 ptr += sprintf(ptr,
"<%s%s", prefix, gmltype);
487 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
491 ptr += sprintf(ptr,
"/>");
494 ptr += sprintf(ptr,
">");
496 for (i=0; i<col->
ngeoms; i++)
498 subgeom = col->
geoms[i];
501 ptr += sprintf(ptr,
"<%spointMember>", prefix);
503 ptr += sprintf(ptr,
"</%spointMember>", prefix);
507 ptr += sprintf(ptr,
"<%slineStringMember>", prefix);
509 ptr += sprintf(ptr,
"</%slineStringMember>", prefix);
513 ptr += sprintf(ptr,
"<%spolygonMember>", prefix);
515 ptr += sprintf(ptr,
"</%spolygonMember>", prefix);
520 ptr += sprintf(ptr,
"</%s%s>", prefix, gmltype);
551 size_t prefixlen = strlen(prefix);
554 size =
sizeof(
"<MultiGeometry></MultiGeometry>");
555 size += (prefixlen * 2);
557 if ( srs ) size += strlen(srs) +
sizeof(
" srsName=..");
559 for (i=0; i<col->
ngeoms; i++)
561 subgeom = col->
geoms[i];
563 size += (
sizeof(
"<geometryMember>/") + prefixlen ) * 2;
581 lwerror(
"asgml2_collection_size: Unable to process geometry type!");
601 ptr += sprintf(ptr,
"<%sMultiGeometry", prefix);
602 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
606 ptr += sprintf(ptr,
"/>");
609 ptr += sprintf(ptr,
">");
611 for (i=0; i<col->
ngeoms; i++)
613 subgeom = col->
geoms[i];
615 ptr += sprintf(ptr,
"<%sgeometryMember>", prefix);
635 ptr += sprintf(ptr,
"</%sgeometryMember>", prefix);
639 ptr += sprintf(ptr,
"</%sMultiGeometry>", prefix);
684 if ( i ) ptr += sprintf(ptr,
" ");
685 ptr += sprintf(ptr,
"%s,%s",
x,
y);
701 if ( i ) ptr += sprintf(ptr,
" ");
702 ptr += sprintf(ptr,
"%s,%s,%s",
x,
y, z);
778 size_t prefixlen = strlen(prefix);
781 size += (
sizeof(
"<point><pos>/") + (prefixlen*2) ) * 2;
782 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
783 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
784 if (
IS_DIMS(
opts)) size +=
sizeof(
" srsDimension='x'");
796 ptr += sprintf(ptr,
"<%sPoint", prefix);
797 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
798 if (
id ) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
801 ptr += sprintf(ptr,
"/>");
805 ptr += sprintf(ptr,
">");
806 if (
IS_DIMS(
opts)) ptr += sprintf(ptr,
"<%spos srsDimension=\"%d\">", prefix, dimension);
807 else ptr += sprintf(ptr,
"<%spos>", prefix);
809 ptr += sprintf(ptr,
"</%spos></%sPoint>", prefix, prefix);
831 size_t prefixlen = strlen(prefix);
837 sizeof(
"<LineString><posList>/") +
844 sizeof(
"<Curve><segments><LineStringSegment><posList>/") +
848 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
849 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
850 if (
IS_DIMS(
opts)) size +=
sizeof(
" srsDimension='x'");
865 ptr += sprintf(ptr,
"<%sLineString", prefix);
869 ptr += sprintf(ptr,
"<%sCurve", prefix);
872 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
873 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
877 ptr += sprintf(ptr,
"/>");
880 ptr += sprintf(ptr,
">");
884 ptr += sprintf(ptr,
"<%ssegments>", prefix);
885 ptr += sprintf(ptr,
"<%sLineStringSegment>", prefix);
890 ptr += sprintf(ptr,
"<%sposList srsDimension=\"%d\">",
895 ptr += sprintf(ptr,
"<%sposList>", prefix);
900 ptr += sprintf(ptr,
"</%sposList>", prefix);
904 ptr += sprintf(ptr,
"</%sLineString>", prefix);
908 ptr += sprintf(ptr,
"</%sLineStringSegment>", prefix);
909 ptr += sprintf(ptr,
"</%ssegments>", prefix);
910 ptr += sprintf(ptr,
"</%sCurve>", prefix);
933 size_t prefixlen = strlen(prefix);
934 size += 2 * (
sizeof(
"<Curve><segments>/" ) + 2 * prefixlen );
935 size += 2 * (
sizeof(
"<ArcString><posList>/" ) + 2 * prefixlen );
936 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
937 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
938 if (
IS_DIMS(
opts)) size +=
sizeof(
" srsDimension='x'");
953 ptr += sprintf(ptr,
"<%sCurve", prefix);
956 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
960 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
962 ptr += sprintf(ptr,
">");
963 ptr += sprintf(ptr,
"<%ssegments>", prefix);
964 ptr += sprintf(ptr,
"<%sArcString>", prefix);
965 ptr += sprintf(ptr,
"<%sposList", prefix);
969 ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
971 ptr += sprintf(ptr,
">");
974 ptr += sprintf(ptr,
"</%sposList>", prefix);
975 ptr += sprintf(ptr,
"</%sArcString>", prefix);
976 ptr += sprintf(ptr,
"</%ssegments>", prefix);
977 ptr += sprintf(ptr,
"</%sCurve>", prefix);
998 size_t prefixlen = strlen(prefix);
1001 size = (
sizeof(
"<PolygonPatch><exterior><LinearRing>///") + (prefixlen*3) ) * 2;
1002 size += (
sizeof(
"<interior><LinearRing>//") + (prefixlen*2) ) * 2 * (poly->
nrings - 1);
1003 size += (
sizeof(
"<posList></posList>") + (prefixlen*2) ) * poly->
nrings;
1004 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1005 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1008 for (i=0; i<poly->
nrings; i++)
1024 ptr += sprintf(ptr,
"<%sPolygonPatch", prefix);
1029 ptr += sprintf(ptr,
"<%sPolygon", prefix);
1032 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1033 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1037 ptr += sprintf(ptr,
"/>");
1038 return (ptr-output);
1040 ptr += sprintf(ptr,
">");
1042 ptr += sprintf(ptr,
"<%sexterior><%sLinearRing>", prefix, prefix);
1043 if (
IS_DIMS(
opts)) ptr += sprintf(ptr,
"<%sposList srsDimension=\"%d\">", prefix, dimension);
1044 else ptr += sprintf(ptr,
"<%sposList>", prefix);
1047 ptr += sprintf(ptr,
"</%sposList></%sLinearRing></%sexterior>",
1048 prefix, prefix, prefix);
1049 for (i=1; i<poly->
nrings; i++)
1051 ptr += sprintf(ptr,
"<%sinterior><%sLinearRing>", prefix, prefix);
1052 if (
IS_DIMS(
opts)) ptr += sprintf(ptr,
"<%sposList srsDimension=\"%d\">", prefix, dimension);
1053 else ptr += sprintf(ptr,
"<%sposList>", prefix);
1055 ptr += sprintf(ptr,
"</%sposList></%sLinearRing></%sinterior>",
1056 prefix, prefix, prefix);
1058 if (is_patch) ptr += sprintf(ptr,
"</%sPolygonPatch>", prefix);
1059 else ptr += sprintf(ptr,
"</%sPolygon>", prefix);
1061 return (ptr-output);
1082 size_t prefixlen = strlen(prefix);
1084 size = (
sizeof(
"<Curve></Curve>" ) + 2 * prefixlen );
1086 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1087 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1089 size += (
sizeof(
"<segments></segments>") + 2 * prefixlen );
1091 for(i= 0; i < col->
ngeoms; ++i )
1093 subgeom = col->
geoms[i];
1097 size +=
sizeof(
"<LineStringSegment></LineStringSegment" ) + 2 * prefixlen;
1098 size +=
sizeof(
"<posList></posList" ) + 2 * prefixlen;
1103 size +=
sizeof(
"<ArcString><posList></ArcString></posList>") + 4 * prefixlen;
1112 size +=
sizeof(
" srsDimension='x'");
1131 ptr += sprintf( ptr,
"<%sCurve", prefix );
1134 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1138 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id );
1140 ptr += sprintf( ptr,
">" );
1141 ptr += sprintf( ptr,
"<%ssegments>", prefix );
1143 for( i = 0; i < col->
ngeoms; ++i )
1145 subgeom = col->
geoms[i];
1153 ptr += sprintf( ptr,
"<%sLineStringSegment><%sposList", prefix, prefix );
1156 ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
1158 ptr += sprintf(ptr,
">");
1160 ptr += sprintf( ptr,
"</%sposList></%sLineStringSegment>", prefix, prefix );
1164 ptr += sprintf( ptr,
"<%sArcString><%sposList" , prefix, prefix );
1167 ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
1169 ptr += sprintf(ptr,
">");
1171 ptr += sprintf( ptr,
"</%sposList></%sArcString>", prefix, prefix );
1175 ptr += sprintf( ptr,
"</%ssegments>", prefix );
1176 ptr += sprintf( ptr,
"</%sCurve>", prefix );
1177 return ( ptr - output );
1194 size_t prefixlen = strlen(prefix);
1196 size_t size =
sizeof(
"<Polygon></Polygon" ) + 2 * prefixlen;
1197 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1198 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1201 for( i = 0; i < poly->
nrings; ++i )
1205 size +=
sizeof(
"<exterior></exterior>" ) + 2 * prefixlen;
1209 size +=
sizeof(
"<interior></interior>" ) + 2 * prefixlen;
1211 subgeom = poly->
rings[i];
1215 size +=
sizeof(
"<LinearRing></LinearRing>") + 2 * prefixlen;
1216 size +=
sizeof(
"<posList></posList") + 2 * prefixlen;
1219 size +=
sizeof(
" srsDimension='x'");
1225 size +=
sizeof(
"<Ring></Ring>") + 2 * prefixlen;
1226 size +=
sizeof(
"<CurveMember></CurveMember>") + 2 * prefixlen;
1231 size +=
sizeof(
"<Ring></Ring>") + 2 * prefixlen;
1232 size +=
sizeof(
"<curveMember></curveMember>") + 2 * prefixlen;
1251 ptr += sprintf( ptr,
"<%sPolygon", prefix );
1254 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1258 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id );
1260 ptr += sprintf(ptr,
">");
1262 for( i = 0; i < poly->
nrings; ++i )
1266 ptr += sprintf( ptr,
"<%sexterior>", prefix);
1270 ptr += sprintf( ptr,
"<%sinterior>", prefix);
1273 subgeom = poly->
rings[i];
1276 ptr += sprintf( ptr,
"<%sLinearRing>", prefix );
1277 ptr += sprintf( ptr,
"<%sposList", prefix );
1280 ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
1282 ptr += sprintf( ptr,
">" );
1284 ptr += sprintf( ptr,
"</%sposList>", prefix );
1285 ptr += sprintf( ptr,
"</%sLinearRing>", prefix );
1289 ptr += sprintf( ptr,
"<%sRing>", prefix );
1290 ptr += sprintf( ptr,
"<%scurveMember>", prefix );
1292 ptr += sprintf( ptr,
"</%scurveMember>", prefix );
1293 ptr += sprintf( ptr,
"</%sRing>", prefix );
1297 ptr += sprintf( ptr,
"<%sRing>", prefix );
1298 ptr += sprintf( ptr,
"<%scurveMember>", prefix );
1300 ptr += sprintf( ptr,
"</%scurveMember>", prefix );
1301 ptr += sprintf( ptr,
"</%sRing>", prefix );
1306 ptr += sprintf( ptr,
"</%sexterior>", prefix);
1310 ptr += sprintf( ptr,
"</%sinterior>", prefix);
1314 ptr += sprintf( ptr,
"</%sPolygon>", prefix );
1315 return (ptr - output);
1334 size_t prefixlen = strlen(prefix);
1336 size = (
sizeof(
"<Triangle><exterior><LinearRing>///") + (prefixlen*3) ) * 2;
1337 size +=
sizeof(
"<posList></posList>") + (prefixlen*2);
1338 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1339 if (
id) size += strlen(prefix) + strlen(
id) +
sizeof(
" id=..");
1340 if (
IS_DIMS(
opts)) size +=
sizeof(
" srsDimension='x'");
1354 ptr += sprintf(ptr,
"<%sTriangle", prefix);
1355 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1356 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1357 ptr += sprintf(ptr,
">");
1359 ptr += sprintf(ptr,
"<%sexterior><%sLinearRing>", prefix, prefix);
1360 if (
IS_DIMS(
opts)) ptr += sprintf(ptr,
"<%sposList srsDimension=\"%d\">", prefix, dimension);
1361 else ptr += sprintf(ptr,
"<%sposList>", prefix);
1364 ptr += sprintf(ptr,
"</%sposList></%sLinearRing></%sexterior>",
1365 prefix, prefix, prefix);
1367 ptr += sprintf(ptr,
"</%sTriangle>", prefix);
1369 return (ptr-output);
1395 size_t prefixlen = strlen(prefix);
1399 size =
sizeof(
"<MultiLineString></MultiLineString>") + prefixlen*2;
1401 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1402 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1404 for (i=0; i<col->
ngeoms; i++)
1406 subgeom = col->
geoms[i];
1409 size += (
sizeof(
"<pointMember>/") + prefixlen ) * 2;
1414 size += (
sizeof(
"<curveMember>/") + prefixlen ) * 2;
1419 size += (
sizeof(
"<surfaceMember>/") + prefixlen ) * 2;
1434 char *ptr, *gmltype;
1446 ptr += sprintf(ptr,
"<%s%s", prefix, gmltype);
1447 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1448 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1452 ptr += sprintf(ptr,
"/>");
1453 return (ptr-output);
1455 ptr += sprintf(ptr,
">");
1457 for (i=0; i<col->
ngeoms; i++)
1459 subgeom = col->
geoms[i];
1462 ptr += sprintf(ptr,
"<%spointMember>", prefix);
1464 ptr += sprintf(ptr,
"</%spointMember>", prefix);
1468 ptr += sprintf(ptr,
"<%scurveMember>", prefix);
1470 ptr += sprintf(ptr,
"</%scurveMember>", prefix);
1474 ptr += sprintf(ptr,
"<%ssurfaceMember>", prefix);
1476 ptr += sprintf(ptr,
"</%ssurfaceMember>", prefix);
1481 ptr += sprintf(ptr,
"</%s%s>", prefix, gmltype);
1483 return (ptr-output);
1507 size_t prefixlen = strlen(prefix);
1509 size = (
sizeof(
"<PolyhedralSurface><polygonPatches>/") + prefixlen*2) * 2;
1510 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1511 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1513 for (i=0; i<psur->
ngeoms; i++)
1534 ptr += sprintf(ptr,
"<%sPolyhedralSurface", prefix);
1535 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1536 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1537 ptr += sprintf(ptr,
"><%spolygonPatches>", prefix);
1539 for (i=0; i<psur->
ngeoms; i++)
1545 ptr += sprintf(ptr,
"</%spolygonPatches></%sPolyhedralSurface>",
1548 return (ptr-output);
1572 size_t prefixlen = strlen(prefix);
1574 size = (
sizeof(
"<Tin><trianglePatches>/") + prefixlen*2) * 2;
1575 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1576 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1578 for (i=0; i<tin->
ngeoms; i++)
1599 ptr += sprintf(ptr,
"<%sTin", prefix);
1600 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1601 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1602 else ptr += sprintf(ptr,
"><%strianglePatches>", prefix);
1604 for (i=0; i<tin->
ngeoms; i++)
1611 ptr += sprintf(ptr,
"</%strianglePatches></%sTin>", prefix, prefix);
1613 return (ptr-output);
1636 size_t prefixlen = strlen(prefix);
1639 size =
sizeof(
"<MultiGeometry></MultiGeometry>") + prefixlen*2;
1641 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1642 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1644 for (i=0; i<col->
ngeoms; i++)
1646 subgeom = col->
geoms[i];
1647 size += (
sizeof(
"<geometryMember>/") + prefixlen ) * 2;
1665 lwerror(
"asgml3_collection_size: unknown geometry type");
1681 ptr += sprintf(ptr,
"<%sMultiGeometry", prefix);
1682 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1683 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1687 ptr += sprintf(ptr,
"/>");
1688 return (ptr-output);
1690 ptr += sprintf(ptr,
">");
1692 for (i=0; i<col->
ngeoms; i++)
1694 subgeom = col->
geoms[i];
1695 ptr += sprintf(ptr,
"<%sgeometryMember>", prefix);
1716 lwerror(
"asgml3_collection_buf: unknown geometry type");
1718 ptr += sprintf(ptr,
"</%sgeometryMember>", prefix);
1722 ptr += sprintf(ptr,
"</%sMultiGeometry>", prefix);
1724 return (ptr-output);
1744 size_t prefixlen = strlen(prefix);
1745 size_t size =
sizeof(
"<MultiCurve></MultiCurve>" ) + 2 * prefixlen;
1746 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1747 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1751 for( i = 0; i <
cur->ngeoms; ++i )
1753 size +=
sizeof(
"<curveMember></curveMember>" ) + 2 * prefixlen;
1754 subgeom =
cur->geoms[i];
1777 ptr += sprintf(ptr,
"<%sMultiCurve", prefix );
1780 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1784 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id );
1786 ptr += sprintf( ptr,
">");
1788 for( i = 0; i <
cur->ngeoms; ++i )
1790 ptr += sprintf(ptr,
"<%scurveMember>", prefix );
1791 subgeom =
cur->geoms[i];
1804 ptr += sprintf(ptr,
"</%scurveMember>", prefix );
1806 ptr += sprintf(ptr,
"</%sMultiCurve>", prefix );
1807 return (ptr - output);
1821 size_t prefixlen = strlen(prefix);
1822 size_t size =
sizeof(
"<MultiSurface></MultiSurface>" ) + 2 * prefixlen;
1823 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1824 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1828 for( i = 0; i < sur->
ngeoms; ++i )
1830 subgeom = sur->
geoms[i];
1849 ptr += sprintf( ptr,
"<%sMultiSurface", prefix );
1852 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1856 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id );
1858 ptr += sprintf( ptr,
">" );
1860 for( i = 0; i < sur->
ngeoms; ++i )
1862 subgeom = sur->
geoms[i];
1872 ptr += sprintf( ptr,
"</%sMultiSurface>", prefix );
1873 return ptr - output;
1911 if ( i ) ptr += sprintf(ptr,
" ");
1913 ptr += sprintf(ptr,
"%s %s",
y,
x);
1915 ptr += sprintf(ptr,
"%s %s",
x,
y);
1932 if ( i ) ptr += sprintf(ptr,
" ");
1934 ptr += sprintf(ptr,
"%s %s %s",
y,
x, z);
1936 ptr += sprintf(ptr,
"%s %s %s",
x,
y, z);
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.
const POINT3DZ * getPoint3dz_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT3DZ pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
#define FLAGS_NDIMS(flags)
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
#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.
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
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,...
void * lwalloc(size_t size)
#define LW_TRUE
Return types for functions with status returns.
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
int lwline_is_empty(const LWLINE *line)
#define OUT_MAX_DIGS_DOUBLE
#define OUT_DOUBLE_BUFFER_SIZE
int lwpoint_is_empty(const LWPOINT *point)
int lwpoly_is_empty(const LWPOLY *poly)
int lwprint_double(double d, int maxdd, char *buf, size_t bufsize)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static char * asgml2_collection(const LWCOLLECTION *col, const char *srs, int precision, const char *prefix)
static size_t asgml3_multisurface_size(const LWMSURFACE *sur, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml2_multi_size(const LWCOLLECTION *col, const char *srs, int precision, const char *prefix)
static size_t asgml2_point_size(const LWPOINT *point, const char *srs, int precision, const char *prefix)
static char * asgml3_line(const LWLINE *line, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
static char * asgml2_line(const LWLINE *line, const char *srs, int precision, const char *prefix)
static char * asgml3_collection(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
static char * asgml3_tin(const LWTIN *tin, const char *srs, int precision, int opts, const char *prefix, const char *id)
static char * asgml3_multisurface(const LWMSURFACE *sur, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_curvepoly_buf(const LWCURVEPOLY *poly, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static char * gbox_to_gml2(const GBOX *bbox, const char *srs, int precision, const char *prefix)
static size_t asgml3_poly_size(const LWPOLY *poly, const char *srs, int precision, int opts, const char *prefix, const char *id)
static char * asgml3_multicurve(const LWMCURVE *cur, const char *srs, int precision, int opts, const char *prefix, const char *id)
static char * asgml3_curvepoly(const LWCURVEPOLY *poly, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_psurface_buf(const LWPSURFACE *psur, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static char * asgml3_circstring(const LWCIRCSTRING *circ, const char *srs, int precision, int opts, const char *prefix, const char *id)
static char * asgml2_point(const LWPOINT *point, const char *srs, int precision, const char *prefix)
static char * asgml3_triangle(const LWTRIANGLE *triangle, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_point_size(const LWPOINT *point, const char *srs, int precision, int opts, const char *prefix, const char *id)
static char * asgml3_compound(const LWCOMPOUND *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_line_size(const LWLINE *line, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml2_collection_size(const LWCOLLECTION *col, const char *srs, int precision, const char *prefix)
static size_t asgml3_circstring_size(const LWCIRCSTRING *circ, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_collection_size(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_multi_buf(const LWCOLLECTION *col, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
char * lwgeom_to_gml3(const LWGEOM *geom, const char *srs, int precision, int opts, const char *prefix, const char *id)
char * lwgeom_extent_to_gml3(const LWGEOM *geom, const char *srs, int precision, int opts, const char *prefix)
static size_t asgml3_circstring_buf(const LWCIRCSTRING *circ, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static size_t pointArray_GMLsize(POINTARRAY *pa, int precision)
static size_t asgml3_multicurve_buf(const LWMCURVE *cur, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static char * gbox_to_gml3(const GBOX *bbox, const char *srs, int precision, int opts, const char *prefix)
static char * asgml3_multi(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml2_poly_buf(const LWPOLY *poly, const char *srs, char *output, int precision, const char *prefix)
static size_t asgml3_multisurface_buf(const LWMSURFACE *sur, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_compound_buf(const LWCOMPOUND *col, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static char * asgml3_psurface(const LWPSURFACE *psur, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_triangle_size(const LWTRIANGLE *triangle, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_multicurve_size(const LWMCURVE *cur, const char *srs, int precision, int opts, const char *prefix, const char *id)
static char * asgml3_point(const LWPOINT *point, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_compound_size(const LWCOMPOUND *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_psurface_size(const LWPSURFACE *psur, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml2_multi_buf(const LWCOLLECTION *col, const char *srs, char *output, int precision, const char *prefix)
static size_t asgml2_line_size(const LWLINE *line, const char *srs, int precision, const char *prefix)
static size_t asgml3_collection_buf(const LWCOLLECTION *col, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_tin_buf(const LWTIN *tin, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static size_t asgml2_point_buf(const LWPOINT *point, const char *srs, char *output, int precision, const char *prefix)
char * lwgeom_extent_to_gml2(const LWGEOM *geom, const char *srs, int precision, const char *prefix)
static size_t asgml3_line_buf(const LWLINE *line, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static char * asgml2_multi(const LWCOLLECTION *col, const char *srs, int precision, const char *prefix)
static size_t asgml3_point_buf(const LWPOINT *point, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static size_t asgml3_poly_buf(const LWPOLY *poly, const char *srs, char *output, int precision, int opts, int is_patch, const char *prefix, const char *id)
static size_t asgml3_triangle_buf(const LWTRIANGLE *triangle, const char *srs, char *output, int precision, int opts, const char *prefix, const char *id)
static char * asgml2_poly(const LWPOLY *poly, const char *srs, int precision, const char *prefix)
static char * asgml3_poly(const LWPOLY *poly, const char *srs, int precision, int opts, int is_patch, const char *prefix, const char *id)
static size_t asgml3_multi_size(const LWCOLLECTION *col, const char *srs, int precision, int opts, const char *prefix, const char *id)
char * lwgeom_to_gml2(const LWGEOM *geom, const char *srs, int precision, const char *prefix)
VERSION GML 2 takes a GEOMETRY and returns a GML2 representation.
static size_t asgml2_line_buf(const LWLINE *line, const char *srs, char *output, int precision, const char *prefix)
static size_t asgml2_poly_size(const LWPOLY *poly, const char *srs, int precision, const char *prefix)
static size_t asgml3_curvepoly_size(const LWCURVEPOLY *poly, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t asgml2_collection_buf(const LWCOLLECTION *col, const char *srs, char *output, int precision, const char *prefix)
static size_t asgml3_tin_size(const LWTIN *tin, const char *srs, int precision, int opts, const char *prefix, const char *id)
static size_t pointArray_toGML2(POINTARRAY *pa, char *buf, int precision)