<div dir="ltr"><div><div><div><div>Hey,<br></div>I looked into it a few month ago.<br></div>Here is a working solution in plpgsql, designed to be fast to code (and slow to execute :-/)<br></div><div><a href="https://github.com/Remi-C/PPPP_utilities/blob/6e9e8524812961b013b899466fe833dfa5d926e9/postgis/rc_oriented_bbox_deom_axis.sql">https://github.com/Remi-C/PPPP_utilities/blob/6e9e8524812961b013b899466fe833dfa5d926e9/postgis/rc_oriented_bbox_deom_axis.sql</a><br></div><br></div>Depending on your need, it may suffice.<br><div><br>Cheers,<br>Rémi-C<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-09 10:01 GMT+01:00 Stefan Keller <span dir="ltr"><<a href="mailto:sfkeller@gmail.com" target="_blank">sfkeller@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hallo Niklas<br>
<br>
It's really the Oriented Bounding Box (OBB) I'm after.<br>
I'd like to label e.g. buildings or lakes alongside their longest extension.<br>
<span class="HOEnZb"><font color="#888888"><br>
-S.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
2015-02-08 22:12 GMT+01:00 Nicklas Avén <<a href="mailto:nicklas.aven@jordogskog.no">nicklas.aven@jordogskog.no</a>>:<br>
> Hallo Stefan<br>
><br>
> Isn't MinimumBOundingCircle usable?<br>
> <a href="http://postgis.net/docs/manual-dev/ST_MinimumBoundingCircle.html" target="_blank">http://postgis.net/docs/manual-dev/ST_MinimumBoundingCircle.html</a><br>
> I guess that comes from the same function in Geos.<br>
><br>
> From that you can get the diameter by just use<br>
> ST_XMax(circle)-ST_XMin(circle)<br>
><br>
> Or do I misunderstand?<br>
><br>
> /Nicklas<br>
><br>
><br>
> On Sun, 2015-02-08 at 20:44 +0100, Stefan Keller wrote:<br>
>> Hi Regina and Paul<br>
>><br>
>> I'd like to use function ST_MinimumDiameter() in PostGIS which<br>
>> obviously is not yet ported from GEOS.<br>
>> Are there potentially other nice functions like this, which could be<br>
>> made available in PostGIS?<br>
>> Should I try to make a list?<br>
>><br>
>> Yours, S.<br>
>><br>
>> 2015-02-06 21:34 GMT+01:00 Stefan Keller <<a href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>>:<br>
>> > Hi,<br>
>> ><br>
>> > While asking about how to calculate the Oriented Bounding Box (OBB) of<br>
>> > a polygon or point set [1] I realized that there exists a function<br>
>> > MinimumDiameter() in GEOS [2].<br>
>> > Now, I'm wondering how to integrate this into PostGIS.<br>
>> > Unfortunately I'm not a C programmer and i don't how to the process<br>
>> > goes for new features in PostGIS.<br>
>> > Can somebody help?<br>
>> ><br>
>> > Yours, S.<br>
>> ><br>
>> > [1] <a href="http://gis.stackexchange.com/questions/133327/how-to-calculate-the-oriented-bounding-box-obb-of-a-polygon-or-point-set" target="_blank">http://gis.stackexchange.com/questions/133327/how-to-calculate-the-oriented-bounding-box-obb-of-a-polygon-or-point-set</a><br>
>> > [2] <a href="http://geos.refractions.net/ro/doxygen_docs/html/classgeos_1_1algorithm_1_1MinimumDiameter.html" target="_blank">http://geos.refractions.net/ro/doxygen_docs/html/classgeos_1_1algorithm_1_1MinimumDiameter.html</a><br>
>> _______________________________________________<br>
>> postgis-devel mailing list<br>
>> <a href="mailto:postgis-devel@lists.osgeo.org">postgis-devel@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> postgis-devel mailing list<br>
> <a href="mailto:postgis-devel@lists.osgeo.org">postgis-devel@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel</a><br>
_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org">postgis-devel@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel</a></div></div></blockquote></div><br></div>