Commit cf59f25e authored by duminil's avatar duminil
Browse files

Try to build BuildingXmlNode

parent eaacae87
package eu.simstadt.lowlevelgmlparser;
import com.ximpleware.AutoPilot;
import com.ximpleware.NavException;
import com.ximpleware.VTDNav;
public class BuildingXmlNode
{
private int buildingOffset;
private int buildingLength;
private VTDNav navigator;
private AutoPilot coordinatesFinder;
public BuildingXmlNode(VTDNav navigator, int buildingOffset, int buildingLength) {
this.navigator = navigator;
this.coordinatesFinder = new AutoPilot(navigator); //COULD BE STATIC?
this.buildingLength = buildingLength;
this.buildingOffset = buildingOffset;
}
public String toString() {
try {
return navigator.toRawString(buildingOffset, buildingLength);
} catch (NavException ex) {
return null;
}
}
}
......@@ -55,7 +55,8 @@ public String next() {
offsetAndLength = navigator.getElementFragment();
buildingOffset = (int) offsetAndLength;
buildingLength = (int) (offsetAndLength >> 32);
return navigator.toRawString(buildingOffset, buildingLength);
BuildingXmlNode b = new BuildingXmlNode(navigator, buildingOffset, buildingLength);
return b.toString();
} catch (NavException ex) {}
return null;
}
......
......@@ -18,6 +18,7 @@
import com.ximpleware.VTDNav;
import com.ximpleware.XPathEvalException;
import com.ximpleware.XPathParseException;
import eu.simstadt.lowlevelgmlparser.CityGmlIterator;
public class RegionExtractor
......@@ -30,6 +31,12 @@ static public StringBuffer selectRegionDirectlyFromCityGML(Path citygmlPath, Str
throws SAXParseException, XMLStreamException, ParseException, XPathParseException, NavException,
NumberFormatException, XPathEvalException, IOException {
CityGmlIterator citygml = new CityGmlIterator(citygmlPath);
for (String lowLevelBuildingXML : citygml) {
System.out.println(lowLevelBuildingXML.length());
}
Geometry poly = wktReader.read(wktPolygon);
final GeometryFactory gf = new GeometryFactory();
StringBuffer sb = new StringBuffer();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment