|
From: <svn...@os...> - 2011-12-18 11:58:05
|
Author: jive
Date: 2011-12-18 03:57:59 -0800 (Sun, 18 Dec 2011)
New Revision: 38424
Modified:
trunk/modules/library/data/src/main/java/org/geotools/data/store/ContentFeatureCollection.java
trunk/modules/unsupported/pom.xml
Log:
Ask ContentFeatureCollection to generate the resulting FeatureType using the same FeatureTypes.transform method as employed by the feature readers - see GEOT-2026
Modified: trunk/modules/library/data/src/main/java/org/geotools/data/store/ContentFeatureCollection.java
===================================================================
--- trunk/modules/library/data/src/main/java/org/geotools/data/store/ContentFeatureCollection.java 2011-12-18 11:54:33 UTC (rev 38423)
+++ trunk/modules/library/data/src/main/java/org/geotools/data/store/ContentFeatureCollection.java 2011-12-18 11:57:59 UTC (rev 38424)
@@ -25,6 +25,8 @@
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.geotools.data.DataUtilities;
import org.geotools.data.DefaultQuery;
@@ -40,9 +42,11 @@
import org.geotools.feature.FeatureCollection;
import org.geotools.feature.FeatureIterator;
import org.geotools.feature.FeatureTypes;
+import org.geotools.feature.SchemaException;
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
import org.geotools.filter.SortBy;
import org.geotools.geometry.jts.ReferencedEnvelope;
+import org.geotools.util.logging.Logging;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.feature.type.AttributeDescriptor;
@@ -63,6 +67,7 @@
*/
public class ContentFeatureCollection implements SimpleFeatureCollection {
+ protected static final Logger LOGGER = Logging.getLogger("org.geotools.data.store");
/**
* feature store the collection originated from.
*/
@@ -103,8 +108,7 @@
listener.collectionChanged( event );
}
catch (Throwable t ){
- //TODO: log this
- //ContentDataStore.LOGGER.log( Level.WARNING, "Problem encountered during notification of "+event, t );
+ LOGGER.log( Level.WARNING, "Problem encountered during notification of "+event, t );
}
}
}
@@ -121,6 +125,19 @@
this.featureType =
SimpleFeatureTypeBuilder.retype(this.featureType, query.getPropertyNames() );
}
+ // Check for change in coordinate reference system
+ // (Even if featureSource.canReproject the feature reader, we will need to adjust the
+ // featureType generated here to be correct)
+ try {
+ if (query.getCoordinateSystemReproject() != null){
+ this.featureType = FeatureTypes.transform(this.featureType, query.getCoordinateSystemReproject() );
+ }
+ else if (query.getCoordinateSystem() != null){
+ this.featureType = FeatureTypes.transform(this.featureType, query.getCoordinateSystem() );
+ }
+ } catch (SchemaException e) {
+ LOGGER.log(Level.FINER,"Problem handling Query change of CoordinateReferenceSystem:"+e,e);
+ }
//check for join and expand attributes as necessary
if (!query.getJoins().isEmpty()) {
Modified: trunk/modules/unsupported/pom.xml
===================================================================
--- trunk/modules/unsupported/pom.xml 2011-12-18 11:54:33 UTC (rev 38423)
+++ trunk/modules/unsupported/pom.xml 2011-12-18 11:57:59 UTC (rev 38424)
@@ -152,12 +152,6 @@
</modules>
</profile>
<profile>
- <id>property</id>
- <modules>
- <module>property-ng</module>
- </modules>
- </profile>
- <profile>
<id>feature-aggreate</id>
<modules>
<module>feature-aggreate</module>
@@ -201,6 +195,7 @@
<module>mark-wkt</module>
<module>feature-aggregate</module>
<module>mongodb</module>
+ <module>property-ng</module>
</modules>
</profile>
</profiles>
|