本文整理汇总了Java中org.opengis.feature.type.GeometryDescriptor.getLocalName方法的典型用法代码示例。如果您正苦于以下问题:Java GeometryDescriptor.getLocalName方法的具体用法?Java GeometryDescriptor.getLocalName怎么用?Java GeometryDescriptor.getLocalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opengis.feature.type.GeometryDescriptor
的用法示例。
在下文中一共展示了GeometryDescriptor.getLocalName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setGeometry
import org.opengis.feature.type.GeometryDescriptor; //导入方法依赖的package包/类
/**
* Retrieve information about the feature geometry
*/
private void setGeometry() {
GeometryDescriptor geomDesc = featureSource.getSchema().getGeometryDescriptor();
geometryAttributeName = geomDesc.getLocalName();
Class<?> clazz = geomDesc.getType().getBinding();
if (Polygon.class.isAssignableFrom(clazz) ||
MultiPolygon.class.isAssignableFrom(clazz)) {
geometryType = GeomType.POLYGON;
} else if (LineString.class.isAssignableFrom(clazz) ||
MultiLineString.class.isAssignableFrom(clazz)) {
geometryType = GeomType.LINE;
} else {
geometryType = GeomType.POINT;
}
}
示例2: VectorLayerHelper
import org.opengis.feature.type.GeometryDescriptor; //导入方法依赖的package包/类
/**
* Create a new helper to work with a {@code MapLayer} that has vector
* feature data.
*
* @param layer
* the map layer
*
* @param geomAttributeName
* the name of the geometry attribute for {@code Features}
*
* @param geomClass
* the geometry class
*/
@SuppressWarnings("unchecked")
public VectorLayerHelper(final MapContent context, final Layer layer) {
super(context, layer.getFeatureSource().getSchema().getCoordinateReferenceSystem());
this.layerRef = new WeakReference<Layer>(layer);
final GeometryDescriptor geomDesc = layer.getFeatureSource().getSchema().getGeometryDescriptor();
this.attrName = geomDesc.getLocalName();
final Class<? extends Geometry> geomClass = (Class<? extends Geometry>) geomDesc.getType().getBinding();
final Geometries type = Geometries.getForBinding(geomClass);
this.isPolygonGeometry = type == Geometries.POLYGON || type == Geometries.MULTIPOLYGON;
}