[geos-commits] [SCM] GEOS branch main updated. c355bb2a766d60581d7fe8ecd7e0a3fe186cc48f

git at osgeo.org git at osgeo.org
Thu Sep 16 13:26:59 PDT 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main has been updated
       via  c355bb2a766d60581d7fe8ecd7e0a3fe186cc48f (commit)
      from  921f88d1e829f8114c2ff1ccd4fa7858960e880f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c355bb2a766d60581d7fe8ecd7e0a3fe186cc48f
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Thu Sep 16 13:26:55 2021 -0700

    Improve geosop function descriptions

diff --git a/util/geosop/GeomFunction.cpp b/util/geosop/GeomFunction.cpp
index aec9a49..d5984df 100644
--- a/util/geosop/GeomFunction.cpp
+++ b/util/geosop/GeomFunction.cpp
@@ -76,48 +76,52 @@ PreparedGeometryCache prepGeomCache;
 void
 GeomFunction::init()
 {
-    add("area",
+    add("area", Result::typeDouble,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->getArea() );
         });
-    add("boundary",
+    add("boundary", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->getBoundary() );
         });
-    add("buffer", "computes the buffer of geometry A to a distance", 1, 1,
+    add("buffer", 1, 1, Result::typeGeometry,
+        "computes the buffer of geometry by a distance",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB;  // prevent unused variable warning
             return new Result( geom->buffer( d ) );
         });
-    add("centroid",
+    add("centroid", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->getCentroid() );
         });
-    add("copy",
+    add("copy", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->clone() );
         });
-    add("convexHull",
+    add("convexHull", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->convexHull() );
         });
-    add("contains", "tests if geometry A contains geometry B", 2, 0,
+    add("contains", 2, 0, Result::typeBool,
+        "tests if geometry A contains geometry B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( geom->contains( geomB.get() ) );
         });
-    add("covers", "tests if geometry A covers geometry B", 2, 0,
+    add("covers", 2, 0, Result::typeBool,
+        "tests if geometry A covers geometry B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( geom->covers( geomB.get() ) );
         });
 
-    add("densify", "densifies geometry A to a distance ", 1, 1,
+    add("densify", 1, 1, Result::typeGeometry,
+        "densifies geometry to a distance ",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)geomB;  // prevent unused variable warning
             geos::geom::util::Densifier densifier( geom.get() );
@@ -125,49 +129,55 @@ GeomFunction::init()
             return new Result( densifier.getResultGeometry() );
         });
 
-    add("distance", "computes distance between geometry A and B", 2, 0,
+    add("distance", 2, 0, Result::typeDouble,
+        "computes distance between geometry A and B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( geom->distance( geomB.get() ) );
         });
 
-     add("envelope",
+     add("envelope", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->getCentroid() );
         });
 
-    add("interiorPoint",
+    add("interiorPoint", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->getInteriorPoint() );
         });
 
-    add("intersects", "tests if geometry A and B intersect", 2, 0,
+    add("intersects", 2, 0, Result::typeBool,
+        "tests if geometry A and B intersect",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( geom->intersects( geomB.get() ) );
         });
 
-    add("isEmpty", "tests if geometry A is empty", 1, 0,
+    add("isEmpty", 1, 0, Result::typeBool,
+        "tests if geometry is empty",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->isEmpty() );
         });
 
-    add("isSimple", "tests if geometry A is simple", 1, 0,
+    add("isSimple", 1, 0, Result::typeBool,
+        "tests if geometry is simple",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->isSimple() );
         });
 
-    add("isValid", "tests if geometry A is valid", 1, 0,
+    add("isValid", 1, 0, Result::typeBool,
+        "tests if geometry is valid",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->isValid() );
         });
 
-    add("largestEmptyCircle", "computes radius of largest empty circle of Geometry A up to a distance tolerance", 1, 1,
+    add("largestEmptyCircle", 1, 1, Result::typeGeometry,
+        "computes radius line of largest empty circle of geometry up to a distance tolerance",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             geos::algorithm::construct::LargestEmptyCircle lec( geom.get(), d );
@@ -175,26 +185,27 @@ GeomFunction::init()
             return new Result( std::move(res) );
         });
 
-    add("length",
+    add("length", Result::typeDouble,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->getLength() );
         });
 
-    add("makeValid",
+    add("makeValid", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geos::operation::valid::MakeValid().build( geom.get() ) );
         });
 
-    add("maxInscribedCircle", "computes maximum inscribed circle radius of Polygon A up to a distance tolerance", 1, 1,
+    add("maxInscribedCircle", 1, 1, Result::typeGeometry,
+        "computes maximum inscribed circle radius of Polygon up to a distance tolerance",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             geos::algorithm::construct::MaximumInscribedCircle mc( geom.get(), d );
             std::unique_ptr<Geometry> res = mc.getRadiusLine();
             return new Result( std::move(res) );
         });
-    add("minBoundingCircle",
+    add("minBoundingCircle", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             geos::algorithm::MinimumBoundingCircle mc( geom.get() );
@@ -202,7 +213,8 @@ GeomFunction::init()
             return new Result( std::move(res) );
         });
 
-    add("nearestPoints", "computes a line containing the nearest points of geometry A and B", 2, 0,
+    add("nearestPoints", 2, 0, Result::typeGeometry,
+        "computes a line containing the nearest points of geometry A and B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             std::unique_ptr<CoordinateSequence> cs = geos::operation::distance::DistanceOp::nearestPoints(geom.get(), geomB.get());
@@ -210,7 +222,8 @@ GeomFunction::init()
             auto res = factory->createLineString( std::move(cs) );
             return new Result( std::move(res) );
         });
-    add("normalize", "normalizes geometry A", 1, 0,
+    add("normalize", 1, 0, Result::typeGeometry,
+        "normalizes geometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             auto res = geom->clone();
@@ -218,7 +231,8 @@ GeomFunction::init()
             return new Result( std::move(res) );
         });
 
-    add("lineMerge", "merges the lines of geometry A", 1, 0,
+    add("lineMerge", 1, 0, Result::typeGeometry,
+        "merges the lines of geometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             geos::operation::linemerge::LineMerger lmrgr;
@@ -233,7 +247,8 @@ GeomFunction::init()
             return new Result( std::move(geoms) ) ;
         });
 
-    add("delaunay", "computes the Delaunay Triangulation of geometry A vertices", 1, 0,
+    add("delaunay", 1, 0, Result::typeGeometry,
+        "computes the Delaunay Triangulation of geometry vertices",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             geos::triangulate::DelaunayTriangulationBuilder builder;
@@ -249,7 +264,8 @@ GeomFunction::init()
             return new Result( std::move(geoms) ) ;
         });
 
-    add("voronoi", "computes the Voronoi Diagram of geometry A vertices", 1, 0,
+    add("voronoi", 1, 0, Result::typeGeometry,
+        "computes the Voronoi Diagram of geometry vertices",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             geos::triangulate::VoronoiDiagramBuilder builder;
@@ -265,7 +281,7 @@ GeomFunction::init()
             return new Result( std::move(geoms) ) ;
         });
 
-    add("polygonize",
+    add("polygonize", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             geos::operation::polygonize::Polygonizer p;
@@ -279,62 +295,73 @@ GeomFunction::init()
             return new Result( std::move(geoms) ) ;
         });
 
-    add("reducePrecision", "reduces precision of geometry to a precision scale factor", 1, 1,
+    add("reducePrecision", 1, 1, Result::typeGeometry,
+        "reduces precision of geometry to a precision scale factor",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)geomB;  // prevent unused variable warning
             PrecisionModel pm(d);
             return new Result( geos::precision::GeometryPrecisionReducer::reduce( *geom, pm ) );
         });
-    add("relate", "computes DE-9IM matrix for geometry A and B", 2, 0,
+    add("relate", 2, 0, Result::typeString,
+        "computes DE-9IM matrix for geometry A and B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             std::unique_ptr<geom::IntersectionMatrix> im(geom->relate( geomB.get() ));
             return new Result( im->toString() );
         });
-    add("reverse", "reverses geometry A", 1, 0,
+    add("reverse", 1, 0, Result::typeGeometry,
+        "reverses geometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void) geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->reverse() );
         });
-    add("simplifyDP", "simplifies geometry A using Douglas-Peucker with a distance tolerance", 1, 1,
+    add("simplifyDP", 1, 1, Result::typeGeometry,
+        "simplifies geometry using Douglas-Peucker with a distance tolerance",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)geomB;  // prevent unused variable warning
             return new Result( geos::simplify::DouglasPeuckerSimplifier::simplify(geom.get(), d) );
          });
-    add("simplifyTP", "simplifies geometry A using Douglas-Peucker with a distance tolerance, preserving topology", 1, 1,
+    add("simplifyTP", 1, 1, Result::typeGeometry,
+        "simplifies geometry using Douglas-Peucker with a distance tolerance, preserving topology",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)geomB;  // prevent unused variable warning
             return new Result( geos::simplify::TopologyPreservingSimplifier::simplify(geom.get(), d) );
          });
 
 
-    add("containsPrep", "tests if geometry A contains geometry B, using PreparedGeometry", 2, 0,
+    add("containsPrep", 2, 0, Result::typeBool,
+        "tests if geometry A contains geometry B, using PreparedGeometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( prepGeomCache.get(geom.get())->contains( geomB.get() ) );
         });
-    add("containsProperlyPrep", "tests if geometry A properly contains geometry B using PreparedGeometry", 2, 0,
+    add("containsProperlyPrep", 2, 0, Result::typeBool,
+        "tests if geometry A properly contains geometry B using PreparedGeometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( prepGeomCache.get(geom.get())->containsProperly( geomB.get() ) );
         });
-    add("coversPrep", "tests if geometry A covers geometry B using PreparedGeometry", 2, 0,
+    add("coversPrep", 2, 0, Result::typeBool,
+        "tests if geometry A covers geometry B using PreparedGeometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( prepGeomCache.get(geom.get())->covers( geomB.get() ) );
         });
-    add("intersectsPrep", "tests if geometry A intersects B using PreparedGeometry", 2, 0,
+    add("intersectsPrep", 2, 0, Result::typeBool,
+        "tests if geometry A intersects B using PreparedGeometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( prepGeomCache.get(geom.get())->intersects( geomB.get() ) );
         });
 
-    add("distancePrep", "computes distance between geometry A and B using PreparedGeometry", 2, 0,
+    add("distancePrep", 2, 0, Result::typeDouble,
+        "computes distance between geometry A and B using PreparedGeometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( prepGeomCache.get(geom.get())->distance( geomB.get() ) );
         });
-    add("nearestPointsPrep", "computes a line containing the nearest points of geometry A and B using PreparedGeometry", 2, 0,
+    add("nearestPointsPrep", 2, 0, Result::typeGeometry,
+        "computes a line containing the nearest points of geometry A and B using PreparedGeometry",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             auto cs = prepGeomCache.get(geom.get())->nearestPoints( geomB.get() );
@@ -345,54 +372,63 @@ GeomFunction::init()
 
 
 
-    add("difference", "computes difference of geometry A from B", 2, 0,
+    add("difference", 2, 0, Result::typeGeometry,
+        "computes difference of geometry A from B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( geom->difference( geomB.get() ) );
         });
-    add("intersection", "computes intersection of geometry A and B", 2, 0,
+    add("intersection", 2, 0, Result::typeGeometry,
+        "computes intersection of geometry A and B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( geom->intersection( geomB.get() ) );
         });
-    add("symDifference", "computes symmetric difference of geometry A and B", 2, 0,
+    add("symDifference", 2, 0, Result::typeGeometry,
+        "computes symmetric difference of geometry A and B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( geom->symDifference( geomB.get() ) );
         });
-    add("unaryUnion",
+    add("unaryUnion", Result::typeGeometry,
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)geomB; (void)d;  // prevent unused variable warning
             return new Result( geom->Union() );
         });
-    add("union", "computes union of geometry A and B", 2, 0,
+    add("union", 2, 0, Result::typeGeometry,
+        "computes union of geometry A and B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             return new Result( geom->Union( geomB.get() ) );
         });
 
-    add("differenceSR", "computes difference of geometry A from B, snap-rounding to a precision scale factor", 2, 1,
+    add("differenceSR", 2, 1, Result::typeGeometry,
+        "computes difference of geometry A from B, snap-rounding to a precision scale factor",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             geos::geom::PrecisionModel pm(d);
             return new Result( OverlayNG::overlay(geom.get(), geomB.get(), OverlayNG::DIFFERENCE, &pm) );
         });
-    add("intersectionSR", "computes intersection of geometry A and B, snap-rounding to a precision scale factor", 2, 1,
+    add("intersectionSR", 2, 1, Result::typeGeometry,
+        "computes intersection of geometry A and B, snap-rounding to a precision scale factor",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             geos::geom::PrecisionModel pm(d);
             return new Result( OverlayNG::overlay(geom.get(), geomB.get(), OverlayNG::INTERSECTION, &pm) );
         });
-    add("symDifferenceSR", "computes symmetric difference of geometry A and B, snap-rounding to a precision scale factor", 2, 1,
+    add("symDifferenceSR", 2, 1, Result::typeGeometry,
+        "computes symmetric difference of geometry A and B, snap-rounding to a precision scale factor",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             geos::geom::PrecisionModel pm(d);
             return new Result( OverlayNG::overlay(geom.get(), geomB.get(), OverlayNG::SYMDIFFERENCE, &pm) );
         });
-    add("unionSR", "computes union of geometry A and B, snap-rounding to a precision scale factor", 2, 1,
+    add("unionSR", 2, 1, Result::typeGeometry,
+        "computes union of geometry A and B, snap-rounding to a precision scale factor",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             geos::geom::PrecisionModel pm(d);
             return new Result( OverlayNG::overlay(geom.get(), geomB.get(), OverlayNG::UNION, &pm) );
         });
 
-    add("clipRect", "clips geometry A to envelope of B", 2, 0,
+    add("clipRect", 2, 0, Result::typeGeometry,
+        "clips geometry A to envelope of B",
         [](const std::unique_ptr<Geometry>& geom, const std::unique_ptr<Geometry>& geomB, double d)->Result* {
             (void)d;  // prevent unused variable warning
             using geos::operation::intersection::Rectangle;
@@ -415,19 +451,20 @@ GeomFunction::find(std::string name)
 
 /* static */
 void
-GeomFunction::add(std::string name, geomFunSig geomfun)
+GeomFunction::add(std::string name, int resultType, geomFunSig geomfun)
 {
-    add(name,
-        "computes " + name + " for geometry A",
-        1, 0, geomfun);
+    add(name, 1, 0, resultType,
+        "computes " + name + " of geometry",
+        geomfun);
 }
 
 /* static */
 void
 GeomFunction::add(std::string name,
-                    std::string desc,
                     int nGeomParam,
                     int nParam,
+                    int typeCode,
+                    std::string desc,
                     geomFunSig geomfun)
 {
     auto fun = new GeomFunction();
@@ -436,6 +473,7 @@ GeomFunction::add(std::string name,
     fun->geomfun = geomfun;
     fun->numGeomParam = nGeomParam;
     fun->numParam = nParam;
+    fun->resultType = typeCode;
 
     registry.insert( std::pair<std::string, GeomFunction *>(name, fun) );
 }
@@ -451,11 +489,13 @@ bool GeomFunction::isBinary()
 }
 
 std::string GeomFunction::signature() {
-    std::string sig = funName + " A";
-    if (isBinary()) {
-        sig += " B";
-    }
+    std::string sig =  " A";
+    sig += isBinary() ? " B" : "  ";
+    sig += "  ";
+    sig += funName;
     if (numParam > 0) sig += " N";
+    sig += " >";
+    sig += Result::code(resultType);
     return sig;
 }
 
@@ -583,3 +623,16 @@ Result::metadata() {
     }
     return "Unknonwn type";
 }
+
+std::string
+Result::code(int code) {
+    switch (code) {
+    case typeBool:    return "B";
+    case typeInt:     return "I";
+    case typeDouble:  return "D";
+    case typeString:  return "S";
+    case typeGeometry: return "G";
+    case typeGeomList: return "[G]";
+    }
+    return "U";
+}
diff --git a/util/geosop/GeomFunction.h b/util/geosop/GeomFunction.h
index 5d9938a..4e13783 100644
--- a/util/geosop/GeomFunction.h
+++ b/util/geosop/GeomFunction.h
@@ -44,12 +44,13 @@ public:
     Result(Geometry * val);
     ~Result();
 
+    static std::string code(int typeCode);
+
     bool isGeometry();
     bool isGeometryList();
     std::string metadata();
     std::string toString();
 
-private:
     enum {
         typeBool = 1, typeInt, typeDouble, typeString, typeGeometry, typeGeomList
     } typeCode;
@@ -73,11 +74,12 @@ public:
         const std::unique_ptr<Geometry>& geomB, double d );
 
 private:
-    static void add(std::string name, geomFunSig geomfun);
+    static void add(std::string name, int resultType, geomFunSig geomfun);
     static void add(std::string name,
-                    std::string desc,
                     int nGeom,
                     int nParam,
+                    int resultType,
+                    std::string desc,
                     geomFunSig geomfun);
 
     static std::map<std::string, GeomFunction*> registry;
@@ -93,6 +95,7 @@ private:
     int numGeomParam;  // number of *required* geometry parameters (0,1,2)
     int numParam;  // number of none-geometry parameters (0 or 1 currently)
     //TODO: add result type?
+    int resultType;
 
     geomFunSig geomfun;
 

-----------------------------------------------------------------------

Summary of changes:
 util/geosop/GeomFunction.cpp | 167 ++++++++++++++++++++++++++++---------------
 util/geosop/GeomFunction.h   |   9 ++-
 2 files changed, 116 insertions(+), 60 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list