use of ch.interlis.iox_j.wkb.Iox2wkb in project ili2db by claeis.
the class Iox2gpkg method multiline2wkb.
public byte[] multiline2wkb(IomObject obj, boolean asCompoundCurve, double p, int srsId) throws Iox2wkbException {
if (obj == null) {
return null;
}
try {
os.reset();
int polylinec = obj.getattrvaluecount(Wkb2iox.ATTR_POLYLINE);
Envelope env = new Envelope();
for (int polylinei = 0; polylinei < polylinec; polylinei++) {
IomObject polyline = obj.getattrobj(Wkb2iox.ATTR_POLYLINE, polylinei);
CompoundCurve curve = Iox2jtsext.polyline2JTS(polyline, false, p);
env.expandToInclude(curve.getEnvelopeInternal());
}
writeGeoPackageBinaryHeader(srsId, env);
Iox2wkb helper = new Iox2wkb(outputDimension, os.order());
for (int polylinei = 0; polylinei < polylinec; polylinei++) {
IomObject polyline = obj.getattrobj(Wkb2iox.ATTR_POLYLINE, polylinei);
os.write(helper.polyline2wkb(polyline, false, asCompoundCurve, p));
}
} catch (IOException e) {
throw new RuntimeException("Unexpected IO exception: " + e.getMessage());
} catch (IoxException e) {
throw new RuntimeException("Unexpected exception: " + e.getMessage());
}
return os.toByteArray();
}
Aggregations