@Test public void testSimpleArrayComplexProperty() throws Exception { Map<String, Object> json = loadJSONResource("featureCollectionSimpleArray.json"); CoordinateReferenceSystem crs84 = CRS.decode("EPSG:4326", true); SimpleFeatureType schema = GeoJSONSchemaDetector.getSchema(json, crs84); SimpleFeatureCollection fc = GeoJSONReader2.toFeatureCollection(json, schema); try (SimpleFeatureIterator it = fc.features()) { assertTrue(it.hasNext()); SimpleFeature f1 = it.next(); assertFalse(it.hasNext()); assertNotNull(f1); assertEquals("ABC_123", f1.getID()); assertEquals("bar", f1.getAttribute("foo")); List<Integer> expectedSimpleArray = Arrays.asList(1, 2, 3); assertThat(expectedSimpleArray, Is.is(f1.getAttribute("mySimpleIntArray"))); Geometry expectedGeometry = new WKTReader().read("POINT (21.3743445 61.3764872)"); assertEquals(expectedGeometry, f1.getDefaultGeometry()); } }
public static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json, SimpleFeatureType schema) { try { return toFeatureCollection(json, schema, null); } catch (MismatchedDimensionException | TransformException ignore) { throw new RuntimeException("Something bad happened"); } }
GeoJSONReader2 { public static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json, SimpleFeatureType schema) { try { return toFeatureCollection(json, schema, null); } catch (MismatchedDimensionException | TransformException ignore) { throw new RuntimeException("Something bad happened"); } } }
GeoJSONReader2 { public static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json, SimpleFeatureType schema) { try { return toFeatureCollection(json, schema, null); } catch (MismatchedDimensionException | TransformException ignore) { throw new RuntimeException("Something bad happened"); } }  }
GeoJSONReader2 { public static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json, SimpleFeatureType schema) { try { return toFeatureCollection(json, schema, null); } catch (MismatchedDimensionException | TransformException ignore) { throw new RuntimeException("Something bad happened"); } }  static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json, SimpleFeatureType schema); static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json,
            SimpleFeatureType schema, MathTransform transform); static SimpleFeature toFeature(Map<String, Object> json, SimpleFeatureType schema); static SimpleFeature toFeature(Map<String, Object> json, SimpleFeatureType schema,
            MathTransform transform); static Geometry toGeometry(Map<String, Object> geometry); static Point toPoint(Map<String, Object> geometry); static LineString toLineString(Map<String, Object> geometry); static Polygon toPolygon(Map<String, Object> geometry); static MultiPoint toMultiPoint(Map<String, Object> geometry); static MultiLineString toMultiLineString(Map<String, Object> geometry); static MultiPolygon toMultiPolygon(Map<String, Object> geometry); static GeometryCollection toGeometryCollection(Map<String, Object> geometry); }
GeoJSONReader2 { public static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json, SimpleFeatureType schema) { try { return toFeatureCollection(json, schema, null); } catch (MismatchedDimensionException | TransformException ignore) { throw new RuntimeException("Something bad happened"); } }  static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json, SimpleFeatureType schema); static SimpleFeatureCollection toFeatureCollection(Map<String, Object> json,
            SimpleFeatureType schema, MathTransform transform); static SimpleFeature toFeature(Map<String, Object> json, SimpleFeatureType schema); static SimpleFeature toFeature(Map<String, Object> json, SimpleFeatureType schema,
            MathTransform transform); static Geometry toGeometry(Map<String, Object> geometry); static Point toPoint(Map<String, Object> geometry); static LineString toLineString(Map<String, Object> geometry); static Polygon toPolygon(Map<String, Object> geometry); static MultiPoint toMultiPoint(Map<String, Object> geometry); static MultiLineString toMultiLineString(Map<String, Object> geometry); static MultiPolygon toMultiPolygon(Map<String, Object> geometry); static GeometryCollection toGeometryCollection(Map<String, Object> geometry);  }