Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Import CSV with WKB

$
0
0

I have a csv with rows like this:

 

id, another_id, a_point, a_geometry

7777, 1234, 0106000020E61000000100000001030000000100000007000000B69C28B3259, 0101000020E6100000154A703411935DC0B4CDE8A27C084140

 

What is the best way to import this into a table on HANA so we can perform geospatial queries? I've tried ctl method of import, but that wasn't successful as I guess these are technically not the ST_GEOMETRY type. Should I be using WKT?

 

I am using the free developer edition of SAP HANA on AWS.

 

UPDATE 12/11/14

 

I can import the WKB data as a VARCHAR(5000) or a VARBINARY(5000) and I was hoping to use it in a ST_GeomFromEWKB function call. However it doesn't work. What is strange is this works as a test (this WKB has been shortened and not validated, just for this post):

 

SELECT ST_GeomFromEWKB('0106000020E00000010000000103E1404060F8173B1B8B5DC05DA18D6B18E24040') FROM MYSCHEMA.GEOG;

 

but this doesn't (MY_GEOM is in a VARBINARY column):

 

SELECT ST_GeomFromEWKB(MY_GEOM) FROM MYSCHEMA.GEOG;


The WKB string is the same in both cases, and I get this error in the second call:


Could not execute 'SELECT ST_GeomFromEWKB(MY_POINT) FROM MYSCHEMA.GEOG_SCRATCH'

SAP DBTech JDBC: [257]: sql syntax error: Unsupported argument for geometry construct function: line 1 col 8 (at pos 7)


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>