Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use DefaultFeatureCollection to give GML a way to catch features

  • Loading branch information...
commit 3eb1e41c9b74dc47d9db4a8624887ec355ecc7b7 1 parent 6c0fe5e
@jodygarnett jodygarnett authored
View
2  modules/library/xml/src/main/java/org/geotools/GML.java
@@ -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) {
View
9 modules/library/xml/src/test/java/org/geotools/GMLTest.java
@@ -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));
Please sign in to comment.
Something went wrong with that request. Please try again.