use of org.opengis.feature.type.GeometryDescriptor in project GeoGig by boundlessgeo.
the class RevFeatureSerializationTest method feature.
protected Feature feature(SimpleFeatureType type, String id, Object... values) throws ParseException {
SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
for (int i = 0; i < values.length; i++) {
Object value = values[i];
if (type.getDescriptor(i) instanceof GeometryDescriptor) {
if (value instanceof String) {
value = new WKTReader2().read((String) value);
}
}
builder.set(i, value);
}
return builder.buildFeature(id);
}
use of org.opengis.feature.type.GeometryDescriptor in project GeoGig by boundlessgeo.
the class OSMExportPG method getOriginTreesFromOutputFeatureType.
private String getOriginTreesFromOutputFeatureType(SimpleFeatureType featureType) {
GeometryDescriptor descriptor = featureType.getGeometryDescriptor();
Class<?> clazz = descriptor.getType().getBinding();
if (clazz.equals(Point.class)) {
return "node";
} else {
return "way";
}
}
use of org.opengis.feature.type.GeometryDescriptor in project GeoGig by boundlessgeo.
the class OSMExportShp method getOriginTreesFromOutputFeatureType.
private String getOriginTreesFromOutputFeatureType(SimpleFeatureType featureType) {
GeometryDescriptor descriptor = featureType.getGeometryDescriptor();
Class<?> clazz = descriptor.getType().getBinding();
if (clazz.equals(Point.class)) {
return "node";
} else {
return "way";
}
}
use of org.opengis.feature.type.GeometryDescriptor in project GeoGig by boundlessgeo.
the class RepositoryTestCase method feature.
protected Feature feature(SimpleFeatureType type, String id, Object... values) throws ParseException {
SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
for (int i = 0; i < values.length; i++) {
Object value = values[i];
if (type.getDescriptor(i) instanceof GeometryDescriptor) {
if (value instanceof String) {
value = new WKTReader2().read((String) value);
}
}
builder.set(i, value);
}
return builder.buildFeature(id);
}
use of org.opengis.feature.type.GeometryDescriptor in project GeoGig by boundlessgeo.
the class TestFeatures method feature.
public static Feature feature(SimpleFeatureType type, String id, Object... values) throws ParseException {
SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
for (int i = 0; i < values.length; i++) {
Object value = values[i];
if (type.getDescriptor(i) instanceof GeometryDescriptor) {
if (value instanceof String) {
value = new WKTReader2().read((String) value);
}
}
builder.set(i, value);
}
return builder.buildFeature(id);
}
Aggregations