I have a geometry (JTS) geometry and i want to encode this geometry with GML3
I did this work Gml2 in this way :
GMLWriter writer = new GMLWriter();
writer.setNamespace(true);
writer.setSrsName(CRS.toSRS(pa.getFeature().getType().getCoordinateReferenceSystem()));
final String s = writer.write(pa.getGeometry());
and s like below
<gml:MultiPolygon srsName="EPSG:4326">
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>388398.01680386113,4234936.561284632 388496.2268063746,4234925.211013514 388486.8865137336,4234818.841002756 388473.5261352561,4234681.43099238 388471.2816094029,4234659.843136447 388370.4591269435,4234691.257276198 388370.45921945036,4234691.2574215075 388386.1865097745,4234829.971280575 388398.01680386113,4234936.561284632</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
<gml:innerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>388480.8967599605,4234910.071050081 388470.27675781824,4234910.611079167 388467.16673689516,4234903.311085147 388477.35673742165,4234902.231057049 388480.8967599605,4234910.071050081</gml:coordinates>
</gml:LinearRing>
</gml:innerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>388471.2816094029,4234659.843136447 388471.2820757456,4234659.842991144 388471.28158315114,4234659.842883958 388471.2816094029,4234659.843136447</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
</gml:MultiPolygon>
is there any way to do this in GML3?
i need gml:posList tag not gml:coordinates
If you are using GeoTools then you could follow the XML Geometry Tutorial. So something like: