public GeometryAttribute getDefaultGeometryProperty() { return delegate.getDefaultGeometryProperty(); }
public GeometryAttribute getDefaultGeometryProperty() { return delegate.getDefaultGeometryProperty(); }
@Override public GeometryAttribute getDefaultGeometryProperty() { return simpleFeature.getDefaultGeometryProperty(); }
public GeometryAttribute getDefaultGeometryProperty() { return delegate.getDefaultGeometryProperty(); }
public GeometryAttribute getDefaultGeometryProperty() { return simpleFeature.getDefaultGeometryProperty(); }
public void testDefaultGeometryProperty() { assertTrue( "expected GeometryAttribute, got " + feature.getProperty("the_geom").getClass().getName(), feature.getProperty("the_geom") instanceof GeometryAttribute); GeometryAttribute defaultGeometryProperty = feature.getDefaultGeometryProperty(); assertNotNull(defaultGeometryProperty); assertNull(defaultGeometryProperty.getValue()); assertNotNull(defaultGeometryProperty.getDescriptor()); assertTrue(defaultGeometryProperty.getDescriptor() instanceof GeometryDescriptor); }
public boolean hasGeometry(SimpleFeature feature) { Geometry geometry = (Geometry) feature.getDefaultGeometryProperty().getValue(); return geometry != null; }
while (featureIterator.hasNext()) { SimpleFeature f = (SimpleFeature) featureIterator.next(); if (f.getDefaultGeometryProperty().getValue() == null) continue; DistanceOp op = new DistanceOp( point, (Geometry) f.getDefaultGeometryProperty().getValue()); Coordinate[] co = op.closestPoints(); double[] co0 =
while (featureIterator.hasNext()) { SimpleFeature f = (SimpleFeature) featureIterator.next(); if (f.getDefaultGeometryProperty().getValue() == null) continue; DistanceOp op = new DistanceOp( point, (Geometry) f.getDefaultGeometryProperty().getValue()); Coordinate[] co = op.closestPoints(); double[] co0 =
while (featureIterator.hasNext()) { SimpleFeature f = (SimpleFeature) featureIterator.next(); if (f.getDefaultGeometryProperty().getValue() == null) continue; DistanceOp op = new DistanceOp( point, (Geometry) f.getDefaultGeometryProperty().getValue()); Coordinate[] co = op.closestPoints(); double[] co0 =
/** * Calculates the geographic envelope of the feature in the WGS 84 * Geographic Reference system. */ private Geometry calcWgs84Geometry(SimpleFeature feature) { try { Geometry geometry = (Geometry) feature.getDefaultGeometryProperty().getValue(); Geometry geometryInWgs84 = JTS.transform(geometry, transform); if(mbrOnly) { geometryInWgs84 = geometryInWgs84.getEnvelope(); } return geometryInWgs84; } catch (Exception e) { throw new RuntimeException(e); } }
private void unmapFeature(SimpleFeature feature, FeatureMapFlusher mapFlusher) { Class<?> clazz = feature.getDefaultGeometryProperty().getType().getBinding(); if (clazz.equals(Point.class)) { unmapNode(feature, mapFlusher); } else { unmapWay(feature, mapFlusher); } }
protected Map<String, Geometry> loadGeometries() throws IOException { Map<String, Geometry> result = new HashMap<String, Geometry>(); if (file != null && file.exists()) { Map<String, Object> map = new HashMap<String, Object>(); map.put("url", file.toURI().toURL()); DataStore dataStore = DataStoreFinder.getDataStore(map); String typeName = dataStore.getTypeNames()[0]; FeatureSource<SimpleFeatureType, SimpleFeature> source = dataStore .getFeatureSource(typeName); try (FeatureIterator<SimpleFeature> features = source.getFeatures(Filter.INCLUDE).features()) { while (features.hasNext()) { SimpleFeature feature = features.next(); result.put(feature.getAttribute("WARNCELLID").toString(), (Geometry)feature.getDefaultGeometryProperty().getValue()); } } finally { dataStore.dispose(); } } return result; }
Coordinate[] coords = ((Geometry) way.getDefaultGeometryProperty().getValue()) .getCoordinates(); for (Coordinate coord : coords) {
public SimpleFeature bufferFeature(SimpleFeature feature, Measure<Double, Length> distance) { // extract the geometry GeometryAttribute gProp = feature.getDefaultGeometryProperty(); CoordinateReferenceSystem origCRS = gProp.getDescriptor().getCoordinateReferenceSystem(); Geometry geom = (Geometry) feature.getDefaultGeometry(); Geometry pGeom = geom; MathTransform toTransform, fromTransform = null; // reproject the geometry to a local projection if (!(origCRS instanceof ProjectedCRS)) { double x = geom.getCoordinate().x; double y = geom.getCoordinate().y; String code = "AUTO:42001," + x + "," + y; // System.out.println(code); CoordinateReferenceSystem auto; try { auto = CRS.decode(code); toTransform = CRS.findMathTransform(DefaultGeographicCRS.WGS84, auto); fromTransform = CRS.findMathTransform(auto, DefaultGeographicCRS.WGS84); pGeom = JTS.transform(geom, toTransform); } catch (MismatchedDimensionException | TransformException | FactoryException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
CoordinateReferenceSystem sourceCrs = simpleFeature.getDefaultGeometryProperty().getDescriptor().getCoordinateReferenceSystem(); CoordinateReferenceSystem targetCrs = DefaultGeographicCRS.WGS84;
CoordinateReferenceSystem sourceCrs = simpleFeature.getDefaultGeometryProperty().getDescriptor().getCoordinateReferenceSystem(); CoordinateReferenceSystem targetCrs = DefaultGeographicCRS.WGS84;
changeset, tags); if (type.equals(OSMUtils.nodeType())) { Point pt = (Point) feature.getDefaultGeometryProperty().getValue(); entity = new Node(entityData, pt.getY(), pt.getX());
Measure<Double, Length> distance) { GeometryAttribute gProp = feature.getDefaultGeometryProperty(); CoordinateReferenceSystem origCRS = gProp.getDescriptor() .getCoordinateReferenceSystem();
while (features.hasNext()) { final SimpleFeature feature = features.next(); LOG.trace("{}: {} Attrs={}", feature.getID(), feature.getDefaultGeometryProperty().getValue(), feature.getAttributes());