
autoconf
& cmake
builds: https://gdal.org/drivers/vector/hana.html. This new functionality was contributed to the GDAL project by SAP HANA multi-model engineering team.cmake
builds, so I have built GDAL binaries on my MacBook laptop with Apple M1 (ARM-based) chip.ogrinfo
and ogr2ogr
. Please share more examples in the comments, if you get some!ogrinfo
HANA
driver is built into our GDAL binaries:ogrinfo --formats
"TESTGEO"
. In my database, there is a table "world-continents"
loaded during the previous exercise Import zipped shapefiles into SAP HANA Cloud using Database Explorer.ogrinfo -ro HANA:"DSN=DBADMIN-VITAL-TRIAL-HC-HDB;SCHEMA=TESTGEO"
Please note that while on macOS both single quotes ' and double quotes " work, I found only double quotes " working without issues on Windows.
"DSN=DBADMIN-VITAL-TRIAL-HC-HDB;SCHEMA=TESTGEO"
is the ODBC connection string. I will share its setting a bit later in the post. For now please note that SCHEMA
is the necessary part of it.-so
flag) details about "world-continents"
table (or a "layer" accordingly to the GDAL terminology).ogrinfo -ro HANA:"DSN=DBADMIN-VITAL-TRIAL-HC-HDB;SCHEMA=TESTGEO" \
-so world-continents
-so
flag the command will additionally output values of all features too, like-sql
parameter, eg. only continent name and size in square miles and kilometers for continents smaller than 5,000,000 sq miles.ogrinfo -ro HANA:"DSN=DBADMIN-VITAL-TRIAL-HC-HDB;SCHEMA=TESTGEO" \
-sql "SELECT CONTINENT, SQMI, SQKM FROM \"world-continents\" WHERE SQMI<5000000"
ogr2ogr
ogr2ogr
makes it possible to import/export in all spatial vector formats supported by the binary, in my case 66 formats, incl. KML:ogr2ogr --formats | grep vector | wc -l
Equivalent command on Windows would be
ogr2ogr --formats | findstr vector | find /c /v ""
~/ProjectsLocal/arcgis-runtime-samples-data
folder, and it includes a file with volcanoes in the KML format:ogrinfo -ro ~/ProjectsLocal/arcgis-runtime-samples-data/kml/Volcanoes.kml
...and I can see there are 3 volcano areas in Western Europe:
ogrinfo -ro ~/ProjectsLocal/arcgis-runtime-samples-data/kml/Volcanoes.kml \
-so "Western Europe"
ogr2ogr -f "HANA" HANA:"DSN=DBADMIN-VITAL-TRIAL-HC-HDB;SCHEMA=TESTGEO" \
-t_srs EPSG:4326 \
~/ProjectsLocal/arcgis-runtime-samples-data/kml/Volcanoes.kml \
"Western Europe"
EPSG:4326
done using -t_srs
flag.TESTGEO."WESTERN EUROPE"
:I have not heard about the West Eifel Volcanic Field in Germany before.
/Applications/sap/hdbclient/
.file /Applications/sap/hdbclient/libodbcHDB.dylib
/Applications/sap/hdbclient/hdbuserstore LIST
x86_64
) SAP HANA Client's ODBC library.DBADMIN-VITAL-TRIAL-HC-HDB
, that allows me to connect to my HANA database in SAP HANA Cloud as a DBAdmin
user.At the time of writing this blog post SAP HANA Client is available for macOS on Intel only, so I needed both binaries in Intel versions. Otherwise, mixing Intel binary of SAP HANA Client with ARM binary of unixODBC resulted in the error like:
ERROR 1: HANA connection failed: ERROR: 0: 01000 : [unixODBC][Driver Manager]Can't open lib '/Applications/sap/hdbclient/libodbcHDB.dylib' : file not found
brew
installed in an Intel-compatible architecture session, the same as I have described in Running hdbcli on an Apple M1 chip: an alternative way with using arch command.brew
to install Intel-compatible unixodbc
on i386
emulated architecture.arch
which brew
brew info unixodbc
file $(which odbcinst)
odbcinst -j
~/.odbc.ini
file. Here is mine:cat ~/.odbc.ini
DBADMIN-VITAL-TRIAL-HC-HDB
value for both:You can find more information about ODBC driver for SAP HANA in daniel.vanleeuwen's tutorial "Connect Using the SAP HANA ODBC Driver".
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 | |
11 | |
10 | |
10 | |
9 | |
8 | |
8 | |
8 | |
7 |