01-22-2020 2:27 PM - edited 02-03-2024 6:11 PM
In HANA you define a polygon by setting multiple points, for example
NEW ST_Polygon('Polygon ((-5 -5, 5 -5, 0 5, -5 -5), (-2 -2, -2 0, 2 0, 2 -2, -2 -2))')
Is it somehow possible to get the points of an already existing polygon? I can't find a reverse functionion in the documentation (and I don't want to misuse the ST_AsGeoJSON function for this).
Hi Uwe,
you can achieve this by iterating over the exterior and interior rings of the polygon.
You can retrieve the exterior and interior rings of the polygon by using ST_ExteriorRing and ST_InteriorRingN. The number of points per ring can be queried with ST_NumPoints and the specific point can be retrieved with ST_PointN.
The documentation of the respective functions can be found here:
https://help.sap.com/viewer/cbbbfc20871e4559abfd45a78ad58c02/2.0.04/en-US/7a13f280787c10148dc893063d...
Another 'hack' would be to play with the WKT of the polygon - but this is somewhat similar to your GeoJSON example.
Regards,
Mathias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mathias,
ST_AsWKT() is an interesting idea. I Think I'll try this approach. But first I have to solve my other issue, because currently the result of the call is truncated (due to an HANA Client error?) in ABAP (see "HANA Client library: Large result string truncated in ABAP")
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.