SAP SQL GEO CONV FUNC



Get Example source ABAP code based on a different SAP table
  


• AS_GEO_JSON ABAP_OSQL_FUNC

ABAP_SQLFUNC - Geometry Conversion Function

ABAP_SYNTAX
... AS_GEO_JSON( geom ) ...

What does it do?
The function AS_GEO_JSON reads geometry input in the Extended Well-Known Binary (EWKB) representation and returns a geometry object in JSON format. geom must be a table column of type GEOM_EWKB containing a valid geometry. The result is a geometry object in JSON format with data type STRING .
If geom is null, then null is returned.



Latest notes:

The geodata type GEOM_EWKB is mapped to the ABAP type xstring. During the conversion to JSON format, a type conversion to the ABAP type string is carried out.
NON_V5_HINTS
AS_GEO_JSON enforces the ABAP_STRICT_778 strict mode from ABAP_RELEASE ABAP_778 / .
ABAP_HINT_END

ABAP_EXAMPLE_VX5
A geometry is inserted into the DDIC database table DEMO_GEOM_EWKB with the space reference 4326. Within the SELECT statement, the column is read with the built-in function AS_GEO_JSON . The data type is converted from xstring to string and the coordinates of a polygon in JSON format are returned as output.
ABEXA 01436
ABAP_EXAMPLE_END