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);
700 if ( i ) ptr += sprintf(ptr,
" ");
701 ptr += sprintf(ptr,
"%s,%s,%s",
x,
y, z);
777 size_t prefixlen = strlen(prefix);
780 size += (
sizeof(
"<point><pos>/") + (prefixlen*2) ) * 2;
781 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
782 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
783 if (
IS_DIMS(
opts)) size +=
sizeof(
" srsDimension='x'");
795 ptr += sprintf(ptr,
"<%sPoint", prefix);
796 if ( srs ) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
797 if (
id ) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
800 ptr += sprintf(ptr,
"/>");
804 ptr += sprintf(ptr,
">");
805 if (
IS_DIMS(
opts)) ptr += sprintf(ptr,
"<%spos srsDimension=\"%d\">", prefix, dimension);
806 else ptr += sprintf(ptr,
"<%spos>", prefix);
808 ptr += sprintf(ptr,
"</%spos></%sPoint>", prefix, prefix);
830 size_t prefixlen = strlen(prefix);
836 sizeof(
"<LineString><posList>/") +
843 sizeof(
"<Curve><segments><LineStringSegment><posList>/") +
847 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
848 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
849 if (
IS_DIMS(
opts)) size +=
sizeof(
" srsDimension='x'");
864 ptr += sprintf(ptr,
"<%sLineString", prefix);
868 ptr += sprintf(ptr,
"<%sCurve", prefix);
871 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
872 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
876 ptr += sprintf(ptr,
"/>");
879 ptr += sprintf(ptr,
">");
883 ptr += sprintf(ptr,
"<%ssegments>", prefix);
884 ptr += sprintf(ptr,
"<%sLineStringSegment>", prefix);
889 ptr += sprintf(ptr,
"<%sposList srsDimension=\"%d\">",
894 ptr += sprintf(ptr,
"<%sposList>", prefix);
899 ptr += sprintf(ptr,
"</%sposList>", prefix);
903 ptr += sprintf(ptr,
"</%sLineString>", prefix);
907 ptr += sprintf(ptr,
"</%sLineStringSegment>", prefix);
908 ptr += sprintf(ptr,
"</%ssegments>", prefix);
909 ptr += sprintf(ptr,
"</%sCurve>", prefix);
932 size_t prefixlen = strlen(prefix);
933 size += 2 * (
sizeof(
"<Curve><segments>/" ) + 2 * prefixlen );
934 size += 2 * (
sizeof(
"<ArcString><posList>/" ) + 2 * prefixlen );
935 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
936 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
937 if (
IS_DIMS(
opts)) size +=
sizeof(
" srsDimension='x'");
952 ptr += sprintf(ptr,
"<%sCurve", prefix);
955 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
959 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
961 ptr += sprintf(ptr,
">");
962 ptr += sprintf(ptr,
"<%ssegments>", prefix);
963 ptr += sprintf(ptr,
"<%sArcString>", prefix);
964 ptr += sprintf(ptr,
"<%sposList", prefix);
968 ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
970 ptr += sprintf(ptr,
">");
973 ptr += sprintf(ptr,
"</%sposList>", prefix);
974 ptr += sprintf(ptr,
"</%sArcString>", prefix);
975 ptr += sprintf(ptr,
"</%ssegments>", prefix);
976 ptr += sprintf(ptr,
"</%sCurve>", prefix);
997 size_t prefixlen = strlen(prefix);
1000 size = (
sizeof(
"<PolygonPatch><exterior><LinearRing>///") + (prefixlen*3) ) * 2;
1001 size += (
sizeof(
"<interior><LinearRing>//") + (prefixlen*2) ) * 2 * (poly->
nrings - 1);
1002 size += (
sizeof(
"<posList></posList>") + (prefixlen*2) ) * poly->
nrings;
1003 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1004 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1007 for (i=0; i<poly->
nrings; i++)
1023 ptr += sprintf(ptr,
"<%sPolygonPatch", prefix);
1028 ptr += sprintf(ptr,
"<%sPolygon", prefix);
1031 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1032 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1036 ptr += sprintf(ptr,
"/>");
1037 return (ptr-output);
1039 ptr += sprintf(ptr,
">");
1041 ptr += sprintf(ptr,
"<%sexterior><%sLinearRing>", prefix, prefix);
1042 if (
IS_DIMS(
opts)) ptr += sprintf(ptr,
"<%sposList srsDimension=\"%d\">", prefix, dimension);
1043 else ptr += sprintf(ptr,
"<%sposList>", prefix);
1046 ptr += sprintf(ptr,
"</%sposList></%sLinearRing></%sexterior>",
1047 prefix, prefix, prefix);
1048 for (i=1; i<poly->
nrings; i++)
1050 ptr += sprintf(ptr,
"<%sinterior><%sLinearRing>", prefix, prefix);
1051 if (
IS_DIMS(
opts)) ptr += sprintf(ptr,
"<%sposList srsDimension=\"%d\">", prefix, dimension);
1052 else ptr += sprintf(ptr,
"<%sposList>", prefix);
1054 ptr += sprintf(ptr,
"</%sposList></%sLinearRing></%sinterior>",
1055 prefix, prefix, prefix);
1057 if (is_patch) ptr += sprintf(ptr,
"</%sPolygonPatch>", prefix);
1058 else ptr += sprintf(ptr,
"</%sPolygon>", prefix);
1060 return (ptr-output);
1081 size_t prefixlen = strlen(prefix);
1083 size = (
sizeof(
"<Curve></Curve>" ) + 2 * prefixlen );
1085 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1086 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1088 size += (
sizeof(
"<segments></segments>") + 2 * prefixlen );
1090 for(i= 0; i < col->
ngeoms; ++i )
1092 subgeom = col->
geoms[i];
1096 size +=
sizeof(
"<LineStringSegment></LineStringSegment" ) + 2 * prefixlen;
1097 size +=
sizeof(
"<posList></posList" ) + 2 * prefixlen;
1102 size +=
sizeof(
"<ArcString><posList></ArcString></posList>") + 4 * prefixlen;
1111 size +=
sizeof(
" srsDimension='x'");
1130 ptr += sprintf( ptr,
"<%sCurve", prefix );
1133 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1137 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id );
1139 ptr += sprintf( ptr,
">" );
1140 ptr += sprintf( ptr,
"<%ssegments>", prefix );
1142 for( i = 0; i < col->
ngeoms; ++i )
1144 subgeom = col->
geoms[i];
1152 ptr += sprintf( ptr,
"<%sLineStringSegment><%sposList", prefix, prefix );
1155 ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
1157 ptr += sprintf(ptr,
">");
1159 ptr += sprintf( ptr,
"</%sposList></%sLineStringSegment>", prefix, prefix );
1163 ptr += sprintf( ptr,
"<%sArcString><%sposList" , prefix, prefix );
1166 ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
1168 ptr += sprintf(ptr,
">");
1170 ptr += sprintf( ptr,
"</%sposList></%sArcString>", prefix, prefix );
1174 ptr += sprintf( ptr,
"</%ssegments>", prefix );
1175 ptr += sprintf( ptr,
"</%sCurve>", prefix );
1176 return ( ptr - output );
1193 size_t prefixlen = strlen(prefix);
1195 size_t size =
sizeof(
"<Polygon></Polygon" ) + 2 * prefixlen;
1196 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1197 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1200 for( i = 0; i < poly->
nrings; ++i )
1204 size +=
sizeof(
"<exterior></exterior>" ) + 2 * prefixlen;
1208 size +=
sizeof(
"<interior></interior>" ) + 2 * prefixlen;
1210 subgeom = poly->
rings[i];
1214 size +=
sizeof(
"<LinearRing></LinearRing>") + 2 * prefixlen;
1215 size +=
sizeof(
"<posList></posList") + 2 * prefixlen;
1218 size +=
sizeof(
" srsDimension='x'");
1224 size +=
sizeof(
"<Ring></Ring>") + 2 * prefixlen;
1225 size +=
sizeof(
"<CurveMember></CurveMember>") + 2 * prefixlen;
1230 size +=
sizeof(
"<Ring></Ring>") + 2 * prefixlen;
1231 size +=
sizeof(
"<curveMember></curveMember>") + 2 * prefixlen;
1250 ptr += sprintf( ptr,
"<%sPolygon", prefix );
1253 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1257 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id );
1259 ptr += sprintf(ptr,
">");
1261 for( i = 0; i < poly->
nrings; ++i )
1265 ptr += sprintf( ptr,
"<%sexterior>", prefix);
1269 ptr += sprintf( ptr,
"<%sinterior>", prefix);
1272 subgeom = poly->
rings[i];
1275 ptr += sprintf( ptr,
"<%sLinearRing>", prefix );
1276 ptr += sprintf( ptr,
"<%sposList", prefix );
1279 ptr += sprintf(ptr,
" srsDimension=\"%d\"", dimension);
1281 ptr += sprintf( ptr,
">" );
1283 ptr += sprintf( ptr,
"</%sposList>", prefix );
1284 ptr += sprintf( ptr,
"</%sLinearRing>", prefix );
1288 ptr += sprintf( ptr,
"<%sRing>", prefix );
1289 ptr += sprintf( ptr,
"<%scurveMember>", prefix );
1291 ptr += sprintf( ptr,
"</%scurveMember>", prefix );
1292 ptr += sprintf( ptr,
"</%sRing>", prefix );
1296 ptr += sprintf( ptr,
"<%sRing>", prefix );
1297 ptr += sprintf( ptr,
"<%scurveMember>", prefix );
1299 ptr += sprintf( ptr,
"</%scurveMember>", prefix );
1300 ptr += sprintf( ptr,
"</%sRing>", prefix );
1305 ptr += sprintf( ptr,
"</%sexterior>", prefix);
1309 ptr += sprintf( ptr,
"</%sinterior>", prefix);
1313 ptr += sprintf( ptr,
"</%sPolygon>", prefix );
1314 return (ptr - output);
1333 size_t prefixlen = strlen(prefix);
1335 size = (
sizeof(
"<Triangle><exterior><LinearRing>///") + (prefixlen*3) ) * 2;
1336 size +=
sizeof(
"<posList></posList>") + (prefixlen*2);
1337 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1338 if (
id) size += strlen(prefix) + strlen(
id) +
sizeof(
" id=..");
1339 if (
IS_DIMS(
opts)) size +=
sizeof(
" srsDimension='x'");
1353 ptr += sprintf(ptr,
"<%sTriangle", prefix);
1354 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1355 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1356 ptr += sprintf(ptr,
">");
1358 ptr += sprintf(ptr,
"<%sexterior><%sLinearRing>", prefix, prefix);
1359 if (
IS_DIMS(
opts)) ptr += sprintf(ptr,
"<%sposList srsDimension=\"%d\">", prefix, dimension);
1360 else ptr += sprintf(ptr,
"<%sposList>", prefix);
1363 ptr += sprintf(ptr,
"</%sposList></%sLinearRing></%sexterior>",
1364 prefix, prefix, prefix);
1366 ptr += sprintf(ptr,
"</%sTriangle>", prefix);
1368 return (ptr-output);
1394 size_t prefixlen = strlen(prefix);
1398 size =
sizeof(
"<MultiLineString></MultiLineString>") + prefixlen*2;
1400 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1401 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1403 for (i=0; i<col->
ngeoms; i++)
1405 subgeom = col->
geoms[i];
1408 size += (
sizeof(
"<pointMember>/") + prefixlen ) * 2;
1413 size += (
sizeof(
"<curveMember>/") + prefixlen ) * 2;
1418 size += (
sizeof(
"<surfaceMember>/") + prefixlen ) * 2;
1433 char *ptr, *gmltype;
1445 ptr += sprintf(ptr,
"<%s%s", prefix, gmltype);
1446 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1447 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1451 ptr += sprintf(ptr,
"/>");
1452 return (ptr-output);
1454 ptr += sprintf(ptr,
">");
1456 for (i=0; i<col->
ngeoms; i++)
1458 subgeom = col->
geoms[i];
1461 ptr += sprintf(ptr,
"<%spointMember>", prefix);
1463 ptr += sprintf(ptr,
"</%spointMember>", prefix);
1467 ptr += sprintf(ptr,
"<%scurveMember>", prefix);
1469 ptr += sprintf(ptr,
"</%scurveMember>", prefix);
1473 ptr += sprintf(ptr,
"<%ssurfaceMember>", prefix);
1475 ptr += sprintf(ptr,
"</%ssurfaceMember>", prefix);
1480 ptr += sprintf(ptr,
"</%s%s>", prefix, gmltype);
1482 return (ptr-output);
1506 size_t prefixlen = strlen(prefix);
1508 size = (
sizeof(
"<PolyhedralSurface><polygonPatches>/") + prefixlen*2) * 2;
1509 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1510 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1512 for (i=0; i<psur->
ngeoms; i++)
1533 ptr += sprintf(ptr,
"<%sPolyhedralSurface", prefix);
1534 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1535 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1536 ptr += sprintf(ptr,
"><%spolygonPatches>", prefix);
1538 for (i=0; i<psur->
ngeoms; i++)
1544 ptr += sprintf(ptr,
"</%spolygonPatches></%sPolyhedralSurface>",
1547 return (ptr-output);
1571 size_t prefixlen = strlen(prefix);
1573 size = (
sizeof(
"<Tin><trianglePatches>/") + prefixlen*2) * 2;
1574 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1575 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1577 for (i=0; i<tin->
ngeoms; i++)
1598 ptr += sprintf(ptr,
"<%sTin", prefix);
1599 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1600 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1601 else ptr += sprintf(ptr,
"><%strianglePatches>", prefix);
1603 for (i=0; i<tin->
ngeoms; i++)
1610 ptr += sprintf(ptr,
"</%strianglePatches></%sTin>", prefix, prefix);
1612 return (ptr-output);
1635 size_t prefixlen = strlen(prefix);
1638 size =
sizeof(
"<MultiGeometry></MultiGeometry>") + prefixlen*2;
1640 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1641 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1643 for (i=0; i<col->
ngeoms; i++)
1645 subgeom = col->
geoms[i];
1646 size += (
sizeof(
"<geometryMember>/") + prefixlen ) * 2;
1664 lwerror(
"asgml3_collection_size: unknown geometry type");
1680 ptr += sprintf(ptr,
"<%sMultiGeometry", prefix);
1681 if (srs) ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1682 if (
id) ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id);
1686 ptr += sprintf(ptr,
"/>");
1687 return (ptr-output);
1689 ptr += sprintf(ptr,
">");
1691 for (i=0; i<col->
ngeoms; i++)
1693 subgeom = col->
geoms[i];
1694 ptr += sprintf(ptr,
"<%sgeometryMember>", prefix);
1715 lwerror(
"asgml3_collection_buf: unknown geometry type");
1717 ptr += sprintf(ptr,
"</%sgeometryMember>", prefix);
1721 ptr += sprintf(ptr,
"</%sMultiGeometry>", prefix);
1723 return (ptr-output);
1743 size_t prefixlen = strlen(prefix);
1744 size_t size =
sizeof(
"<MultiCurve></MultiCurve>" ) + 2 * prefixlen;
1745 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1746 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1750 for( i = 0; i <
cur->ngeoms; ++i )
1752 size +=
sizeof(
"<curveMember></curveMember>" ) + 2 * prefixlen;
1753 subgeom =
cur->geoms[i];
1776 ptr += sprintf(ptr,
"<%sMultiCurve", prefix );
1779 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1783 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id );
1785 ptr += sprintf( ptr,
">");
1787 for( i = 0; i <
cur->ngeoms; ++i )
1789 ptr += sprintf(ptr,
"<%scurveMember>", prefix );
1790 subgeom =
cur->geoms[i];
1803 ptr += sprintf(ptr,
"</%scurveMember>", prefix );
1805 ptr += sprintf(ptr,
"</%sMultiCurve>", prefix );
1806 return (ptr - output);
1820 size_t prefixlen = strlen(prefix);
1821 size_t size =
sizeof(
"<MultiSurface></MultiSurface>" ) + 2 * prefixlen;
1822 if (srs) size += strlen(srs) +
sizeof(
" srsName=..");
1823 if (
id) size += strlen(
id) + strlen(prefix) +
sizeof(
" id=..");
1827 for( i = 0; i < sur->
ngeoms; ++i )
1829 subgeom = sur->
geoms[i];
1848 ptr += sprintf( ptr,
"<%sMultiSurface", prefix );
1851 ptr += sprintf(ptr,
" srsName=\"%s\"", srs);
1855 ptr += sprintf(ptr,
" %sid=\"%s\"", prefix,
id );
1857 ptr += sprintf( ptr,
">" );
1859 for( i = 0; i < sur->
ngeoms; ++i )
1861 subgeom = sur->
geoms[i];
1871 ptr += sprintf( ptr,
"</%sMultiSurface>", prefix );
1872 return ptr - output;
1910 if ( i ) ptr += sprintf(ptr,
" ");
1912 ptr += sprintf(ptr,
"%s %s",
y,
x);
1914 ptr += sprintf(ptr,
"%s %s",
x,
y);
1930 if ( i ) ptr += sprintf(ptr,
" ");
1932 ptr += sprintf(ptr,
"%s %s %s",
y,
x, z);
1934 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.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_GET_Z(flags)
#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.
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.
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 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 POINT2D 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 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)