How to import POINT from CSV


#1

Is there a way how to import a point type directly from CSV representation?

I implemented a conversion tool to convert NYC Taxi Rides to INSERT statements and execute those 1 by 1 (the etl tool I used Talend cannot do better by default with MapD JDBC driver as its unknown and some functions like batching are not available). So I got idea I will merge long/lat from CSV into other CSV in form of POINT which I will import via command line mapdql.

Is there any way?


#2

Or I am thinking that I will use Kafka as man in the middle. So I don’t need to mess around, I realized by docs that geo data are supported to be imported from shp, .geojson, .kml files… so maybe pushing and consuming from kafka is better in my case, for speed up.

Ok, I answered my own question :-))


#3

If you have a csv with lan/lot you can import them with the copy command without needing any transformation.

Take a look to the @veda.shankar blog


#4

thx @aznable - will just point out the important message:

Now we’ll create a table with a single POINT column which includes the information from the two columns as longitude (x) and latitude (y). By default when the table importer finds scalar values in the CSV row for a POINT column, it consumes two consecutive columns as longitude and latitude. If the order of the coordinates in the CSV file is opposite (latitude, longitude), then load the data using the WITH option lonlat=‘false’ .