[geos-devel] Minimum Bounding Circle

Bruce Rindahl rindahl at lrcwe.com
Tue Jan 13 15:14:52 EST 2009


OK I can kill this thread...
This issue came up when a request to generate the MINIMUM Bounding 
Circle of a geometry.  To generate this you need the MAXIMUM diameter of 
a geometry as a start.  Note the opposite operations.  The bottom line 
is there is no MaximumDiameter function in GEOS (or probably JTS).  If 
the MinimumDiameter function is need that could be exposed but I don't 
need it.
As for my other comment that the algorithm may fail, that appears to be 
wrong since I was confused by the maximum/minimum issue.  It looks fine 
for what it is doing.
Sorry for all the traffic.

Bruce Rindahl

Obe, Regina wrote:
>
> I'm probably not the best person to answer this but based on my 
> understanding.
>
> I think you -
> 1) Expose it in GEOS --  capi/geos_c.cpp, .h
> 2) Then on the PostGIS side create a function in lwgeom/lwgeom_geos.* that
> calls the CAPI function.
>
> Hope that helps,
> Regina
> -----Original Message-----
> From: geos-devel-bounces at lists.osgeo.org on behalf of Bruce Rindahl
> Sent: Tue 1/13/2009 1:21 PM
> To: rindahl at lrcwe.com; GEOS Development List
> Cc: Lee Meilleur
> Subject: Re: [geos-devel] Minimum Bounding Circle
>
> I am interested in exploring this issue further.  I believe the the
> computation of a minimum bounding circle is a requirement in evaluating
> congressional districts (Lee- Reference??).  If so then to have this
> function available to a program like PostGIS would be a plus.  I would
> like to test this module but need some help.  How do I  expose the
> module so it is available in PostGIS?
>
> Bruce
>
> Bruce Rindahl wrote:
> > I just looked at MinimumDiameter.cpp and the code does the same thing
> > as the first part of my code linked by Regina.  This would be nice to
> > have except for one thing - it may not work.  It calls
> > distancePerpendicular which I couldn't find.  If this finds the point
> > furthest from the /extended/ line segment and uses this to compute the
> > diameter it is the same method as I used - rotate the geometry so the
> > segment is horizontal and compute the bounding box.  I can provide you
> > with a geometry where this algorithm fails.  Lee Meilleur can also
> > provide a counter example.  Because of this I changed my code to test
> > every point pair for the Minimum Diameter.
> > Bruce Rindahl
> >
> > Martin Davis wrote:
> >> Yes, this is computing the same thing as the Minimum Bounding Circle
> >> algorithm.  This algorithm appeared in JTS for some reason which is
> >> lost in the mists of time.  AFAIK it's never really been used or
> >> tested extensively.
> >> It probably postdated the initial port of GEOS, and I guess nobody
> >> went looking for it until now...
> >>
> >> Obe, Regina wrote:
> >>>
> >>> I was snooping around the GEOS library and noticed a curious
> >>> algorithm class
> >>> called MinimumDiameter.  As far as I can tell from scanning the code,
> >>> it seems similar in concept to the the Minimum Bounding Circle
> >>> plpgsql algorithm that
> >>> Bruce posted in November
> >>>
> >>> 
> http://postgis.refractions.net/pipermail/postgis-users/2008-October/021734.html
> >>>
> >>>
> >>> Just wondering why this is not exposed in the CAPI interface or does
> >>> it server an entirely different purpose from what I am thinking.
> >>>
> >>> Thanks,
> >>> Regina
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> 
> ------------------------------------------------------------------------
> >>>
> >>>
> >>> *The substance of this message, including any attachments, may be
> >>> confidential, legally privileged and/or exempt from disclosure
> >>> pursuant to Massachusetts law. It is intended solely for the
> >>> addressee. If you received this in error, please contact the sender
> >>> and delete the material from any computer. *
> >>>
> >>> 
> ------------------------------------------------------------------------
> >>>
> >>>
> >>> * Help make the earth a greener place. If at all possible resist
> >>> printing this email and join us in saving paper. *
> >>>
> >>> * *
> >>>
> >>> * *
> >>>
> >>> 
> ------------------------------------------------------------------------
> >>>
> >>>
> >>> _______________________________________________
> >>> geos-devel mailing list
> >>> geos-devel at lists.osgeo.org
> >>> http://lists.osgeo.org/mailman/listinfo/geos-devel
> >>
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > geos-devel mailing list
> > geos-devel at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/geos-devel
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geos-devel/attachments/20090113/cc8b18df/attachment-0001.html


More information about the geos-devel mailing list