[Schmitzm-commits] r327 - in branches/1.0-gt2-2.6/src: schmitzm/geotools/feature schmitzm/jfree/feature/style skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Aug 26 17:55:48 CEST 2009


Author: alfonx
Date: 2009-08-26 17:55:48 +0200 (Wed, 26 Aug 2009)
New Revision: 327

Modified:
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureCollectionReader.java
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java
   branches/1.0-gt2-2.6/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
   branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFeatureSourceInterface.java
Log:
Migrating to GT2.6

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureCollectionReader.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureCollectionReader.java	2009-08-26 15:38:06 UTC (rev 326)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureCollectionReader.java	2009-08-26 15:55:48 UTC (rev 327)
@@ -47,11 +47,11 @@
  * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
  * @version 1.0
  */
-public class FeatureCollectionReader implements FeatureReader {
-  private FeatureIterator   iterator    = null;
+public class FeatureCollectionReader implements FeatureReader<SimpleFeatureType, SimpleFeature> {
+  private FeatureIterator<SimpleFeature>   iterator    = null;
   private boolean           closed      = false;
-  private SimpleFeatureType       featureType = null;
-  private FeatureCollection fc          = null;
+  private SimpleFeatureType featureType = null;
+  private FeatureCollection<SimpleFeatureType, SimpleFeature> fc          = null;
 
   /**
    * Erzeugt einen neuen FeatureReader.
@@ -59,11 +59,12 @@
    * @throws java.lang.UnsupportedOperationException falls die FeatureCollection
    *         kein Element enthaelt.
    */
-  public FeatureCollectionReader(FeatureCollection fc) {
+  public FeatureCollectionReader(FeatureCollection<SimpleFeatureType, SimpleFeature> fc) {
     if ( fc.isEmpty() )
       throw new UnsupportedOperationException("FeatureCollection must contain at least one SimpleFeature!");
     this.fc          = fc;
-    this.featureType = new FeatureIteratorImpl(fc).next().getFeatureType();
+    
+    this.featureType =  new FeatureIteratorImpl<SimpleFeature>(fc).next().getType();
     reset();
   }
 

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 15:38:06 UTC (rev 326)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java	2009-08-26 15:55:48 UTC (rev 327)
@@ -180,7 +180,7 @@
 	 */
 	public static GeometryForm getGeometryForm(
 			GeometryAttributeType geometryType) {
-		final Class geomType = geometryType.getType();
+		final Class geomType = geometryType.getBinding();
 
 		if (Point.class.isAssignableFrom(geomType)
 				|| MultiPoint.class.isAssignableFrom(geomType))

Modified: branches/1.0-gt2-2.6/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/jfree/feature/style/FeatureChartUtil.java	2009-08-26 15:38:06 UTC (rev 326)
+++ branches/1.0-gt2-2.6/src/schmitzm/jfree/feature/style/FeatureChartUtil.java	2009-08-26 15:55:48 UTC (rev 327)
@@ -213,7 +213,7 @@
 	 * @throws UnsupportedOperationException
 	 *             if attributes are not numeric
 	 */
-	public static XYSeriesCollection createXYDataset(FeatureCollection fc,
+	public static XYSeriesCollection createXYDataset(FeatureCollection<SimpleFeatureType, SimpleFeature> fc,
 			FeatureChartStyle chartStyle) {
 		int attrCount = chartStyle.getAttributeCount();
 		if (attrCount < 2)
@@ -316,7 +316,7 @@
 	 *            {@link ChartStyle} to determine which attributes shall be
 	 *            normalized.
 	 */
-	public static HashMap<String,StaticBin1D> calcStatisticsForNormalization(FeatureCollection fc,
+	public static HashMap<String,StaticBin1D> calcStatisticsForNormalization(FeatureCollection<SimpleFeatureType, SimpleFeature> fc,
 			FeatureChartStyle chartStyle) {
 		// NORMALIZATION:
 		// We have to create a descriptive statistic of all items before we can
@@ -340,7 +340,7 @@
 			}
 			
 			if (doNormalization) {
-				final FeatureIterator fIt = fc.features();
+				final FeatureIterator<SimpleFeature> fIt = fc.features();
 				// Loop over all features, and collect the attribute values we are interested in.
 				while (fIt.hasNext()){
 					SimpleFeature f = fIt.next();
@@ -407,7 +407,7 @@
 	 * @throws UnsupportedOperationException
 	 *             if attributes are not numeric
 	 */
-	public static DefaultCategoryDataset createCategoryDataset(FeatureCollection fc, FeatureChartStyle chartStyle) {
+	public static DefaultCategoryDataset createCategoryDataset(FeatureCollection<SimpleFeatureType, SimpleFeature> fc, FeatureChartStyle chartStyle) {
 		int attrCount = chartStyle.getAttributeCount();
 		if (attrCount < 2)
 		  throw new IllegalArgumentException("FeatureChartStyle must define at least 2 attributes to create CategoryDataset: "+ attrCount);

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFeatureSourceInterface.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFeatureSourceInterface.java	2009-08-26 15:38:06 UTC (rev 326)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/StyledFeatureSourceInterface.java	2009-08-26 15:55:48 UTC (rev 327)
@@ -30,10 +30,12 @@
 package skrueger.geotools;
 
 import org.geotools.data.FeatureSource;
+import org.opengis.feature.simple.SimpleFeature;
+import org.opengis.feature.simple.SimpleFeatureType;
 
 /**
  * {@link StyledLayerInterface} which contains a {@link FeatureSource} as geo object.<br>
  */
-public interface StyledFeatureSourceInterface extends StyledFeaturesInterface<FeatureSource> {
+public interface StyledFeatureSourceInterface extends StyledFeaturesInterface<FeatureSource<SimpleFeatureType, SimpleFeature>> {
 
 }



More information about the Schmitzm-commits mailing list