Skip to content

Commit dbc0332

Browse files
committed
Allow write for GeoInterface objects.
1 parent a3ad4b6 commit dbc0332

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/io.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ Write a GeoInterface.jl compatible feature or geometry to a GeoJSON `String`.
4343
write(io, obj::GeoJSONT) = JSON3.write(io, obj)
4444
write(obj::GeoJSONT) = JSON3.write(obj)
4545

46+
# GeoInterface supported objects
47+
write(io, obj) = JSON3.write(io, _lower(obj))
48+
write(obj) = JSON3.write(_lower(obj))
49+
4650
function _lower(obj)
4751
if GI.isfeaturecollection(obj)
4852
base = (type="FeatureCollection", features=_lower.(GI.getfeature(obj)))

0 commit comments

Comments
 (0)