/** * Retrieve approx bounds of all Features. * <p> * This result is suitable for a quick map display, illustrating the data. * This value is often stored as metadata in databases such as oraclespatial. * </p> * @return null as a generic implementation is not provided. */ public Envelope getEnvelope(String typeName) { try { return bounds(new DefaultQuery(typeName)); } catch(IOException e) { LOGGER.log(Level.WARNING, "Could not compute feature type bounds", e); return null; } }
build.setNillable(isNullable); try { Class geomClass = determineGeometryClass(tableName, columnName); build.setBinding(geomClass); } catch (Exception e) { srid = determineSRID( tableName, columnName ); CoordinateReferenceSystem crs = null; try { crs = CRS.decode("EPSG:" + srid); } catch(Exception e) { crs = determineCRS( srid );
/** This is used by helper classes to hammer sql back to the database */ public boolean sql( Transaction t, String sql ) throws IOException, SQLException { Connection conn = getConnection( t ); Statement st = conn.createStatement(); LOGGER.info( sql ); return st.execute( sql ); }
/** * Default implementation based on getFeatureReader and getFeatureWriter. * * <p> * We should be able to optimize this to only get the RowSet once * </p> * * @see org.geotools.data.DataStore#getFeatureSource(java.lang.String) */ public SimpleFeatureSource getFeatureSource(String typeName) throws IOException { if (!typeHandler.getFIDMapper(typeName).isVolatile() || allowWriteOnVolatileFIDs) { if (getLockingManager() != null) { // Use default JDBCFeatureLocking that delegates all locking // the getLockingManager // return new OracleFeatureLocking(this, getSchema(typeName)); } else { // subclass should provide a FeatureLocking implementation // but for now we will simply forgo all locking return new OracleFeatureStore(this, getSchema(typeName)); } } else { return new OracleFeatureSource(this, getSchema(typeName)); } }
SimpleFeatureType schema = getSchema(query.getTypeName()); SQLBuilder sqlBuilder = getSqlBuilder(schema.getTypeName()); conn = getConnection(Transaction.AUTO_COMMIT); Envelope curEnv = getEnvelope(conn, schemaNew, attName, sqlBuilder, filter);
int maxIdle = minConn != null ? minConn.intValue() : 4; DataSource source = getDefaultDataSource(alias, user, passwd, maxActive, maxIdle, validate); return new OracleDataStore(source, namespace, schema, new HashMap());
protected CoordinateReferenceSystem determineCRS(int srid) throws IOException { try { return getOracleAuthorityFactory().createCRS(srid); } catch(FactoryException e) { return null; } }
/** * @see org.geotools.data.jdbc.JDBCDataStore#getSqlBuilder(java.lang.String) */ public SQLBuilder getSqlBuilder(String typeName) throws IOException { FeatureTypeInfo info = typeHandler.getFeatureTypeInfo(typeName); SQLEncoder encoder = new SQLEncoderOracle(info.getSRIDs()); encoder.setFIDMapper(getFIDMapper(typeName)); return new DefaultSQLBuilder(encoder, info.getSchema(), null); }
int maxIdle = minConn != null ? minConn.intValue() : 4; DataSource source = getDefaultDataSource(host, user, passwd, port.intValue(), instance, maxActive, maxIdle, validate); OracleDataStore dataStore = new OracleDataStore(source, namespace, schema, new HashMap());
/** * Retrieve Bounds of Query results. * * <p> * Currently returns null, consider getFeatures( query ).getBounds() * instead. * </p> * * <p> * Subclasses may override this method to perform the appropriate * optimization for this result. * </p> * * @param query Query we are requesting the bounds of * * @return null representing the lack of an optimization * * @throws IOException DOCUMENT ME! */ public ReferencedEnvelope getBounds(Query query) throws IOException { if(!getSchema().getTypeName().equals(query)) { query = new DefaultQuery(query); ((DefaultQuery) query).setTypeName(getSchema().getTypeName()); } return ((OracleDataStore) getDataStore()).bounds(query); }
sqlStatement += " and info.table_owner = '" + schema + "'"; conn = getConnection(Transaction.AUTO_COMMIT); LOGGER.finer("the sql statement for geometry type check is " + sqlStatement); statement = conn.createStatement();
/** * Retrieve Bounds of Query results. * * <p> * Currently returns null, consider getFeatures( query ).getBounds() * instead. * </p> * * <p> * Subclasses may override this method to perform the appropriate * optimization for this result. * </p> * * @param query Query we are requesting the bounds of * * @return null representing the lack of an optimization * * @throws IOException DOCUMENT ME! */ public ReferencedEnvelope getBounds(Query query) throws IOException { if(query.getTypeName() == null) { query = new DefaultQuery(query); ((DefaultQuery) query).setTypeName(getSchema().getTypeName()); } return ((OracleDataStore) getDataStore()).bounds(query); }
sqlStatement += " and OWNER = '" + schema + "'"; conn = getConnection(Transaction.AUTO_COMMIT); LOGGER.finer("the sql statement for srid is " + sqlStatement); Statement statement = conn.createStatement();
/** * Retrieve Bounds of Query results. * * <p> * Currently returns null, consider getFeatures( query ).getBounds() * instead. * </p> * * <p> * Subclasses may override this method to perform the appropriate * optimization for this result. * </p> * * @param query Query we are requesting the bounds of * * @return null representing the lack of an optimization * * @throws IOException DOCUMENT ME! */ public ReferencedEnvelope getBounds(Query query) throws IOException { if(query.getTypeName() == null) { query = new DefaultQuery(query); ((DefaultQuery) query).setTypeName(getSchema().getTypeName()); } return ((OracleDataStore) getDataStore()).bounds(query); }