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

PostGIS trac at osgeo.org
Sun Mar 13 23:11:01 PDT 2016


#2951: ST_Centroid for geography
--------------------------+----------------------------
  Reporter:  mwtoews      |      Owner:  pramsey
      Type:  enhancement  |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS Future
 Component:  liblwgeom    |    Version:
Resolution:               |   Keywords:
--------------------------+----------------------------

Comment (by mwtoews):

 I have an idea for this:

  1. Get the bounding box for the geography
  2. Make an initial guess of the centroid using the 1/2 distance along one
 of the diagonal lines from the bbox
  3. Project the data to a dynamic equal-area projection that is centred at
 the centroid guess
  4. Calculate the Cartesian centroid of the projected geometry
  5. Compare the distance between the distance estimated in 2. and 4., and
 if greater then a convergence criterion, then repeat from 3. using a new
 estimate

 A few issues with this approach would be that I'm not sure exactly which
 projection would be best; `+proj=laea`? The iterative process would build
 projection strings for PROJ, which will need to be robust. Furthermore,
 I'm not sure how the convergence criteria would work, or how many
 projections would be required, as this could get expensive.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/2951#comment:3>
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