polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [32/50] [abbrv] zest-qi4j git commit: Updates, Cleanup and preparation for a pull request.
Date Fri, 17 Apr 2015 16:46:19 GMT
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d305f9da/libraries/spatial/src/test/java/org/qi4j/library/spatial/transformations/TransformationsTest.java
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/test/java/org/qi4j/library/spatial/transformations/TransformationsTest.java
b/libraries/spatial/src/test/java/org/qi4j/library/spatial/transformations/TransformationsTest.java
new file mode 100644
index 0000000..5ef485e
--- /dev/null
+++ b/libraries/spatial/src/test/java/org/qi4j/library/spatial/transformations/TransformationsTest.java
@@ -0,0 +1,74 @@
+package org.qi4j.library.spatial.transformations;
+
+import org.junit.Test;
+import org.qi4j.api.geometry.TMultiPoint;
+import org.qi4j.api.geometry.TPoint;
+import org.qi4j.api.geometry.TPolygon;
+import org.qi4j.bootstrap.AssemblyException;
+import org.qi4j.bootstrap.ModuleAssembly;
+import org.qi4j.library.spatial.assembly.TGeometryAssembler;
+import org.qi4j.library.spatial.conversions.TConversions;
+import org.qi4j.library.spatial.projection.transformations.TTransformations;
+import org.qi4j.test.AbstractQi4jTest;
+
+import static org.junit.Assert.assertTrue;
+import static org.qi4j.api.geometry.TGeometryFactory.*;
+
+
+public class TransformationsTest extends AbstractQi4jTest {
+
+    private final static String CRS_EPSG_4326 = "EPSG:4326";
+    private final static String CRS_EPSG_27572 = "EPSG:27572";
+
+    @Override
+    public void assemble(ModuleAssembly module)
+            throws AssemblyException {
+        new TGeometryAssembler().assemble(module);
+    }
+
+    @Test
+    public void whenTransformTPoint() throws Exception {
+        TPoint tPoint = TPoint(module).x(11.57958981111).y(48.13905780941111).geometry(CRS_EPSG_4326);
+        TTransformations.Transform(module).from(tPoint).to("EPSG:27572");
+    }
+
+    @Test
+    public void whenTransformTMultiPoint() throws Exception {
+        TMultiPoint multiPoint = TMultiPoint(module).points(new double[][]
+                {
+                        {11.57958981111, 48.13905780941111},
+                        {11.57958985111, 48.13905780951111},
+
+                }).geometry(CRS_EPSG_4326);
+
+        TTransformations.Transform(module).from(multiPoint).to("EPSG:27572", 2);
+    }
+
+    @Test
+    public void whenTransformPolygon() throws Exception {
+        TPolygon polygon = TPolygon(module)
+                .shell
+                        (
+                                new double[][]
+                                        {
+                                                {11.32965087890625, 48.122101028190805},
+                                                {11.394195556640625, 48.28593438872724},
+                                                {11.9366455078125, 48.232906106325146},
+                                                {11.852874755859375, 47.95038564051011},
+                                                {11.36810302734375, 47.94486657921015},
+                                                {11.32965087890625, 48.122101028190805}
+                                        }
+                        ).geometry(CRS_EPSG_4326);
+
+        TTransformations.Transform(module).from(polygon).to("EPSG:27572", 2);
+    }
+
+    @Test
+    public void whenConvertFromTGeometryToTGeometry() {
+        TPoint tPoint1 = TPoint(module).x(11.57958981111).y(48.13905780941111).geometry();
+        TPoint tPoint2 = (TPoint) TConversions.Convert(module).from(tPoint1).toTGeometry();
+        assertTrue(tPoint1.compareTo(tPoint2) == 0);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d305f9da/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsFromWktTest.java
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsFromWktTest.java
b/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsFromWktTest.java
deleted file mode 100644
index bcf1654..0000000
--- a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsFromWktTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.qi4j.library.spatial.v2.conversions;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.Test;
-import org.qi4j.api.geometry.*;
-import org.qi4j.api.geometry.internal.Coordinate;
-import org.qi4j.api.geometry.internal.TGeometry;
-import org.qi4j.api.geometry.internal.TLinearRing;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.qi4j.library.spatial.v2.conversions.TConversions.Convert;
-
-
-/**
- * Created by jj on 04.12.14.
- */
-public class ConversionsFromWktTest extends AbstractQi4jTest {
-
-    private ObjectMapper GeoJsonMapper = new ObjectMapper();
-
-    private final String CRS_EPSG_4326 = "EPSG:4326";
-    private final String CRS_EPSG_27572 = "EPSG:27572";
-
-    @Override
-    public void assemble( ModuleAssembly module )
-            throws AssemblyException
-    {
-        // internal values
-        module.values(Coordinate.class, TLinearRing.class, TGeometry.class);
-
-        // API values
-        module.values(TPoint.class, TMultiPoint.class, TLineString.class, TPolygon.class,
TMultiPolygon.class, TFeature.class, TFeatureCollection.class);
-
-        TGeometry tGeometry = module.forMixin(TGeometry.class).declareDefaults();
-        tGeometry.CRS().set(CRS_EPSG_4326);
-    }
-
-    @Test
-    public void WhenConvertFromWktToTGeometry() throws Exception
-    {
-        TPoint tPoint = (TPoint)Convert(module).from("POINT(11.57958981111 48.13905780941111
)", CRS_EPSG_27572).toTGeometry();
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d305f9da/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsTest.java
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsTest.java
b/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsTest.java
deleted file mode 100644
index b4febde..0000000
--- a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsTest.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.qi4j.library.spatial.v2.conversions;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.geojson.*;
-import org.junit.Test;
-import org.qi4j.api.geometry.*;
-import org.qi4j.api.geometry.internal.Coordinate;
-import org.qi4j.api.geometry.internal.TGeometry;
-import org.qi4j.api.geometry.internal.TLinearRing;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import static org.qi4j.api.geometry.TGeometryFactory.TMultiPoint;
-import static org.qi4j.api.geometry.TGeometryFactory.TPoint;
-import static org.qi4j.library.spatial.v2.conversions.TConversions.*;
-
-import java.util.Arrays;
-
-
-/**
- * Created by jj on 04.12.14.
- */
-public class ConversionsTest extends AbstractQi4jTest {
-
-    private ObjectMapper GeoJsonMapper = new ObjectMapper();
-
-    private final String CRS_EPSG_4326_ = "EPSG:4326";
-    private final String CRS_EPSG_27572 = "EPSG:27572";
-
-    @Override
-    public void assemble( ModuleAssembly module )
-            throws AssemblyException
-    {
-        // internal values
-        module.values(Coordinate.class, TLinearRing.class, TGeometry.class);
-
-        // API values
-        module.values(TPoint.class, TMultiPoint.class, TLineString.class, TPolygon.class,
TMultiPolygon.class, TFeature.class, TFeatureCollection.class);
-
-        TGeometry tGeometry = module.forMixin(TGeometry.class).declareDefaults();
-        tGeometry.CRS().set(CRS_EPSG_4326_);
-    }
-
-    @Test
-    public void WhenConvertFromTGeometryToTGeometry() throws Exception
-    {
-        TPoint tPoint1 = TPoint(module).x(11.57958981111).y(48.13905780941111).geometry();
-        for (int i = 0;i < 1000000; i++) {
-            TPoint tPoint2 = (TPoint) Convert(module).from(tPoint1).toTGeometry(CRS_EPSG_27572);
-            TPoint tPoint3 = (TPoint) Convert(module).from(tPoint1).toTGeometry(CRS_EPSG_4326_);
-
-        }
-        // assertTrue(tPoint1.compareTo(tPoint2) == 0);
-        System.out.println("Point " + tPoint1);
-    }
-
-    @Test
-    public void WhenConvertPointFromGeoJsonToTGeometry()
-    {
-        TPoint tPoint1          = TPoint(module).y(100).x(0).geometry();
-        Point  geoJsonPoint1    = new Point(100, 0);
-        TPoint tPoint2 = (TPoint)Convert(module).from(geoJsonPoint1).toTGeometry();
-        assertTrue(tPoint1.compareTo(tPoint2) == 0);
-    }
-
-    @Test
-    public void WhenConvertMultiPointFromGeoJsonToTGeometry()
-    {
-        TMultiPoint tMultiPoint1 = TMultiPoint(module).points(new double[][]
-                {
-                        {100d, 0d},
-                        {101d, 1d},
-                        {102d, 2d}
-
-                }).geometry();
-
-        MultiPoint geoJsonMultiPoint = new LineString(new LngLatAlt(100, 0), new LngLatAlt(101,
1), new LngLatAlt(102, 2));
-
-        TMultiPoint tMultiPoint2 = (TMultiPoint)Convert(module).from(geoJsonMultiPoint).toTGeometry();
-        System.out.println(tMultiPoint2);
-
-        assertEquals(geoJsonMultiPoint.getCoordinates().size(),tMultiPoint2.getNumPoints());
-        // TODO JJ - Compare further coordinates
-    }
-
-    @Test
-    public void WhenConvertLineStringFromGeoJsonToTGeometry() throws Exception
-    {
-        LineString geoJsonLineString = GeoJsonMapper.readValue("{\"type\":\"LineString\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}",
-                LineString.class);
-        TLineString tLineString = (TLineString)Convert(module).from(geoJsonLineString).toTGeometry();
-        // System.out.println(Convert(module).from(geoJsonLineString).toTGeometry());
-    }
-
-    @Test
-    public void WhenConvertMultiLineStringFromGeoJsonToTGeometry() throws Exception
-    {
-        MultiLineString multiLineString = new MultiLineString();
-        multiLineString.add(Arrays.asList(new LngLatAlt(100, 0), new LngLatAlt(101, 1)));
-        multiLineString.add(Arrays.asList(new LngLatAlt(102, 2), new LngLatAlt(103, 3)));
-    }
-
-    @Test
-    public void WhenConvertPolygonFromGeoJsonToTGeometry() throws Exception {
-
-        Polygon polygon = GeoJsonMapper.readValue("{\"type\":\"Polygon\",\"coordinates\":"
-                + "[[[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],"
-                + "[[100.2,0.2],[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]}", Polygon.class);
-        TPolygon tPolygon = (TPolygon)Convert(module).from(polygon).toTGeometry();
-
-        System.out.println(tPolygon);
-    }
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d305f9da/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsWithProjectionsTest.java
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsWithProjectionsTest.java
b/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsWithProjectionsTest.java
deleted file mode 100644
index 457f0c9..0000000
--- a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConversionsWithProjectionsTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.qi4j.library.spatial.v2.conversions;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.Test;
-import org.qi4j.api.geometry.*;
-import org.qi4j.api.geometry.internal.Coordinate;
-import org.qi4j.api.geometry.internal.TGeometry;
-import org.qi4j.api.geometry.internal.TLinearRing;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.qi4j.api.geometry.TGeometryFactory.TPoint;
-import static org.qi4j.library.spatial.v2.conversions.TConversions.Convert;
-
-
-/**
- * Created by jj on 04.12.14.
- */
-public class ConversionsWithProjectionsTest extends AbstractQi4jTest {
-
-    private ObjectMapper GeoJsonMapper = new ObjectMapper();
-
-    // private final String CRS1 = "urn:ogc:def:crs:OGC:1.3:CRS84";
-
-    private final String CRS1 ="EPSG:4326";
-
-
-
-    @Override
-    public void assemble( ModuleAssembly module )
-            throws AssemblyException
-    {
-        // internal values
-        module.values(Coordinate.class, TLinearRing.class, TGeometry.class);
-
-        // API values
-        module.values(TPoint.class, TMultiPoint.class, TLineString.class, TPolygon.class,
TMultiPolygon.class, TFeature.class, TFeatureCollection.class);
-
-        TGeometry tGeometry = module.forMixin(TGeometry.class).declareDefaults();
-        tGeometry.CRS().set(CRS1);
-
-    }
-
-    @Test
-    public void WhenConvertFromTGeometryToTGeometryConvertProjections() throws Exception
-    {
-        TPoint tPoint1 = TPoint(module).x(11.57958981111).y(48.13905780941111).geometry();
-        TPoint tPoint2 = (TPoint)Convert(module).from(tPoint1).toTGeometry(CRS1);
-        assertTrue(tPoint1.compareTo(tPoint2) == 0);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d305f9da/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConvertFromGeoJsonToTGeometry.java
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConvertFromGeoJsonToTGeometry.java
b/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConvertFromGeoJsonToTGeometry.java
deleted file mode 100644
index 5a6064a..0000000
--- a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/conversions/ConvertFromGeoJsonToTGeometry.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.qi4j.library.spatial.v2.conversions;
-
-import org.geojson.Point;
-import org.junit.Test;
-import org.qi4j.api.geometry.*;
-import org.qi4j.api.geometry.internal.Coordinate;
-import org.qi4j.api.geometry.internal.TGeometry;
-import org.qi4j.api.geometry.internal.TLinearRing;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-
-import static org.qi4j.api.geometry.TGeometryFactory.TPoint;
-import static org.qi4j.library.spatial.v2.conversions.TConversions.Convert;
-
-/**
- * Created by jj on 04.12.14.
- */
-public class ConvertFromGeoJsonToTGeometry  extends AbstractQi4jTest {
-
-    @Override
-    public void assemble( ModuleAssembly module )
-            throws AssemblyException
-    {
-        // internal values
-        module.values(Coordinate.class, TLinearRing.class, TGeometry.class);
-
-        // API values
-        module.values(TPoint.class, TMultiPoint.class, TLineString.class, TPolygon.class,
TMultiPolygon.class, TFeature.class, TFeatureCollection.class);
-
-    }
-
-    @Test
-    public void WhenConvertingPoint()
-    {
-
-        Point point1  = new Point(100, 0);
-        TPoint tPoint1 = (TPoint)Convert(module).from(point1).toTGeometry();
-        Point point2  = (Point)Convert(module).from(point1).toGeoJson();
-        System.out.println(point2.toString());
-        TPoint tPoint2 = (TPoint)Convert(module).from(point2).toTGeometry();
-        System.out.println(tPoint1);
-        System.out.println(tPoint2);
-
-
-        assertTrue(tPoint1.compareTo(tPoint2) == 0);
-    }
-
-    @Test
-    public void WhenConvertingPoint2()
-    {
-        TPoint tPoint1 = TPoint(module).x(11.57958981111).y(48.13905780941111).geometry();
-        Point point1  = new Point(1,2 );
-        Point point2  = (Point)Convert(module).from(point1).toGeoJson();
-        System.out.println(point2.getCoordinates().getLatitude());
-        System.out.println(point2.getCoordinates().getLongitude());
-        TPoint tPoint2 = (TPoint)Convert(module).from(point2).toTGeometry();
-        System.out.println(tPoint2);
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d305f9da/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/transformations/TransformationsTest.java
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/transformations/TransformationsTest.java
b/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/transformations/TransformationsTest.java
deleted file mode 100644
index 4f49a9b..0000000
--- a/libraries/spatial/src/test/java/org/qi4j/library/spatial/v2/transformations/TransformationsTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.qi4j.library.spatial.v2.transformations;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.Test;
-import org.qi4j.api.geometry.*;
-import org.qi4j.api.geometry.internal.Coordinate;
-import org.qi4j.api.geometry.internal.TGeometry;
-import org.qi4j.api.geometry.internal.TLinearRing;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.qi4j.api.geometry.TGeometryFactory.TMultiPoint;
-import static org.qi4j.api.geometry.TGeometryFactory.TPoint;
-import static org.qi4j.api.geometry.TGeometryFactory.TPolygon;
-import static org.qi4j.library.spatial.v2.conversions.TConversions.Convert;
-import static org.qi4j.library.spatial.v2.transformations.TTransformations.Transform;
-
-
-/**
- * Created by jj on 04.12.14.
- */
-public class TransformationsTest extends AbstractQi4jTest {
-
-    private ObjectMapper GeoJsonMapper = new ObjectMapper();
-    private final String CRS_EPSG_4326 = "EPSG:4326";
-    private final String CRS_EPSG_27572 = "EPSG:27572";
-
-
-
-    @Override
-    public void assemble( ModuleAssembly module )
-            throws AssemblyException
-    {
-        // internal values
-        module.values(Coordinate.class, TLinearRing.class, TGeometry.class);
-
-        // API values
-        module.values(TPoint.class, TMultiPoint.class, TLineString.class, TPolygon.class,
TMultiPolygon.class, TFeature.class, TFeatureCollection.class);
-
-        TGeometry tGeometry = module.forMixin(TGeometry.class).declareDefaults();
-        tGeometry.CRS().set(CRS_EPSG_4326);
-
-    }
-
-    @Test
-    public void WhenTransformTPoint() throws Exception
-    {
-        TPoint tPoint  = TPoint(module).x(11.57958981111).y(48.13905780941111).geometry(CRS_EPSG_4326);
-        TPoint tPoint1  = TPoint(module).x(11.57958981111).y(48.13905780941111).geometry(CRS_EPSG_4326);
-
-        Transform(module).from(tPoint).to("EPSG:27572");
-
-        System.out.println(tPoint1);
-        System.out.println(tPoint);
-    }
-
-    @Test
-    public void WhenTransformTMultiPoint() throws Exception
-    {
-        TMultiPoint multiPoint = TMultiPoint(module).points(new double[][]
-                {
-                        {11.57958981111, 48.13905780941111},
-                        {11.57958985111, 48.13905780951111},
-
-                }).geometry(CRS_EPSG_4326);
-
-        Transform(module).from(multiPoint).to("EPSG:27572", 2);
-        System.out.println(multiPoint);
-    }
-
-    @Test
-    public void WhenTransformPolygon() throws Exception
-    {
-      TPolygon polygon =   TPolygon(module)
-                        .shell
-                                (
-                                        new double[][]
-                                                {
-                                                        {11.32965087890625, 48.122101028190805},
-                                                        {11.394195556640625, 48.28593438872724},
-                                                        {11.9366455078125, 48.232906106325146},
-                                                        {11.852874755859375, 47.95038564051011},
-                                                        {11.36810302734375, 47.94486657921015},
-                                                        {11.32965087890625, 48.122101028190805}
-                                                }
-                                ).geometry(CRS_EPSG_4326);
-
-        Transform(module).from(polygon).to("EPSG:27572", 2);
-
-        System.out.println(polygon);
-    }
-
-    @Test
-    public void WhenConvertFromTGeometryToTGeometry()
-    {
-        TPoint tPoint1 = TPoint(module).x(11.57958981111).y(48.13905780941111).geometry();
-        TPoint tPoint2 = (TPoint)Convert(module).from(tPoint1).toTGeometry();
-        assertTrue(tPoint1.compareTo(tPoint2) == 0);
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d305f9da/libraries/spatial/src/test/resources/topo/geojson/swiss/FeatureCollection.json
----------------------------------------------------------------------
diff --git a/libraries/spatial/src/test/resources/topo/geojson/swiss/FeatureCollection.json
b/libraries/spatial/src/test/resources/topo/geojson/swiss/FeatureCollection.json
index f3e1e00..a2c738d 100644
--- a/libraries/spatial/src/test/resources/topo/geojson/swiss/FeatureCollection.json
+++ b/libraries/spatial/src/test/resources/topo/geojson/swiss/FeatureCollection.json
@@ -1,33 +1,78 @@
-{ "type": "FeatureCollection",
-    "features": [
-        { "type": "Feature",
-            "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
-            "properties": {"prop0": "value0"}
-        },
-        { "type": "Feature",
-            "geometry": {
-                "type": "LineString",
-                "coordinates": [
-                    [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]
-                ]
-            },
-            "properties": {
-                "prop0": "value0",
-                "prop1": 0.0
-            }
-        },
-        { "type": "Feature",
-            "geometry": {
-                "type": "Polygon",
-                "coordinates": [
-                    [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
-                        [100.0, 1.0], [100.0, 0.0] ]
-                ]
-            },
-            "properties": {
-                "prop0": "value0",
-                "prop1": {"this": "that"}
-            }
-        }
-    ]
+{
+  "type": "FeatureCollection",
+  "features": [
+    {
+      "type": "Feature",
+      "geometry": {
+        "type": "Point",
+        "coordinates": [
+          102.0,
+          0.5
+        ]
+      },
+      "properties": {"prop0": "value0"}
+    },
+    {
+      "type": "Feature",
+      "geometry": {
+        "type": "LineString",
+        "coordinates": [
+          [
+            102.0,
+            0.0
+          ],
+          [
+            103.0,
+            1.0
+          ],
+          [
+            104.0,
+            0.0
+          ],
+          [
+            105.0,
+            1.0
+          ]
+        ]
+      },
+      "properties": {
+        "prop0": "value0",
+        "prop1": 0.0
+      }
+    },
+    {
+      "type": "Feature",
+      "geometry": {
+        "type": "Polygon",
+        "coordinates": [
+          [
+            [
+              100.0,
+              0.0
+            ],
+            [
+              101.0,
+              0.0
+            ],
+            [
+              101.0,
+              1.0
+            ],
+            [
+              100.0,
+              1.0
+            ],
+            [
+              100.0,
+              0.0
+            ]
+          ]
+        ]
+      },
+      "properties": {
+        "prop0": "value0",
+        "prop1": {"this": "that"}
+      }
+    }
+  ]
 }
\ No newline at end of file


Mime
View raw message