[Schmitzm-commits] r344 - branches/1.0-gt2-2.6/src/schmitzm/geotools/feature

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Aug 31 13:09:53 CEST 2009


Author: alfonx
Date: 2009-08-31 13:09:52 +0200 (Mon, 31 Aug 2009)
New Revision: 344

Modified:
   branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java
Log:
Migrating to GT2.6... 

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-31 10:40:31 UTC (rev 343)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/feature/FeatureUtil.java	2009-08-31 11:09:52 UTC (rev 344)
@@ -43,6 +43,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Random;
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
@@ -62,6 +63,7 @@
 import org.geotools.feature.FeatureTypeBuilder;
 import org.geotools.feature.GeometryAttributeType;
 import org.geotools.feature.SchemaException;
+import org.geotools.feature.simple.SimpleFeatureBuilder;
 import org.geotools.feature.type.GeometricAttributeType;
 import org.geotools.filter.FilterFactory;
 import org.geotools.map.MapLayer;
@@ -1257,7 +1259,9 @@
 		Object[] attributes = getDefaultAttributeValues(schema);
 
 		try {
-			sampleFeature = schema.create(attributes);
+			SimpleFeatureBuilder builder = new SimpleFeatureBuilder(schema);
+			sampleFeature = builder.buildFeature( "createSampleFeature_"+new Random().nextInt() );
+			
 		} catch (org.opengis.feature.IllegalAttributeException e) {
 			// Thrown if the SimpleFeatureType does not validate the attributes
 			// Not very likely if we just create a sample feature, so we make it



More information about the Schmitzm-commits mailing list