
H H EEEEE L L oOo !!
H H E L L O O !!
HHHHH EEEEE L L O O !!
H H E L L O O
H H EEEEE LLLLL LLLLL OOO !!
ne_110m_land.zip
from http://www.naturalearthdata.com/downloads/110m-physical-vectors/110m-land/, copied it into /usr/sap/HXE/HDB00/work/
on my HANA Express host and unzipped. [Make sure files are accessible at the OS level for hxeadm
HANA user.]WGS 1984
is the one supported by SAP HANA out of the box with two Spatial Reference Systems: 4326
for the round Earth and 1000004326
for the planar projection.IMPORT NATURAL_EARTH.NE_110M_LAND AS SHAPEFILE FROM '/usr/sap/HXE/HDB00/work/ne_110m_land' WITH SRID 1000004326;
NATURAL_EARTH
, the table NE_110M_LAND
in it, and then loaded the content of the shape files. 127 records have been created, each with a single polygon with requested SRS ID 1000004326
.NE_EARTH
with the spatial ST_UnionAggr()
aggregation of data from the shapefile.CREATE COLUMN TABLE "NATURAL_EARTH"."NE_EARTH" ("SHAPE" ST_GEOMETRY(1000004326) ) ;
INSERT INTO "NATURAL_EARTH"."NE_EARTH" SELECT st_unionaggr(SHAPE) FROM "NATURAL_EARTH"."NE_110M_LAND";
SELECT "SHAPE".st_asSVG() FROM "NATURAL_EARTH"."NE_EARTH";
DRAW_EARTH
to store my calculated ASCII map:CREATE COLUMN TABLE "NATURAL_EARTH"."DRAW_EARTH"( "LATIT" DEC, "SSTRING" NVARCHAR(1000) );
ASCII_MAP_FLAT
to go throw a multipoligon with the Earth's land and check if particular point with latitude and longitude coordinates is covered by the land (True=1
in SAP HANA geospatial method ST_CoveredBy()
), or not (False=0
). The procedure takes resolution
as an input parameter, which defines how many ASCII characters will be printed in one line.create procedure "NATURAL_EARTH"."ASCII_MAP_FLAT" (IN resolution INT)
LANGUAGE SQLSCRIPT AS
llon, llat INTEGER;
ssurf, ppoint STRING;
BEGIN
llat := 90;
WHILE llat>=-90 DO
llon := -180;
ssurf := '';
WHILE llon<=180 DO
select new st_point('POINT ('||:llon||' '||:llat||')', 1000004326).ST_CoveredBy(SHAPE) into ppoint FROM "NATURAL_EARTH"."NE_EARTH";
ssurf := concat (ssurf, ppoint);
llon := llon+360/resolution;
END WHILE;
INSERT INTO "NATURAL_EARTH"."DRAW_EARTH" VALUES (:llat, :ssurf);
llat := llat-360/resolution;
END WHILE;
END;
0
with " "
, and 1
with "*"
when presenting the output from DRAW_EARTH
result table.truncate table "NATURAL_EARTH"."DRAW_EARTH";
CALL "NATURAL_EARTH"."ASCII_MAP_FLAT"(RESOLUTION => 180);
SELECT replace(replace("SSTRING", '0', ' '), '1', '*') as "ASCIIMAP" FROM "NATURAL_EARTH"."DRAW_EARTH";
8x8
raster font. It looks promising.ssh
into my HANA Express host using PuTTY's plink
utility. You obviously should use IP address of your HANA server and the path to .ppk
file with your PuTTY's private key file, if you are following my steps.plink -ssh root@34.00.00.00 -P 22 -i "C:\.....\hxe_1_18.ppk"
hxeadm
HANA user and open HANA command line interface hdbsql
connecting to your database with NATURAL_EARTH
schema.su - hxeadm
hdbsql -i <db-instance-nr> -d <db-name> -u <development-user> -p <user-password>
SystemDB
for development?! and SYSTEM
as a developer user?? ;-))\es
, and toggle page by page output OFF using \pa
commands in hdbsql
.SELECT replace(replace("SSTRING", '0', ' '), '1', '*') as "ASCIIMAP" FROM "NATURAL_EARTH"."DRAW_EARTH";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
13 | |
11 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |