Permalink
Browse files

Use DefaultFeatureCollection to give GML a way to catch features

  • Loading branch information...
1 parent 6c0fe5e commit 3eb1e41c9b74dc47d9db4a8624887ec355ecc7b7 @jodygarnett jodygarnett committed Oct 30, 2012
@@ -550,7 +550,7 @@ public SimpleFeatureIterator decodeFeatureIterator(InputStream in, QName element
* @return SimpleFeatureCollection
*/
private SimpleFeatureCollection simpleFeatureCollection(Collection<?> collection) {
- SimpleFeatureCollection featureCollection = FeatureCollections.newCollection();
+ DefaultFeatureCollection featureCollection = new DefaultFeatureCollection();
SimpleFeatureType schema = null;
for (Object obj : collection) {
if (schema == null) {
@@ -22,6 +22,7 @@
import org.geotools.data.DataUtilities;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.data.simple.SimpleFeatureIterator;
+import org.geotools.feature.DefaultFeatureCollection;
import org.geotools.feature.FeatureCollections;
import org.geotools.feature.NameImpl;
import org.geotools.feature.simple.SimpleFeatureBuilder;
@@ -71,7 +72,7 @@ public void testEncodeGML2XSD() throws Exception {
public void testEncodeGML2Legacy() throws Exception {
SimpleFeatureType TYPE = DataUtilities.createType("Location", "geom:Point,name:String");
- SimpleFeatureCollection collection = FeatureCollections.newCollection("internal");
+ DefaultFeatureCollection collection = new DefaultFeatureCollection();
WKTReader2 wkt = new WKTReader2();
collection.add(SimpleFeatureBuilder.build(TYPE, new Object[] { wkt.read("POINT (1 2)"),
@@ -115,7 +116,7 @@ public void testEncodeGML2() throws Exception {
out.close();
- SimpleFeatureCollection collection = FeatureCollections.newCollection("internal");
+ DefaultFeatureCollection collection = new DefaultFeatureCollection();
WKTReader2 wkt = new WKTReader2();
collection.add(SimpleFeatureBuilder.build(TYPE, new Object[] { wkt.read("POINT (1 2)"),
@@ -146,7 +147,7 @@ public void testEncodeWFS1_0FeatureCollection() throws Exception {
SimpleFeatureType TYPE = tb.buildFeatureType();
- SimpleFeatureCollection collection = FeatureCollections.newCollection("internal");
+ DefaultFeatureCollection collection = new DefaultFeatureCollection();
WKTReader2 wkt = new WKTReader2();
collection.add(SimpleFeatureBuilder.build(TYPE, new Object[] { wkt.read("POINT (1 2)"),
"name1" }, null));
@@ -175,7 +176,7 @@ public void testEncodeWFS1_1FeatureCollection() throws Exception {
SimpleFeatureType TYPE = tb.buildFeatureType();
- SimpleFeatureCollection collection = FeatureCollections.newCollection("internal");
+ DefaultFeatureCollection collection = new DefaultFeatureCollection();
WKTReader2 wkt = new WKTReader2();
collection.add(SimpleFeatureBuilder.build(TYPE, new Object[] { wkt.read("POINT (1 2)"),
"name1" }, null));

0 comments on commit 3eb1e41

Please sign in to comment.