GEOS is written in C++,  but it&#39;s API is also exposed as C. Truth is that only the C-API should be used, because it&#39;s meant to be a stable &quot;proxy&quot; to the underlying C++ code.<div>Shapely, like GeoDjango, uses ctypes with the C-API. Being MinimuDiameter not exposed through it, it isn&#39;t available to them (nor to OGR, I suppose).</div>
<div><br></div><div>Impleneting it in Python should be easy, but performance can fall order og magnitudes for complex geoms. Maybe you could obtain the convex hull from GEOS and the do the rest in Python.</div><div><br></div>
<div>giovanni<br><br><div class="gmail_quote">2012/2/21 Alessandro Candini <span dir="ltr">&lt;<a href="mailto:candini@meeo.it">candini@meeo.it</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 02/20/2012 05:58 PM, Sandro Santilli wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Feb 20, 2012 at 05:05:23PM +0100, Alessandro Candini wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi.<br>
I have compiled geos-3.3.2 with python bindings enabled.<br>
So I get the following python files:<br>
<br>
geos.py<br>
tests/runtests.py<br>
tests/example.py<br>
tests/test_geometry.py<br>
<br>
But in them I cannot find the MinimumDiameter object and its methods.<br>
Is it missing? If I would use it through python, have I to implement<br>
it from scratch?<br>
</blockquote>
Did you read the README.txt ? It tells you that the GEOS python<br>
bindings  are unsupported and suggests you to become a maintainer<br>
or to use Shapely. I think the majority of people did switch to Shapely.<br>
<br>
Still, the MinimumDiameter is missing from the C-API, although present<br>
at the C++ level, so first step would be to expose it there.<br>
<br>
--strk;<br>
______________________________<u></u>_________________<br>
geos-devel mailing list<br>
<a href="mailto:geos-devel@lists.osgeo.org" target="_blank">geos-devel@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/geos-devel</a><br>
</blockquote>
<br>
Sorry I didn&#39;t read the readme file, my fault.<br>
I use this API: <a href="https://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/" target="_blank">https://docs.djangoproject.<u></u>com/en/dev/ref/contrib/gis/<u></u>geos/</a> , created using ctypes starting from file /usr/lib/libgeos_c.so.1.<br>

But as you say there is not a MinimumDiameter binding.<br>
With nm tool (I&#39;m on Ubuntu Linux) I&#39;ve searched for an entry point into the shared library file, but it is missing.<br>
It seems to miss in Shapely too (<a href="http://toblerity.github.com/shapely/manual.html" target="_blank">http://toblerity.github.com/<u></u>shapely/manual.html</a>).<br>
What do you mean to expose MinimumDIameter at C-API level?<br>
Is not easier for my specific case to reimplement MinimumDiameter in Python using GeoDjango and Shapely functions?<br>
<br>
<br>
______________________________<u></u>_________________<br>
geos-devel mailing list<br>
<a href="mailto:geos-devel@lists.osgeo.org" target="_blank">geos-devel@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/geos-devel" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/geos-devel</a><br>
</blockquote></div><br></div>