cancel
Showing results for 
Search instead for 
Did you mean: 

FOR Minimum bounding rectangle

Former Member
0 Kudos

Hi,

Is there a function available in sap hana spiatial for finding minmum bounding rectangle on geometries.

Currently, I am using below query to find it

SELECT new ST_Polygon('POLYGON (('   || Min("GEOM".st_xmin()) || ' ' || Min("GEOM".st_ymin()) || ','

   || Min("GEOM".st_xmin()) || ' ' || Max("GEOM".st_ymax()) ||

   ','   || Max("GEOM".st_xmax()) || ' ' || Max("GEOM".st_ymax()) || ','   || Max("GEOM".st_xmax()) || ' ' || Min("GEOM".st_ymin()) || ','   || Min("GEOM".st_xmin()) || ' ' || Min("GEOM".st_ymin())   || '))') FROM "table" GROUP BY  ID

But this is failing for point geometries in table because (xmin, ymin ) and (xmax,ymax) are same for point and it is not able to create polygon for it.

I have also tried ST_UNIONAggr(thinking of getting envelope of the aggregated geometry) but this gives error with - invalid function or procedure name.

Please suggest.

Thanks in Advance.

Nishtha

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Nishtha, thanks for contacting us. Please refer to the SAP HANA and In-Memory Computing group: http://scn.sap.com/community/hana-in-memory You can post the same question there. I hope you will find this helpful. Kind regards, Federica