Skip to content

Commit 7af21e4

Browse files
committed
Add asbinary and astext (wkb and wkt) methods.
1 parent 49a4d11 commit 7af21e4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/interface.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,3 +469,17 @@ Convert `geom` into the `CustomGeom` type if both geom as the CustomGeom package
469469
have implemented GeoInterface.
470470
"""
471471
convert(T, geom) = convert(T, geomtype(geom), geom)
472+
473+
"""
474+
astext(geom) -> WKT
475+
476+
Convert `geom` into Well Known Text (WKT) representation, such as `POINT (30 10)`.
477+
"""
478+
astext(geom) = astext(geomtype(geom), geom)
479+
480+
"""
481+
asbinary(geom) -> WKB
482+
483+
Convert `geom` into Well Known Binary (WKB) representation, such as `000000000140000000000000004010000000000000`.
484+
"""
485+
asbinary(geom) = asbinary(geomtype(geom), geom)

0 commit comments

Comments
 (0)