if (posListElement != null) {
geoRSSModule = new GMLModuleImpl();
geoRSSModule.setGeometry(new LineString(parsePosList(posListElement)));
}
} else if (polygonElement != null) {
Polygon poly = null;
// The external ring
Element exteriorElement = polygonElement.getChild("exterior", GeoRSSModule.GML_NS);
if (exteriorElement != null) {
Element linearRingElement = exteriorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
if (linearRingElement != null) {
Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
if (posListElement != null) {
if (poly == null)
poly = new Polygon();
poly.setExterior(new LinearRing(parsePosList(posListElement)));
}
}
}
// The internal rings (holes)
List interiorElementList = polygonElement.getChildren("interior", GeoRSSModule.GML_NS);
Iterator it = interiorElementList.iterator();
while (it.hasNext()) {
Element interiorElement = (Element)it.next();
if (interiorElement != null) {
Element linearRingElement = interiorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
if (linearRingElement != null) {
Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
if (posListElement != null) {
if (poly == null)
poly = new Polygon();
poly.getInterior().add(new LinearRing(parsePosList(posListElement)));
}
}
}
}