def test_geoshape_feature_collection(self): geojson = { "type": "FeatureCollection", "features": [{ "type": "Feature", "properties": { "hello": "I should be removed" }, "geometry": { "type": "Point", "coordinates": [0, 0] } }] } geoshape = GeoJSON("geom", geojson) self.assertEquals(geoshape.to_query(), { "geo_shape": { "geom": { "shape": { "type": "GeometryCollection", "geometries": [{ "type": "Point", "coordinates": [0, 0] }] } } } })
def test_geoshape_point(self): geojson = { "type": "Point", "coordinates": [0, 0] } geoshape = GeoJSON("geom", geojson) self.assertEquals(geoshape.to_query(), { "geo_shape": { "geom": { "shape": { "type": "Point", "coordinates": [0, 0] } } } })