Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some GEOSPolygonize variant methods' argument/return 'string' types are wrong #24

Open
sanak opened this issue Oct 14, 2023 · 1 comment · May be fixed by #29
Open

Some GEOSPolygonize variant methods' argument/return 'string' types are wrong #24

sanak opened this issue Oct 14, 2023 · 1 comment · May be fixed by #29
Labels
bug Something isn't working

Comments

@sanak
Copy link
Contributor

sanak commented Oct 14, 2023

GEOSPolygonize_valid and GEOSPolygonizer_getCutEdges methods' argument/return string types need to be number like GEOSPolygonize, from geos CAPI definition (https://github.com/libgeos/geos/blob/3.12.0/capi/geos_c.h.in#L4338-L4371), I think.

--- a/src/allCFunctions.mjs
+++ b/src/allCFunctions.mjs
@@ -2152,21 +2152,21 @@ export function initCFunctions (config = {}) {
  * and will report them as errors.
  *
  * @param {number} handle - A pointer to the GEOS context handle.
- * @param {string} geoms - An array of valid Geometrys containing the linework to polygonize.
+ * @param {number} geoms - An array of valid Geometrys containing the linework to polygonize.
  * @param {number} ngeoms - The number of valid Geometrys in the array.
- * @returns {string} A GeometryCollection containing the polygons formed by the polygonization.
+ * @returns {number} A GeometryCollection containing the polygons formed by the polygonization.
  * @alias module:geos
   */
-  geos.GEOSPolygonize_valid_r = Module.cwrap('GEOSPolygonize_valid_r', 'string', ['number', 'string', 'number'])
+  geos.GEOSPolygonize_valid_r = Module.cwrap('GEOSPolygonize_valid_r', 'number', ['number', 'number', 'number'])
 
   /**
  * Gets the list of line segments forming the boundary between
  * inside and outside portions of a set of Geometrys which contain linework that
  * represents the edges of a planar graph.
  *
- * @param {string} geoms - An array of Geometrys containing the linework to process.
+ * @param {number} geoms - An array of Geometrys containing the linework to process.
  * @param {number} ngeoms - The number of Geometrys in the array.
- * @returns {string} A MultiLineString containing the boundary segments.
+ * @returns {number} A MultiLineString containing the boundary segments.
  * @alias module:geos
   */
   geos.GEOSPolygonizer_getCutEdges = null
@@ -2177,12 +2177,12 @@ export function initCFunctions (config = {}) {
  * represents the edges of a planar graph, using a GEOS context handle.
  *
  * @param {number} handle - A pointer to the GEOS context handle.
- * @param {string} geoms - An array of Geometrys containing the linework to process.
+ * @param {number} geoms - An array of Geometrys containing the linework to process.
  * @param {number} ngeoms - The number of Geometrys in the array.
- * @returns {string} A MultiLineString containing the boundary segments.
+ * @returns {number} A MultiLineString containing the boundary segments.
  * @alias module:geos
   */
-  geos.GEOSPolygonizer_getCutEdges_r = Module.cwrap('GEOSPolygonizer_getCutEdges_r', 'string', ['number', 'string', 'number'])
+  geos.GEOSPolygonizer_getCutEdges_r = Module.cwrap('GEOSPolygonizer_getCutEdges_r', 'number', ['number', 'number', 'number'])
@chrispahm
Copy link
Owner

Great find, just like #25. Again, since it seems you already fixed the issues locally, would you be willing to issue a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants