@@ -490,6 +490,30 @@ function createEmptyCollection(geomtype::GEOSGeomTypes, context::GEOSContext = g
490490 result
491491end
492492
493+ function createEmptyPolygon (context:: GEOSContext = get_global_context ()):: Polygon
494+ result = GEOSGeom_createEmptyPolygon_r (context)
495+ if result == C_NULL
496+ error (" LibGEOS: Error in GEOSGeom_createEmptyPolygon" )
497+ end
498+ Polygon (result, context)
499+ end
500+
501+ function reverse (obj:: Geometry , context:: GEOSContext = get_context (obj)):: LibGEOS.AbstractGeometry
502+ result = GEOSReverse_r (context, obj)
503+ if result == C_NULL
504+ error (" LibGEOS: Error in GEOSReverse_r" )
505+ end
506+ geomFromGEOS (result, context)
507+ end
508+
509+ function makeValid (obj:: Geometry , context:: GEOSContext = get_context (obj)):: LibGEOS.AbstractGeometry
510+ result = GEOSMakeValid_r (context, obj)
511+ if result == C_NULL
512+ error (" LibGEOS: Error in GEOSMakeValid_r" )
513+ end
514+ geomFromGEOS (result, context)
515+ end
516+
493517# Memory management
494518# cloneGeom result needs to be wrapped in Geometry type
495519function cloneGeom (ptr:: Union{Geometry,GEOSGeom} , context:: GEOSContext = get_global_context ())
@@ -639,12 +663,12 @@ end
639663# GEOSPolygonizer_getCutEdges
640664# GEOSPolygonize_full
641665
642- function lineMerge (obj:: Geometry , context:: GEOSContext = get_context (obj))
666+ function lineMerge (obj:: Geometry , context:: GEOSContext = get_context (obj)):: MultiLineString
643667 result = GEOSLineMerge_r (context, obj)
644668 if result == C_NULL
645669 error (" LibGEOS: Error in GEOSLineMerge" )
646670 end
647- LineString (result, context)
671+ MultiLineString (result, context)
648672end
649673
650674function simplify (obj:: Geometry , tol:: Real , context:: GEOSContext = get_context (obj))
0 commit comments