Opened 4 years ago

Closed 4 years ago

#4687 closed enhancement (fixed)

Expose GEOS MaximumInscribedCircle

Reported by: pramsey Owned by: pramsey
Priority: high Milestone: PostGIS 3.1.0
Component: postgis Version: master
Keywords: Cc:

Description

Added to the CAPI here:

https://trac.osgeo.org/geos/changeset/0909042df5f8d4b9ae1832b3fd67713e206057fb/git

Allow inscribed circles for polygonal (contained) and nonpolygonal (bounded) inputs.

Change History (7)

comment:1 by Paul Ramsey <pramsey@…>, 4 years ago

In b5bd683/git:

Expose GEOS 3.9 ST_MaximumInscribedCircle, References #4687

comment:2 by Algunenano, 4 years ago

Hi, I've left a couple of comments in the PR. Also, this is breaking regress tests:

 geos39 .. failed (diff expected obtained: /tmp/pgis_reg/test_129_diff)
--- geos39_expected     2020-05-08 15:23:05.538587889 +0200
+++ /tmp/pgis_reg/test_129_out  2020-05-08 15:35:38.296144156 +0200
@@ -2,5 +2,5 @@
 mic-empty|POINT EMPTY|POINT EMPTY|0.0000
 mic-null|||
 mic-line|POINT(50 50)|POINT(50 0)|50.0000
-mic-mpoint|POINT(50 50)|POINT(0 0)|70.7107
+mic-mpoint|POINT(50 50)|POINT(100 0)|70.7107
 mic-point|POINT(0 0)|POINT(0 0)|0.0000

Same error in debbie: https://debbie.postgis.net/job/PostGIS_Regress/14401/console

13:34:21 -----------------------------------------------------------------------------
13:34:21 --- geos39_expected	2020-05-07 22:24:46.048294273 +0000
13:34:21 +++ /var/lib/jenkins/workspace/postgis/tmp/3_1_pg12w64/test_129_out	2020-05-08 13:34:21.752346491 +0000
13:34:21 @@ -2,5 +2,5 @@
13:34:21  mic-empty|POINT EMPTY|POINT EMPTY|0.0000
13:34:21  mic-null|||
13:34:21  mic-line|POINT(50 50)|POINT(50 0)|50.0000
13:34:21 -mic-mpoint|POINT(50 50)|POINT(0 0)|70.7107
13:34:21 +mic-mpoint|POINT(50 50)|POINT(100 0)|70.7107
13:34:21  mic-point|POINT(0 0)|POINT(0 0)|0.0000
13:34:21 -----------------------------------------------------------------------------

I'll update the latest travis image in case you want to fight against it directly. Keep in mind that raster are currently broken there (https://trac.osgeo.org/postgis/ticket/4673), but core regress tests should work ™

comment:3 by Algunenano, 4 years ago

Travis build broken by this changes: https://travis-ci.org/github/postgis/postgis/jobs/684674046#L945

lwgeom_geos.c: In function 'ST_MaximumInscribedCircle':
lwgeom_geos.c:395:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  395 |   double width = gbox.xmax - gbox.xmin;
      |   ^~~~~~
lwgeom_geos.c:404:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  404 |   int gtype = gserialized_get_type(geom);
      |   ^~~
lwgeom_geos.c:426:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  426 |   GEOSGeometry *gcenter = GEOSGeomGetStartPoint(g2);
      |   ^~~~~~~~~~~~

It should be available in PRs now (but it's marked as allowed to fail).

comment:4 by pramsey, 4 years ago

Why are C90 errors breaking the build? We finally approved C99 some time ago…

comment:5 by Algunenano, 4 years ago

That files gets cflags from Postgresql, so I guess something is modified there in that build.

comment:6 by Paul Ramsey <pramsey@…>, 4 years ago

In 5cea21d/git:

move declarations to top of block (c90), references #4687

comment:7 by pramsey, 4 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.