/** * The default strategy assumes a blob value containing wkb * @param results * @param paramIndex * @return * @throws SQLException */ public Object retrieveGeographyValue(ResultSet results, int paramIndex) throws SQLException { GeographyType geog = null; Blob val = results.getBlob(paramIndex); if (val != null) { geog = new GeographyType(val); } return geog; }
@Override protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException { if (version < VERSION_GEOGRAPHY) { BlobType bt = new BlobType(); bt.readExternal(in); return bt; } GeographyType bt = new GeographyType(); bt.readExternal(in); return bt; } }
@Override protected Object readObject(ObjectInput in, List<Object> cache, byte version) throws IOException, ClassNotFoundException { if (version < VERSION_GEOGRAPHY) { BlobType bt = new BlobType(); bt.readExternal(in); return bt; } GeographyType bt = new GeographyType(); bt.readExternal(in); return bt; } }
public static GeographyType getGeographyType(Geometry geom) { byte[] bytes = getBytes(geom, true); GeographyType result = new GeographyType(bytes, geom.getSRID()); result.setGeoCache(geom); return result; }
public static GeographyType getGeographyType(Geometry geom) { byte[] bytes = getBytes(geom, true); GeographyType result = new GeographyType(bytes, geom.getSRID()); result.setGeoCache(geom); return result; }
@TeiidFunction(name=SourceSystemFunctions.ST_SETSRID, category=FunctionCategoryConstants.GEOGRAPHY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeographyType setSrid(GeographyType geog, int srid) { GeographyType gt = new GeographyType(); gt.setReference(geog.getReference()); gt.setSrid(srid); return gt; }
@TeiidFunction(name=SourceSystemFunctions.ST_SETSRID, category=FunctionCategoryConstants.GEOGRAPHY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeographyType setSrid(GeographyType geog, int srid) { GeographyType gt = new GeographyType(); gt.setReference(geog.getReference()); gt.setSrid(srid); return gt; }
@Test public void testGeographyToGeometry() throws Exception { assertTrue(DataTypeManager.transformValue(new GeographyType(new byte[0]), DataTypeManager.DefaultDataClasses.GEOMETRY) instanceof GeometryType); //$NON-NLS-1$ }