[Schmitzm-commits] r333 - branches/1.0-gt2-2.6/src/schmitzm/geotools/feature
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Aug 26 19:34:01 CEST 2009
Author: alfonx
Date: 2009-08-26 19:34:01 +0200 (Wed, 26 Aug 2009)
New Revision: 333
Modified:
branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java
Log:
Migrating to GT2.6... getDefaultGeometry() ....
Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java 2009-08-26 17:15:49 UTC (rev 332)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java 2009-08-26 17:34:01 UTC (rev 333)
@@ -73,6 +73,7 @@
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.feature.type.AttributeDescriptor;
+import org.opengis.feature.type.GeometryDescriptor;
import org.opengis.filter.FilterFactory2;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -171,8 +172,17 @@
GeometryAttributeType geometryType = fType.getDefaultGeometry();
return getGeometryForm(geometryType);
}
+
/**
+ * Determines the kind of geometry of a {@link GeometryDescriptor}.
+ */
+ public static GeometryForm getGeometryForm(GeometryDescriptor gDesc) {
+ return getGeometryForm(gDesc.getType().getBinding());
+ }
+
+
+ /**
* Determines the kind of geometry of a {@link GeometryAttributeType}.
*
* @param geometryType
@@ -180,20 +190,28 @@
*/
public static GeometryForm getGeometryForm(
GeometryAttributeType geometryType) {
- final Class geomType = geometryType.getBinding();
- if (Point.class.isAssignableFrom(geomType)
- || MultiPoint.class.isAssignableFrom(geomType))
+ return getGeometryForm(geometryType.getBinding());
+ }
+
+
+ /**
+ * Determines the kind of geometry of a {@link Class}.
+ */
+ public static GeometryForm getGeometryForm(Class geometryType) {
+
+ if (Point.class.isAssignableFrom(geometryType)
+ || MultiPoint.class.isAssignableFrom(geometryType))
return GeometryForm.POINT;
- else if (LineString.class.isAssignableFrom(geomType)
- || MultiLineString.class.isAssignableFrom(geomType))
+ else if (LineString.class.isAssignableFrom(geometryType)
+ || MultiLineString.class.isAssignableFrom(geometryType))
return GeometryForm.LINE;
- else if (Polygon.class.isAssignableFrom(geomType)
- || MultiPolygon.class.isAssignableFrom(geomType))
+ else if (Polygon.class.isAssignableFrom(geometryType)
+ || MultiPolygon.class.isAssignableFrom(geometryType))
return GeometryForm.POLYGON;
throw new UnsupportedOperationException("Unknown geometry type: "
- + geomType.getName());
+ + geometryType.getName());
}
/**
More information about the Schmitzm-commits
mailing list