Skip to content

Commit 68d96b8

Browse files
committed
test for writing with lower
1 parent 284e049 commit 68d96b8

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/io.jl

-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ _lower(t::GI.AbstractMultiPointTrait, d, obj) =
8181
(type="MultiPoint", coordinates=_to_vector_ntuple(t, d, obj))
8282
_lower(t::GI.AbstractMultiLineStringTrait, d, obj) =
8383
(type="MultiLineString", coordinates=_to_vector_ntuple(t, d, obj))
84-
_lower(t::GI.AbstractPolygonTrait, d, obj) =
85-
(type="Polygon", coordinates=_to_vector_ntuple(t, d, obj))
8684
_lower(t::GI.AbstractMultiPolygonTrait, d, obj) =
8785
(type="MultiPolygon", coordinates=_to_vector_ntuple(t, d, obj))
8886
_lower(t::GI.AbstractGeometryCollectionTrait, d, obj) =

test/geojson_samples.jl

-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ null_prop_feat = """{"geometry": null, "id": 12, "properties": null, "type": "Fe
437437

438438
features = [a, b, c, d, e, f, h]
439439

440-
441440
## Geometry
442441

443442
# Examples from https://datatracker.ietf.org/doc/html/rfc7946#section-1.3

test/runtests.jl

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using GeoJSON
22
import GeoInterface as GI
33
import GeoFormatTypes
44
import Aqua
5+
import JSON3
56
using Extents
67
using JSON3
78
using Tables
@@ -152,6 +153,15 @@ include("geojson_samples.jl")
152153
@test GI.extent(f) == GI.extent(f1)
153154
end
154155

156+
# Writing using _lower
157+
foreach(Samples.features) do json
158+
f = GeoJSON.read(json)
159+
f1 = GeoJSON.read(JSON3.write(GeoJSON._lower(f)))
160+
@test GeoJSON.geometry(f) == GeoJSON.geometry(f1)
161+
@test GeoJSON.properties(f) == GeoJSON.properties(f1)
162+
@test GI.extent(f) == GI.extent(f1)
163+
end
164+
155165
foreach(Samples.featurecollections) do json
156166
fc = GeoJSON.read(json)
157167
f1c = GeoJSON.read(GeoJSON.write(fc))

0 commit comments

Comments
 (0)