@Test public void testGetBounds() throws IOException { final String namespaceUri = "http: final String localName = "RoadSegment"; final Name typeName = Types.typeName(namespaceUri, localName); URL configUrl = getClass().getResource("/test-data/roadsegments.xml"); AppSchemaDataAccessDTO config = new XMLConfigDigester().parse(configUrl); Set<FeatureTypeMapping> mappings = AppSchemaDataAccessConfigurator.buildMappings(config); dataStore = new AppSchemaDataAccess(mappings); FeatureSource<FeatureType, Feature> source = dataStore.getFeatureSource(typeName); FeatureTypeMapping mapping = (FeatureTypeMapping) mappings.iterator().next(); FeatureSource<?,?> mappedSource = mapping.getSource(); Envelope expected = getBounds(mappedSource); Envelope actual = getBounds(source); assertEquals(expected, actual); }
protected ReferencedEnvelope getBounds(Query query) throws IOException { FeatureTypeMapping mapping = getMappingByElement(getName(query)); Query unmappedQuery = unrollQuery(query, mapping); return mapping.getSource().getBounds(unmappedQuery); }
AppSchemaDataAccess implements DataAccess<FeatureType, Feature> { protected ReferencedEnvelope getBounds(Query query) throws IOException { FeatureTypeMapping mapping = getMappingByElement(getName(query)); Query unmappedQuery = unrollQuery(query, mapping); return mapping.getSource().getBounds(unmappedQuery); } }
AppSchemaDataAccess implements DataAccess<FeatureType, Feature> { protected ReferencedEnvelope getBounds(Query query) throws IOException { FeatureTypeMapping mapping = getMappingByElement(getName(query)); Query unmappedQuery = unrollQuery(query, mapping); return mapping.getSource().getBounds(unmappedQuery); } AppSchemaDataAccess(Set<FeatureTypeMapping> mappings); }
AppSchemaDataAccess implements DataAccess<FeatureType, Feature> { protected ReferencedEnvelope getBounds(Query query) throws IOException { FeatureTypeMapping mapping = getMappingByElement(getName(query)); Query unmappedQuery = unrollQuery(query, mapping); return mapping.getSource().getBounds(unmappedQuery); } AppSchemaDataAccess(Set<FeatureTypeMapping> mappings); Name[] getTypeNames(); FeatureType getSchema(Name typeName); FeatureTypeMapping getMappingByName(Name typeName); FeatureTypeMapping getMappingByElement(Name typeName); boolean hasName(Name name); boolean hasElement(Name typeName); @SuppressWarnings("unchecked") Query unrollQuery(Query query, FeatureTypeMapping mapping); static Filter unrollFilter(Filter complexFilter, FeatureTypeMapping mapping); void dispose(); ServiceInfo getInfo(); List<Name> getNames(); void createSchema(FeatureType featureType); FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName); void updateSchema(Name typeName, FeatureType featureType); FeatureSource<FeatureType, Feature> getFeatureSourceByName(Name typeName); }
AppSchemaDataAccess implements DataAccess<FeatureType, Feature> { protected ReferencedEnvelope getBounds(Query query) throws IOException { FeatureTypeMapping mapping = getMappingByElement(getName(query)); Query unmappedQuery = unrollQuery(query, mapping); return mapping.getSource().getBounds(unmappedQuery); } AppSchemaDataAccess(Set<FeatureTypeMapping> mappings); Name[] getTypeNames(); FeatureType getSchema(Name typeName); FeatureTypeMapping getMappingByName(Name typeName); FeatureTypeMapping getMappingByElement(Name typeName); boolean hasName(Name name); boolean hasElement(Name typeName); @SuppressWarnings("unchecked") Query unrollQuery(Query query, FeatureTypeMapping mapping); static Filter unrollFilter(Filter complexFilter, FeatureTypeMapping mapping); void dispose(); ServiceInfo getInfo(); List<Name> getNames(); void createSchema(FeatureType featureType); FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName); void updateSchema(Name typeName, FeatureType featureType); FeatureSource<FeatureType, Feature> getFeatureSourceByName(Name typeName);  }