On 03/16/2012 06:52 AM, Simon Cropper wrote:
Hi,

Does anyone know of a simple means to take a shapefile and create a either a SQLite or xBase table?

Essentially it is taking an attached attribute table, inserting the coordinates in a field and saving the new file in a designated format.

Most of the data being converted is point data or fixed area samples. Ideally the converter could record the centroid for grid cells with details of the furthest point.

I know of various tools that can do this 'manually' one step at a time but as I have many files that come regularly, I would like to somehow automate the process.

Since spatialite can be run with SQL commands as parameters on the command line (i.e. spatialite data.sqlite "SELECT * FROM table1;") you could pass the '.loaddbf' command to spatialite, and with some wildcard trickery loop thru all your shapefiles:

for f in *.shp; do spatialite data.sqlite ".loaddbf ${f}"; done

or so.


-- 
Micha Silver
Arava Development Co. +972-52-3665918
http://surfaces.co.il

_______________________________________________
Discuss mailing list
Discuss@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/discuss

Reply via email to