[postgis-tickets] [PostGIS] #2951: ST_Centroid for geography

PostGIS trac at osgeo.org
Sat Jul 29 14:39:19 PDT 2017


#2951: ST_Centroid for geography
--------------------------+---------------------------
  Reporter:  Mike Toews   |      Owner:  robe
      Type:  enhancement  |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS 2.4.0
 Component:  liblwgeom    |    Version:
Resolution:               |   Keywords:
--------------------------+---------------------------

Comment (by robe):

 Sorry the example for docs you followed sadly doesn't conform to the
 template.xml spec.  I'll have to fix those.

 Can you change so it is picked up by our what's new xsl script


 {{{
 New in 2.4.0
 }}}

 to
 {{{
 Availability: 2.4.0
 }}}


 More importantly doesn't compile for me - get these errors.

 {{{
 MING64~1/projects/POSTGR~1/rel/PG10W6~2/include/internal
 -I./src/include/port/win32 -DEXEC_BACKEND -I/projects/libxml/rel-
 libxml2-2.7.8w64gcc48/include/libxml2
 -IC:/MING64~1/projects/POSTGR~1/rel/PG10W6~2/include/server/port/win32  -c
 -o geography_centroid.o geography_centroid.c
 geography_centroid.c:1:0: warning: -fPIC ignored for target (all code is
 position independent) [enabled by default]
  /**********************************************************************
  ^
 geography_centroid.c: In function 'geography_centroid':
 geography_centroid.c:109:9: error: 'for' loop initial declarations are
 only allowed in C99 mode
          for (int i = 0; i < size; i++) {
          ^
 geography_centroid.c:109:9: note: use option -std=c99 or -std=gnu99 to
 compile your code
 geography_centroid.c: In function 'geography_centroid_from_wpoints':
 geography_centroid.c:187:5: error: 'for' loop initial declarations are
 only allowed in C99 mode
      for (int i = 0; i < size; i++ )
      ^
 geography_centroid.c: In function 'geography_centroid_from_mline':
 geography_centroid.c:254:5: error: 'for' loop initial declarations are
 only allowed in C99 mode
      for (int i = 0; i < mline->ngeoms; i++) {
      ^
 geography_centroid.c:261:14: error: redefinition of 'i'
      for (int i = 0; i < mline->ngeoms; i++) {
               ^
 geography_centroid.c:254:14: note: previous definition of 'i' was here
      for (int i = 0; i < mline->ngeoms; i++) {
               ^
 geography_centroid.c:261:5: error: 'for' loop initial declarations are
 only allowed in C99 mode
      for (int i = 0; i < mline->ngeoms; i++) {
      ^
 geography_centroid.c:265:9: error: 'for' loop initial declarations are
 only allowed in C99 mode
          for (int i = 0; i < line->points->npoints - 1; i++) {
          ^
 geography_centroid.c: In function 'geography_centroid_from_mpoly':
 geography_centroid.c:306:5: error: 'for' loop initial declarations are
 only allowed in C99 mode
      for (int i = 0; i < mpoly->ngeoms; i++) {
      ^
 geography_centroid.c:318:5: error: 'for' loop initial declarations are
 only allowed in C99 mode
      for (int ip = 0; ip < mpoly->ngeoms; ip++) {
      ^
 geography_centroid.c:321:9: error: 'for' loop initial declarations are
 only allowed in C99 mode
          for (int ir = 0; ir < poly->nrings; ir++) {
          ^
 geography_centroid.c:325:13: error: 'for' loop initial declarations are
 only allowed in C99 mode
              for (int i = 0; i < ring->npoints - 1; i++) {
              ^
 <builtin>: recipe for target 'geography_centroid.o' failed
 make[1]: *** [geography_centroid.o] Error 1
 make[1]: Leaving directory '/projects/postgis/branches/2.4/postgis'
 GNUmakefile:16: recipe for target 'all' failed
 }}}

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/2951#comment:6>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list