There are alternative ways of importing spatial data, that can be used.
- Import shapefile via wizard
- Import CSV via wizard and convert to spatial data types
- Import CSV from Cloud Object Store (S3, GCS, ADL) and convert.
For clarification, spatial data means geometries, shapes such as polygons that will be stored as spatial data types.
Prepare the Data
To use the shapefiles import wizard, your spatial data needs to be using one of the supported spatial references. HANA supports 1000s of spatial references, currently the wizard only supports 5.
The wizard supports the following spatial references IDs (SR IDs)
The wizard expects a .tar.gz file containing both the .shp and .dbf file of the the same name.
The file I’m using is the English geographic regions from UK Office National Statistics (ONS).
Viewing the associated metadata of this file shows that the spatial reference is 27700, which is not one of the supported ones for the wizard.
We can open the shapefile with QGIS to convert this to a supported spatial.
Create a .tar.gz containing the .shp and .dbf to upload.
The easiest way to import a shapefile is using the Database Explorer, via Import Data
Right Click and select Import Data, open the wizard. We can use that with an appropriate .tar.gz and follow the steps.
In summary, in this blogpost I described how to use the Import Data for ESRI Shapefiles. With this wizard we can quickly and easily import spatial data into SAP HANA Cloud.