<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>RE: [geos-devel] Minimum Bounding Circle</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

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

</BODY>
</HTML>