ST_OrientedEnvelope returning parallelogram

Erik Wienhold ewie at ewie.name
Fri Mar 8 12:32:43 PST 2024


On 2024-03-08 20:36 +0100, Martin Davis wrote:
> I can't reproduce this with GEOS 3.12 (either via PostGIS
> ST_OrientedEnvelope or natively in GEOS).  The output is rectangular and as
> expected.
> 
> SELECT ST_AsText(ST_OrientedEnvelope('POLYGON((-71.25961696926942
> 42.470522973159675,-71.25978846747648 42.470624424600906,-71.25973918365264
> 42.47066975346566,-71.25956768540266 42.47056830210077,-71.25961696926942
> 42.470522973159675))'));
> 
>                   st_astext
> --------------------------------------------------------------------------------------------------------------------------------------------------
>  POLYGON((-71.25975582815524 42.470679599674035,-71.25956768540266
> 42.47056830210077,-71.25960032476851 42.4705131269523,-71.25978846752108
> 42.47062442452555,-71.25975582815524 42.470679599674035))
> 
> bin/geosop -a "POLYGON((-71.25961696926942
> 42.470522973159675,-71.25978846747648 42.470624424600906,-71.25973918365264
> 42.47066975346566,-71.25956768540266 42.47056830210077,-71.25961696926942
> 42.470522973159675))" minAreaRectangle
> 
> POLYGON ((-71.25975582815524 42.470679599674035, -71.25956768540266
> 42.47056830210077, -71.25960032476851 42.4705131269523, -71.25978846752108
> 42.470624424525546, -71.25975582815524 42.470679599674035))
> 
> [image: image.png]
> 
> Is it possible the OP diagram is misleading?  Hard to tell since the full
> output is not available.
> 
> @Erik: your repro is surprising. Can you post your query with output, and
> the postgis_full_version() ?

There you go:

	SELECT postgis_full_version();
	                                                                                                                                                                                          postgis_full_version                                                                                                                                                                                          
	--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	 POSTGIS="3.4.1 POSTGIS_REVISION" [EXTENSION] (liblwgeom version mismatch: "3.4.1 ca035b9") PGSQL="160" GEOS="3.12.0-CAPI-1.18.0" PROJ="9.3.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" LIBXML="2.12.1" LIBJSON="0.17" LIBPROTOBUF="1.5.0" WAGYU="0.5.0 (Internal)" (core procs from "3.4.1 ca035b9" need upgrade)
	(1 row)
	
	SELECT st_astext(ST_OrientedEnvelope(
	    'POLYGON((-71.25961696926942 42.470522973159675,
	              -71.25978846747648 42.470624424600906,
	              -71.25973918365264 42.47066975346566,
	              -71.25956768540266 42.47056830210077,
	              -71.25961696926942 42.470522973159675))'));
	                                                                                              st_astext                                                                                               
	------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	 POLYGON((-71.25975582815524 42.470679599674035,-71.25956768540266 42.47056830210077,-71.25960032476851 42.4705131269523,-71.25978846752108 42.47062442452555,-71.25975582815524 42.470679599674035))
	(1 row)

-- 
Erik


More information about the postgis-users mailing list