use of org.geotools.data.Query in project polymap4-core by Polymap4.
the class FeatureRenameProcessor method featuresRequest.
@Produces(GetFeaturesRequest.class)
public void featuresRequest(GetFeaturesRequest request, ProcessorContext context) throws Exception {
Query transformed = transformQuery(request.getQuery(), context);
context.sendRequest(new GetFeaturesRequest(transformed));
}
use of org.geotools.data.Query in project polymap4-core by Polymap4.
the class FeatureRenameProcessor method featuresSizeRequest.
@Produces(GetFeaturesSizeRequest.class)
public void featuresSizeRequest(GetFeaturesSizeRequest request, ProcessorContext context) throws Exception {
Query transformed = transformQuery(request.getQuery(), context);
context.sendRequest(new GetFeaturesSizeRequest(transformed));
}
use of org.geotools.data.Query in project polymap4-core by Polymap4.
the class FeatureRenameProcessor method boundsRequest.
@Produces(GetBoundsRequest.class)
public void boundsRequest(GetBoundsRequest request, ProcessorContext context) throws Exception {
Query transformed = transformQuery(request.query.get(), context);
context.sendRequest(new GetBoundsRequest(transformed));
}
use of org.geotools.data.Query in project OpenTripPlanner by opentripplanner.
the class WFSNotePollingGraphUpdater method setup.
/**
* Setup the WFS data source and add the DynamicStreetNotesSource to the graph
*/
@Override
public void setup() throws IOException, FactoryException {
LOG.info("Setup WFS polling updater");
HashMap<String, Object> connectionParameters = new HashMap<>();
connectionParameters.put(WFSDataStoreFactory.URL.key, url);
WFSDataStore data = (new WFSDataStoreFactory()).createDataStore(connectionParameters);
// Read only single feature type from the source
query = new Query(featureType);
// Get coordinates in WGS-84
query.setCoordinateSystem(CRS.decode("EPSG:4326", true));
featureSource = data.getFeatureSource(featureType);
graph.streetNotesService.addNotesSource(notesSource);
}
use of org.geotools.data.Query in project GeoGig by boundlessgeo.
the class GeoGigDataStoreTest method testFeatureWriterAppend.
@Test
public void testFeatureWriterAppend() throws Exception {
dataStore.createSchema(linesType);
Transaction tx = new DefaultTransaction();
FeatureWriter<SimpleFeatureType, SimpleFeature> fw = dataStore.getFeatureWriterAppend(linesTypeName.getLocalPart(), tx);
LineString line = new GeometryBuilder().lineString(0, 0, 1, 1);
SimpleFeature f = (SimpleFeature) fw.next();
f.setAttribute("sp", "foo");
f.setAttribute("ip", 10);
f.setAttribute("pp", line);
fw.write();
fw.close();
tx.commit();
FeatureSource<SimpleFeatureType, SimpleFeature> source = dataStore.getFeatureSource(linesTypeName);
assertEquals(1, source.getCount(null));
FeatureReader<SimpleFeatureType, SimpleFeature> r = dataStore.getFeatureReader(new Query(linesTypeName.getLocalPart()), Transaction.AUTO_COMMIT);
assertTrue(r.hasNext());
f = r.next();
assertEquals("foo", f.getAttribute("sp"));
assertEquals(10, f.getAttribute("ip"));
assertTrue(line.equals((Geometry) f.getAttribute("pp")));
}
Aggregations