} catch (SchemaException ex) { throw new DataSourceException( "Some requested attributes do not match the table schema: " + ex.getMessage(), ex);
} catch (Exception e) { String msg = "Error decoding srs: " + srid; throw new SchemaException(msg, e); throw new SchemaException("Could not type " + name + " as:" + type, e);
protected FeatureReader<SimpleFeatureType, SimpleFeature> applyReprojectionDecorator( FeatureReader<SimpleFeatureType, SimpleFeature> reader, Query query, GetFeatureRequest request) { FeatureReader<SimpleFeatureType, SimpleFeature> tmp = reader; if (query.getCoordinateSystem() != null && !query.getCoordinateSystem() .equals(reader.getFeatureType().getCoordinateReferenceSystem())) { if (request.getSrsName() != null) { try { reader = new ForceCoordinateSystemFeatureReader( reader, query.getCoordinateSystem()); } catch (SchemaException e) { LOGGER.warning(e.toString()); reader = tmp; } } else { try { reader = new ReprojectFeatureReader(reader, query.getCoordinateSystem()); } catch (Exception e) { LOGGER.warning(e.toString()); reader = tmp; } } } return reader; }
toGeometryCollection_ = true; } else { throw new SchemaException("Bad geometry type option: " + geomClass); throw new SchemaException("Unable to determine geometry type from mif file"); throw new SchemaException("Exception creating feature type from MIF header: " + schexp.toString());
public SimpleFeatureType getSchema(String typeName) throws IOException { // look for type name String typeSpec = property(typeName, "_"); try { return DataUtilities.createType(namespaceURI, typeName, typeSpec); } catch (SchemaException e) { e.printStackTrace(); throw new DataSourceException(typeName + " schema not available", e); } }
public SimpleFeatureType getSchema() throws IOException { if( fcbuffer==null ){ synchronized (this) { if( fcbuffer==null ){ try { fcbuffer = (FCBuffer)FCBuffer.getFeatureReader(uri,bufferSize,timeout); try{ if( fcbuffer.hasNext() ){ SimpleFeature f=fcbuffer.next(); try { schema=createFinalSchema(f); } catch (SchemaException e) { LOGGER.warning(e.getLocalizedMessage()); schema=fcbuffer.getFeatureType(); } } }finally{ fcbuffer.close(); } } catch (SAXException e) { throw new IOException(e.toString()); } } } } return schema; }
toGeometryCollection = true; } else { throw new SchemaException("Bad geometry type option: " + geomClass); throw new SchemaException( "Unable to determine geometry type from mif file"); throw new SchemaException( "Exception creating feature type from MIF header: " + schexp.toString());
public FeatureType getSchema(String typeName) throws IOException { //look for type name String typeSpec = property( typeName, "_"); try { return DataUtilities.createType( namespaceURI+"."+typeName,typeSpec ); } catch (SchemaException e) { e.printStackTrace(); throw new DataSourceException( typeName+" schema not available", e); } } // END SNIPPET: getSchema
} catch (SchemaException se) { throw new WmsException(se, "Can't obtain the schema for the required layer.", se .getLocalizedMessage()); } catch (IllegalAttributeException iae) { throw new WmsException(iae, "Can't obtain the schema for the required layer.", iae
public SimpleFeatureType getQueryType(Query query) throws IOException { final String typeName = query.getTypeName(); final String propertyNames[] = query.getPropertyNames(); final FeatureTypeInfo typeInfo = typeInfoCache.getFeatureTypeInfo(typeName); final SimpleFeatureType completeSchema = typeInfo.getFeatureType(); SimpleFeatureType featureType = completeSchema; if (!query.retrieveAllProperties() || query.getCoordinateSystem() != null) { try { featureType = DataUtilities.createSubType( featureType, propertyNames, query.getCoordinateSystem()); } catch (SchemaException e) { LOGGER.log(Level.FINEST, e.getMessage(), e); throw new DataSourceException("Could not create Feature Type for query", e); } } return featureType; }
/** attname:string -> position:int */ //private final java.util.Map attLookup; private final static URI toURI( String namespace ) throws SchemaException { try { return new URI( namespace ); } catch (URISyntaxException badNamespace ) { throw new SchemaException( badNamespace ); } } public DefaultFeatureType(String typeName, String namespace,
public FeatureType getSchema(String typeName) throws IOException { //look for a defined namespace String namespace = property( typeName, "namespace" ); if ( namespace == null ) { namespace = directory.getName(); } //look for type name String typeSpec = property( typeName, "_"); try { return DataUtilities.createType( namespace+"."+typeName,typeSpec ); } catch (SchemaException e) { e.printStackTrace(); throw new DataSourceException( typeName+" schema not available", e); } } // END SNIPPET: getSchema
protected FeatureReader<SimpleFeatureType, SimpleFeature> applyReprojectionDecorator(FeatureReader <SimpleFeatureType, SimpleFeature> reader, Query query, CoordinateReferenceSystem dataCRS) { FeatureReader<SimpleFeatureType, SimpleFeature> tmp = reader; if (query.getCoordinateSystem() != null && !query.getCoordinateSystem().equals(reader.getFeatureType().getCoordinateReferenceSystem())) { try { reader = new ForceCoordinateSystemFeatureReader(reader, query.getCoordinateSystem()); } catch (SchemaException e) { WFS_1_0_0_DataStore.LOGGER.warning(e.toString()); reader = tmp; } } else { if (reader.getFeatureType().getGeometryDescriptor() != null && dataCRS != null && reader.getFeatureType().getCoordinateReferenceSystem() == null) { // set up crs try { reader = new ForceCoordinateSystemFeatureReader(reader, dataCRS); } catch (SchemaException e) { WFS_1_0_0_DataStore.LOGGER.warning(e.toString()); reader = tmp; } } } return reader; }
} catch (SchemaException e) { throw new RuntimeException( "Schema missmatch, should never happen!: " + e.getMessage(), e);
private final static URI toURI( String namespace ) throws SchemaException { try { return new URI( namespace ); } catch (URISyntaxException badNamespace ) { throw new SchemaException( badNamespace ); } } public DefaultFeatureType(String typeName, String namespace,
ex.printStackTrace(); } catch (SchemaException ex) { ex.printStackTrace(); } catch (IllegalAttributeException ex) { ex.printStackTrace();
protected FeatureReader<SimpleFeatureType, SimpleFeature> applyReprojectionDecorator( FeatureReader<SimpleFeatureType, SimpleFeature> reader, Query query, GetFeatureRequest request) { FeatureReader<SimpleFeatureType, SimpleFeature> tmp = reader; if (query.getCoordinateSystem() != null && !query.getCoordinateSystem() .equals(reader.getFeatureType().getCoordinateReferenceSystem())) { if (request.getSrsName() != null) { try { reader = new ForceCoordinateSystemFeatureReader( reader, query.getCoordinateSystem()); } catch (SchemaException e) { LOGGER.warning(e.toString()); reader = tmp; } } else { try { reader = new ReprojectFeatureReader(reader, query.getCoordinateSystem()); } catch (Exception e) { LOGGER.warning(e.toString()); reader = tmp; } } } return reader; }
private Reader(MIFFileTokenizer mifTokenizer, MIFFileTokenizer midTokenizer) throws IOException { inputBuffer = new Object[numAttribs]; mif = mifTokenizer; mid = midTokenizer; // numAttribs == 0 when Reader is called from within readMifHeader for determining geometry Type if (numAttribs > 0) { try { fieldValueSetters = getValueSetters(); } catch (SchemaException e) { throw new IOException(e.getMessage()); } inputFeature = readFeature(); } }
throw new SchemaException("Can only specify a single super type");
featureType = DataUtilities.createType("memory", "geom:Geometry"); } catch (SchemaException se) { se.printStackTrace(); featureType = DataUtilities.createType("memory", "geom:Point"); } catch (SchemaException se) { se.printStackTrace();