@@ -211,9 +211,7 @@ function unsafe_forceto(
211211 targettype:: OGRwkbGeometryType ,
212212 options = StringList (C_NULL ),
213213):: Geometry
214- return Geometry (
215- GDAL. ogr_g_forceto (unsafe_clone (geom), targettype, options),
216- )
214+ return Geometry (GDAL. ogr_g_forceto (unsafe_clone (geom), targettype, options))
217215end
218216
219217"""
@@ -1644,13 +1642,8 @@ function polygonfromedges(
16441642 autoclose:: Bool = false ,
16451643):: IGeometry
16461644 perr = Ref {GDAL.OGRErr} ()
1647- result = GDAL. ogrbuildpolygonfromedges (
1648- lines,
1649- besteffort,
1650- autoclose,
1651- tol,
1652- perr,
1653- )
1645+ result =
1646+ GDAL. ogrbuildpolygonfromedges (lines, besteffort, autoclose, tol, perr)
16541647 @ogrerr perr[] " Failed to build polygon from edges."
16551648 return IGeometry (result)
16561649end
@@ -1662,13 +1655,8 @@ function unsafe_polygonfromedges(
16621655 autoclose:: Bool = false ,
16631656):: Geometry
16641657 perr = Ref {GDAL.OGRErr} ()
1665- result = GDAL. ogrbuildpolygonfromedges (
1666- lines,
1667- besteffort,
1668- autoclose,
1669- tol,
1670- perr,
1671- )
1658+ result =
1659+ GDAL. ogrbuildpolygonfromedges (lines, besteffort, autoclose, tol, perr)
16721660 @ogrerr perr[] " Failed to build polygon from edges."
16731661 return Geometry (result)
16741662end
@@ -1730,62 +1718,62 @@ for (geom, wkbgeom) in (
17301718end
17311719
17321720let V = Vector{<: Real }
1733- for (args, typedargs, typesuffix) in (
1721+ for (args, typedargs, typesuffix) in (
17341722 ((:xs , :ys ), (:(xs:: $V ), :(ys:: $V )), " " ), # geomargs2d
17351723 ((:xs , :ys , :zs ), (:(xs:: $V ), :(ys:: $V ), :(zs:: $V )), " 25D" ), # geomargs3d
17361724 )
1737- T = Symbol (" wkbLineString" * typesuffix)
1738- @eval function createlinearring ($ (typedargs... ))
1739- return createlinestring (Val {wkbLinearRing} ()) do geom
1740- for pt in zip ($ (args... ))
1741- addpoint! (geom, pt... )
1742- end
1743- # rewrap LinearRing as the corrent LineString/LineString25D
1744- IGeometry {$T} (GDAL. ogr_g_clone (geom))
1745- end
1746- end
1747- @eval function unsafe_createlinearring ($ (typedargs... ))
1748- return createlinestring (Val {wkbLinearRing} ()) do geom
1749- for pt in zip ($ (args... ))
1750- addpoint! (geom, pt... )
1751- end
1752- # rewrap LinearRing as the corrent LineString/LineString25D
1753- Geometry {$T} (GDAL. ogr_g_clone (geom))
1754- end
1755- end
1756- for f in (:create , :unsafe_create )
1757- f1 = Symbol (" $(f) linestring" )
17581725 T = Symbol (" wkbLineString" * typesuffix)
1759- @eval function $f1 ($ (typedargs... ))
1760- geom = $ f1 (Val {$T} ())
1761- for pt in zip ($ (args... ))
1762- addpoint! (geom, pt... )
1726+ @eval function createlinearring ($ (typedargs... ))
1727+ return createlinestring (Val {wkbLinearRing} ()) do geom
1728+ for pt in zip ($ (args... ))
1729+ addpoint! (geom, pt... )
1730+ end
1731+ # rewrap LinearRing as the corrent LineString/LineString25D
1732+ return IGeometry {$T} (GDAL. ogr_g_clone (geom))
17631733 end
1764- return geom
17651734 end
1766- f1 = Symbol ( " $(f) polygon " )
1767- T = Symbol ( " wkbPolygon " * typesuffix)
1768- @eval function $f1 ($ (typedargs ... ))
1769- geom = $ f1 ( Val {$T} () )
1770- subgeom = unsafe_createlinearring ( $ (args ... ))
1771- result = GDAL . ogr_g_addgeometrydirectly (geom, subgeom)
1772- @ogrerr result " Failed to add linearring. "
1773- return geom
1735+ @eval function unsafe_createlinearring ( $ (typedargs ... ) )
1736+ return createlinestring ( Val {wkbLinearRing} ()) do geom
1737+ for pt in zip ($ (args ... ))
1738+ addpoint! (geom, pt ... )
1739+ end
1740+ # rewrap LinearRing as the corrent LineString/LineString25D
1741+ return Geometry {$T} (GDAL . ogr_g_clone (geom))
1742+ end
17741743 end
1775- f1 = Symbol (" $(f) multipoint" )
1776- T = Symbol (" wkbMultiPoint" * typesuffix)
1777- @eval function $f1 ($ (typedargs... ))
1778- geom = $ f1 (Val {$T} ())
1779- for pt in zip ($ (args... ))
1780- subgeom = unsafe_createpoint (pt)
1744+ for f in (:create , :unsafe_create )
1745+ f1 = Symbol (" $(f) linestring" )
1746+ T = Symbol (" wkbLineString" * typesuffix)
1747+ @eval function $f1 ($ (typedargs... ))
1748+ geom = $ f1 (Val {$T} ())
1749+ for pt in zip ($ (args... ))
1750+ addpoint! (geom, pt... )
1751+ end
1752+ return geom
1753+ end
1754+ f1 = Symbol (" $(f) polygon" )
1755+ T = Symbol (" wkbPolygon" * typesuffix)
1756+ @eval function $f1 ($ (typedargs... ))
1757+ geom = $ f1 (Val {$T} ())
1758+ subgeom = unsafe_createlinearring ($ (args... ))
17811759 result = GDAL. ogr_g_addgeometrydirectly (geom, subgeom)
1782- @ogrerr result " Failed to add point."
1760+ @ogrerr result " Failed to add linearring."
1761+ return geom
1762+ end
1763+ f1 = Symbol (" $(f) multipoint" )
1764+ T = Symbol (" wkbMultiPoint" * typesuffix)
1765+ @eval function $f1 ($ (typedargs... ))
1766+ geom = $ f1 (Val {$T} ())
1767+ for pt in zip ($ (args... ))
1768+ subgeom = unsafe_createpoint (pt)
1769+ result = GDAL. ogr_g_addgeometrydirectly (geom, subgeom)
1770+ @ogrerr result " Failed to add point."
1771+ end
1772+ return geom
17831773 end
1784- return geom
17851774 end
17861775 end
17871776end
1788- end
17891777
17901778for f in (:create , :unsafe_create )
17911779 f1 = Symbol (" $(f) point" )
0 commit comments