Hello,

I am using geotools 11.1 and am trying to convert from GeoJSON to a JTS
Geometry. All of the GeoJSON files that I have are of type
"GeometryCollection". I have noticed that the conversion does not work if
the "type" key is not in the expected order.

Here is a working example:
{
    "type": "GeometryCollection",
    "geometries": [
        {
            "type": "Polygon",
            "coordinates": [
                [[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0],
[100.0, 0.0]]
            ]
        },
        {
            "type": "Point",
            "coordinates": [100.0, 0.0]
        }
    ]
}

and here is a NOT working example:
{
    "geometries": [
        {
            "type": "Polygon",
            "coordinates": [
                [[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0],
[100.0, 0.0]]
            ]
        },
        {
            "type": "Point",
            "coordinates": [100.0, 0.0]
        }
    ],
    "type": "GeometryCollection"
}


Should it require a specific order for the keys? In looking at the GeoJSON
spec, I didn't see any mention of a required order.

Any thoughts on whether this is a bug?

Thanks,

James
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to