<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body style="direction: ltr;"
bidimailui-detected-decoding-type="UTF-8" bgcolor="#ffffff"
text="#000000">
On 03/16/2012 06:52 AM, Simon Cropper wrote:
<blockquote cite="mid:4F62C71D.9020305@fossworkflowguides.com"
type="cite">Hi,
<br>
<br>
Does anyone know of a simple means to take a shapefile and create
a either a SQLite or xBase table?
<br>
<br>
Essentially it is taking an attached attribute table, inserting
the coordinates in a field and saving the new file in a designated
format.
<br>
<br>
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.
<br>
<br>
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.
<br>
<br>
</blockquote>
<p>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:</p>
<p>for f in *.shp; do spatialite data.sqlite ".loaddbf ${f}"; done</p>
<p>or so.</p>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
Arava Development Co. +972-52-3665918
<a class="moz-txt-link-freetext" href="http://surfaces.co.il">http://surfaces.co.il</a>
</pre>
</body>
</html>