use of ch.ehi.ili2db.converter.ConverterException in project ili2db by claeis.
the class GpkgColumnConverter method toIomMultiCoord.
@Override
public IomObject toIomMultiCoord(Object geomobj, String sqlAttrName, boolean is3D) throws SQLException, ConverterException {
byte[] bv = (byte[]) geomobj;
Gpkg2iox conv = new Gpkg2iox();
try {
return conv.read(bv);
} catch (ParseException e) {
throw new ConverterException(e);
}
}
use of ch.ehi.ili2db.converter.ConverterException in project ili2db by claeis.
the class GpkgColumnConverter method toIomSurface.
@Override
public IomObject toIomSurface(Object geomobj, String sqlAttrName, boolean is3D) throws SQLException, ConverterException {
byte[] bv = (byte[]) geomobj;
Gpkg2iox conv = new Gpkg2iox();
try {
return conv.read(bv);
} catch (ParseException e) {
throw new ConverterException(e);
}
}
use of ch.ehi.ili2db.converter.ConverterException in project ili2db by claeis.
the class GpkgColumnConverter method toIomMultiSurface.
@Override
public IomObject toIomMultiSurface(Object geomobj, String sqlAttrName, boolean is3D) throws SQLException, ConverterException {
byte[] bv = (byte[]) geomobj;
Gpkg2iox conv = new Gpkg2iox();
try {
return conv.read(bv);
} catch (ParseException e) {
throw new ConverterException(e);
}
}
use of ch.ehi.ili2db.converter.ConverterException in project ili2db by claeis.
the class GpkgColumnConverter method toIomCoord.
@Override
public IomObject toIomCoord(Object geomobj, String sqlAttrName, boolean is3D) throws SQLException, ConverterException {
byte[] bv = (byte[]) geomobj;
Gpkg2iox conv = new Gpkg2iox();
try {
return conv.read(bv);
} catch (ParseException e) {
throw new ConverterException(e);
}
}
use of ch.ehi.ili2db.converter.ConverterException in project ili2db by claeis.
the class OracleColumnConverter method toIomCoord.
@Override
public IomObject toIomCoord(Object geomobj, String sqlAttrName, boolean is3D) throws java.sql.SQLException, ConverterException {
JGeometry geometry = JGeometry.load((oracle.sql.STRUCT) geomobj);
if (geometry.getType() != JGeometry.GTYPE_POINT) {
throw new ConverterException("unexpected GTYPE (" + OracleUtility.gtype2str(geometry.getType()) + ")");
} else {
int dim = geometry.getDimensions();
boolean isCurrentValue3D = (dim == 3);
if (isCurrentValue3D != is3D) {
throw new ConverterException("unexpected dimension (" + Integer.toString(dim) + ")");
} else {
double[] valuev = geometry.getFirstPoint();
IomObject coord = new Iom_jObject("COORD", null);
coord.setattrvalue("C1", Double.toString(valuev[0]));
coord.setattrvalue("C2", Double.toString(valuev[1]));
if (dim == 3) {
coord.setattrvalue("C3", Double.toString(valuev[2]));
}
return coord;
}
}
}
Aggregations