Example of GML returned from WFS :
<wfs:FeatureCollection
xmlns="http://www.ttt.org/myns" xmlns:myns="http://www.ttt.org/myns" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://ogc.dmsolutions.ca/wfs/1.0.0/WFS-basic.xsd
http://www.ttt.org/myns http://220.218.254.236/cgi-bin/mapserv?map=seattle_wfs.map&service=WFS&SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=parks">
<gml:boundedBy>
<gml:Box srsName="EPSG:4326"> <gml:coordinates>-122.528148,47.163192 -121.907845,47.776717</gml:coordinates> </gml:Box>
</gml:boundedBy>
<gml:featureMember>
<parks>
<gml:boundedBy>
<gml:Box srsName="EPSG:4326"> <gml:coordinates>-122.305614,47.773899 -122.304846,47.775657</gml:coordinates> </gml:Box>
</gml:boundedBy> <gml:polygonProperty>
<gml:Polygon srsName="EPSG:4326">
<gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates>-122.304880,47.775206 -122.304878,47.775120 -122.304873,47.774934 -122.304868,47.774745 -122.304864,47.774580 -122.304859,47.774413 -122.304855,47.774248 -122.304851,47.774085 -122.304846,47.773899 -122.305573,47.773903 -122.305592,47.774746 -122.305604,47.775208 -122.305614,47.775657 -122.305064,47.775653 -122.304942,47.775652 -122.304892,47.775652 -122.304887,47.775464 -122.304883,47.775298 -122.304880,47.775206 </gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonProperty> <AREA>113852.65625</AREA> <PERIMETER>1635.24743</PERIMETER> <PARK_>2</PARK_> <PARK_ID>1</PARK_ID> <NAME>Ballinger Park</NAME> <ID>4260401</ID> <OWNER>City</OWNER> <MANAGER>City</MANAGER> <CITY>Shore</CITY> <PROP_TYPE>Park</PROP_TYPE> <MAIN>1</MAIN> <PARK>1</PARK> <X_COORD>-122.30523</X_COORD> <Y_COORD>47.77478</Y_COORD>
</parks>
</gml:featureMember> <gml:featureMember>
<parks>
<gml:boundedBy>
<gml:Box srsName="EPSG:4326"> <gml:coordinates>-122.199667,47.774949 -122.198016,47.775927</gml:coordinates> </gml:Box>
</gml:boundedBy> <gml:polygonProperty>
<gml:Polygon srsName="EPSG:4326">
<gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates>-122.198422,47.775530 -122.198365,47.775530 -122.198134,47.775528 -122.198021,47.775528 -122.198018,47.775208 -122.198016,47.774949 -122.198419,47.774952 -122.198895,47.774955 -122.198946,47.774956 -122.198988,47.774956 -122.199101,47.774957 -122.199101,47.774974 -122.199589,47.774977 -122.199667,47.775034 -122.199662,47.775038 -122.199656,47.775041 -122.199651,47.775045 -122.199646,47.775049 -122.199642,47.775053 -122.199637,47.775058 -122.199633,47.775062 -122.199629,47.775067 -122.199626,47.775071 -122.199622,47.775076 -122.199619,47.775081 -122.199617,47.775086 -122.199614,47.775091 -122.199612,47.775096 -122.199610,47.775101 -122.199609,47.775106 -122.199608,47.775111 -122.199607,47.775116 -122.199607,47.775121 -122.199606,47.775127 -122.199607,47.775132 -122.199607,47.775134 -122.199501,47.775135 -122.199506,47.775536 -122.199314,47.775535 -122.199006,47.775652 -122.198931,47.775925 -122.198487,47.775927 -122.198422,47.775530 </gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonProperty> <AREA>98251.07525</AREA> <PERIMETER>1434.87547</PERIMETER> <PARK_>3</PARK_> <PARK_ID>2</PARK_ID> <NAME>Royal Oaks Park</NAME> <ID>5260502</ID> <OWNER>City</OWNER> <MANAGER>City</MANAGER> <CITY>Bothe</CITY> <PROP_TYPE>Park</PROP_TYPE> <MAIN>1</MAIN> <PARK>1</PARK> <X_COORD>-122.19884</X_COORD> <Y_COORD>47.77544</Y_COORD>
</parks>
</gml:featureMember>
... </wfs:FeatureCollection>
The above GML is then transformed by an XSLT such as the following:
<?xml version='1.0' encoding='UTF-8'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gml="http://www.opengis.net/gml"> <xsl:output indent="yes" method="xml"/> <xsl:strip-space elements="*" /> <xsl:template match="text()"/>
<xsl:template match="/"> <polys> <xsl:attribute name="stroke">20:220:20</xsl:attribute> <xsl:attribute name="linew">2</xsl:attribute> <xsl:attribute name="dispr">9000</xsl:attribute> <xsl:attribute name="vectorraise">0</xsl:attribute> <xsl:attribute name="maxalt">10000</xsl:attribute> <xsl:attribute name="minalt">0</xsl:attribute> <xsl:attribute name="interpolation">50</xsl:attribute> <xsl:attribute name="labelmaxalt">10000</xsl:attribute> <xsl:attribute name="labelminalt">300</xsl:attribute> <xsl:attribute name="labelenc">UTF-8</xsl:attribute> <xsl:attribute name="labelfontcolor">190:255:190:255</xsl:attribute> <xsl:attribute name="labelbgcolor">0:0:0:0</xsl:attribute> <xsl:attribute name="labelmindistance">65</xsl:attribute> <xsl:attribute name="labelicon">/JetStreamLib/common/icon/bdot</xsl:attribute> <xsl:attribute name="labelposition">RM</xsl:attribute> <xsl:attribute name="labelfontfile">/fonts/verdana36both.fnt</xsl:attribute> <xsl:attribute name="labelfontheight">1.9</xsl:attribute> <xsl:attribute name="labelfontwidth">1.4</xsl:attribute> <xsl:attribute name="kanji">false</xsl:attribute> <xsl:attribute name="enableSelect">false</xsl:attribute> <xsl:apply-templates select="*"/> </polys> </xsl:template>
<xsl:template match="//featureMember/parks"> <poly> <xsl:attribute name="id"><xsl:value-of select="ID/text()"/></xsl:attribute> <xsl:attribute name="label"><xsl:value-of select="NAME/text()"/></xsl:attribute> <xsl:attribute name="x"><xsl:value-of select="X_COORD/text()"/></xsl:attribute> <xsl:attribute name="y"><xsl:value-of select="Y_COORD/text()"/></xsl:attribute> <coords><xsl:value-of select="./polygonProperty/Polygon//coordinates/text()"/></coords> </poly> </xsl:template>
</xsl:stylesheet>
(Note: If the GML doesn't have a suitable label element, the XSLT should return a label attribute equal to "NO_LABEL_NAME" e.g
<xsl:attribute name="label"> <xsl:choose>
<xsl:when test="normalize-space(WTR_NAME)"><xsl:value-of select="WTR_NAME/text()"/></xsl:when> <xsl:otherwise>NO_LABEL_NAME</xsl:otherwise>
</xsl:choose> </xsl:attribute> )
which generates XML in the form that JetStream?? expects:
<?xml version="1.0" encoding="UTF-8"?> <polys xmlns:gml="http://www.opengis.net/gml" stroke="20:220:20" linew="2" dispr="9000" vectorraise="0" maxalt="10000" minalt="0" interpolation="50" labelmaxalt="10000" labelminalt="300" labelenc="UTF-8" labelfontcolor="190:255:190:255" labelbgcolor="0:0:0:0" labelmindistance="65" labelicon="/JetStreamLib/common/icon/bdot" labelposition="RM" labelfontfile="/fonts/verdana36both.fnt" labelfontheight="1.9" labelfontwidth="1.4" kanji="false" enableSelect="false"> <poly id="4252901" label="Volunteer Park" x="-122.31559" y="47.63043"> <coords>-122.312542,47.632333 -122.312590,47.628697 -122.312592,47.628543 -122.314042,47.628538 -122.315143,47.628535 -122.318036,47.628525 -122.318063,47.628529 -122.318088,47.628535 -122.318138,47.628551 -122.318161,47.628561 -122.318203,47.628584 -122.318222,47.628597 -122.318240,47.628611 -122.318257,47.628629 -122.318277,47.628646 -122.318299,47.628662 -122.318322,47.628677 -122.318369,47.628703 -122.318422,47.628725 -122.318479,47.628742 -122.318508,47.628748 -122.318538,47.628754 -122.318629,47.628762 -122.318630,47.628899 -122.318630,47.629036 -122.318630,47.629173 -122.318630,47.629310 -122.318630,47.629447 -122.318629,47.629584 -122.318629,47.629721 -122.318629,47.629858 -122.318628,47.629995 -122.318628,47.630132 -122.318628,47.630270 -122.318628,47.630407 -122.318627,47.630489 -122.318627,47.630571 -122.318627,47.630708 -122.318627,47.630846 -122.318627,47.630983 -122.318627,47.631120 -122.318626,47.631258 -122.318626,47.631395 -122.318626,47.631532 -122.318626,47.631670 -122.318625,47.631807 -122.318625,47.631944 -122.318625,47.632082 -122.318625,47.632219 -122.318625,47.632290 -122.318219,47.632293 -122.318097,47.632294 -122.318008,47.632294 -122.312542,47.632333 </coords> </poly> <poly id="3252502" label="Myrtle Edwards Park" x="-122.36032" y="47.61860"> <coords>-122.362774,47.620175 -122.362255,47.620173 -122.361637,47.620180 -122.358631,47.617848 -122.357868,47.617182 -122.358160,47.617010 -122.358337,47.617010 -122.358384,47.617026 -122.358448,47.617037 -122.358536,47.617046 -122.358628,47.617066 -122.358730,47.617091 -122.358823,47.617112 -122.358901,47.617141 -122.358957,47.617169 -122.359032,47.617210 -122.359085,47.617240 -122.359155,47.617276 -122.359212,47.617323 -122.359267,47.617364 -122.359339,47.617408 -122.359410,47.617446 -122.359491,47.617482 -122.359584,47.617525 -122.359669,47.617560 -122.359760,47.617601 -122.359855,47.617652 -122.359941,47.617706 -122.360029,47.617767 -122.360082,47.617820 -122.360128,47.617850 -122.360161,47.617871 -122.360249,47.617923 -122.360320,47.617970 -122.360385,47.618028 -122.360430,47.618086 -122.360468,47.618143 -122.360484,47.618194 -122.360476,47.618226 -122.360489,47.618275 -122.360475,47.618334 -122.360475,47.618402 -122.360497,47.618467 -122.360505,47.618515 -122.360495,47.618561 -122.360464,47.618599 -122.360434,47.618609 -122.360417,47.618625 -122.360460,47.618656 -122.360590,47.618685 -122.360672,47.618686 -122.360777,47.618690 -122.360889,47.618685 -122.360986,47.618684 -122.361068,47.618703 -122.361122,47.618729 -122.361215,47.618770 -122.361340,47.618819 -122.361453,47.618864 -122.361556,47.618918 -122.361631,47.618963 -122.361717,47.619019 -122.361797,47.619086 -122.361845,47.619137 -122.361947,47.619222 -122.362024,47.619294 -122.362111,47.619368 -122.362178,47.619437 -122.362252,47.619513 -122.362300,47.619576 -122.362339,47.619633 -122.362360,47.619693 -122.362382,47.619736 -122.362439,47.619790 -122.362499,47.619848 -122.362554,47.619912 -122.362637,47.619999 -122.362694,47.620057 -122.362748,47.620113 -122.362762,47.620162 -122.362774,47.620175 </coords> </poly> <poly id="4253001" label="Denny Park" x="-122.34109" y="47.61913"> <coords>-122.342259,47.619629 -122.342178,47.619628 -122.339913,47.619620 -122.339920,47.618631 -122.342186,47.618640 -122.342267,47.618640 -122.342259,47.619629 </coords> </poly> <poly id="4253201" label="Bobby Morris Playfield" x="-122.31913" y="47.61701"> <coords>-122.318348,47.618668 -122.318334,47.617794 -122.318332,47.617681 -122.318330,47.617500 -122.318316,47.616677 -122.318314,47.616513 -122.318310,47.616332 -122.318295,47.615371 -122.319334,47.615364 -122.319601,47.615362 -122.319916,47.615360 -122.319932,47.616320 -122.319935,47.616500 -122.319937,47.616665 -122.319950,47.617488 -122.319954,47.617668 -122.319955,47.617800 -122.319956,47.617832 -122.319959,47.617997 -122.319962,47.618162 -122.319964,47.618326 -122.319967,47.618491 -122.319970,47.618656 -122.319652,47.618658 -122.319383,47.618660 -122.318348,47.618668 </coords> </poly> <poly id="4253101" label="Waterfront Park" x="-122.34309" y="47.60738"> <coords>-122.344239,47.607519 -122.342433,47.607547 -122.342347,47.607494 -122.342301,47.607466 -122.342122,47.607354 -122.341978,47.607252 -122.341936,47.607223 -122.342129,47.607221 -122.342939,47.607209 -122.342984,47.607261 -122.343032,47.607263 -122.343124,47.607262 -122.343291,47.607260 -122.343453,47.607259 -122.343633,47.607263 -122.343750,47.607263 -122.343822,47.607263 -122.343838,47.607264 -122.343882,47.607288 -122.343986,47.607354 -122.344122,47.607433 -122.344206,47.607483 -122.344218,47.607493 -122.344239,47.607515 -122.344239,47.607519 </coords> </poly> <poly id="4240501" label="Dr. Rizal Park" x="-122.31857" y="47.59282"> <coords>-122.317419,47.593946 -122.317418,47.593906 -122.317418,47.593836 -122.317418,47.593741 -122.317417,47.593577 -122.317416,47.593412 -122.317415,47.593248 -122.317415,47.593081 -122.317415,47.592919 -122.317415,47.592754 -122.317414,47.592590 -122.317414,47.592425 -122.317415,47.592295 -122.317415,47.592261 -122.317415,47.592096 -122.317414,47.591987 -122.317414,47.591877 -122.317414,47.591767 -122.317414,47.591630 -122.317437,47.591630 -122.317820,47.591630 -122.317982,47.591630 -122.318387,47.591630 -122.318697,47.591630 -122.319244,47.591629 -122.319734,47.591629 -122.319676,47.592178 -122.319658,47.592378 -122.319660,47.592453 -122.319656,47.592545 -122.319644,47.592642 -122.319620,47.592752 -122.319584,47.592861 -122.319537,47.592971 -122.319488,47.593061 -122.319411,47.593179 -122.319359,47.593247 -122.319300,47.593316 -122.319248,47.593372 -122.319166,47.593450 -122.319064,47.593535 -122.318964,47.593609 -122.318911,47.593645 -122.318820,47.593701 -122.318773,47.593728 -122.318725,47.593754 -122.318685,47.593776 -122.318583,47.593825 -122.318481,47.593869 -122.318425,47.593891 -122.318297,47.593936 -122.318032,47.594010 -122.317975,47.593914 -122.317935,47.593847 -122.317628,47.593905 -122.317419,47.593946 </coords> </poly> </polys>
pTolemy3D parses the above XML and displays the vectors in the viewer.
