[postgis-tickets] [PostGIS] #2996: ST_MinimumBoundingCircle doesn't always contain all points

PostGIS trac at osgeo.org
Sun Jul 19 17:49:10 PDT 2015


#2996: ST_MinimumBoundingCircle doesn't always contain all points
---------------------------+--------------------------------------
  Reporter:  captainigloo  |      Owner:  robe
      Type:  defect        |     Status:  new
  Priority:  medium        |  Milestone:  PostGIS 2.3.0
 Component:  postgis       |    Version:  2.1.x
Resolution:                |   Keywords:  ST_MinimumBoundingCircle
---------------------------+--------------------------------------

Comment (by mwtoews):

 Looking at the PL/pgSQL source, it does not correctly determine the
 diameter from a brute force distance approach
 ([https://github.com/postgis/postgis/blob/713f387f84ae40b6ee96f5db6d7577ddcb93c692/postgis/postgis.sql.in#L5348-5364
 in the top half]), and in general the algorithm is different than in JTS'
 [http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/algorithm/MinimumBoundingCircle.html
 MinimumBoundingCircle class], which returns a polygon that mostly contains
 all the input points. (Note that a buffered point does not always contain
 the boundary of a circle, so the topic of this bug report will generally
 be true.)

 Further note the reported ticket has an invalid geometry, but a similar
 valid geometry has the same result:
  * blue `POLYGON ((26426 65078, 26531 65242, 26096 65427, 26075 65136,
 26426 65078))`
  * red `SELECT ST_MinimumBoundingCircle(blue, 8);`
  * yellow is JTS' !MinimumBoundingCircle result with blue.

 [[Image(http://i.imgur.com/KPQHbbN.png)]]

 See also a GEOS enhancement to port the ​functionality from JTS:
 https://trac.osgeo.org/geos/ticket/735

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