<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I never work with Excel, but using ODBC with Access is never a problem.
Would that be an acceptable solution, e.g. linking the Excel data to an
Access table and sending that to PostGIS?<br>
<br>
Jan<br>
<br>
On 15-2-2010 22:03, <a class="moz-txt-link-abbreviated" href="mailto:Steve.Toutant@inspq.qc.ca">Steve.Toutant@inspq.qc.ca</a> wrote:
<blockquote
cite="mid:OF95213907.473860A4-ON852576CB.0073163F-852576CB.0073A283@isn.rtss.qc.ca"
type="cite"><br>
<font face="sans-serif" size="2">Hi,</font>
<br>
<font face="sans-serif" size="2">Every day I receive an Excel file
containing
lat long coordinates. I need to import it to postgis.</font>
<br>
<font face="sans-serif" size="2">Currently, I save the Excel file in
CSV format and I use ogr2ogr to import the contents into postgis. I
would
like to avoid human intervention.</font>
<br>
<br>
<font face="sans-serif" size="2">I tried unsuccessfully to define
an ODBC link on the Excel file and use ogr2ogr with odbc to import it
to
postgres/postgis.</font>
<br>
<font face="sans-serif" size="2">I got this error</font>
<br>
<font face="sans-serif" size="2">[Microsoft][ODBC Excel Driver]
External
table is not in the expected format</font>
<br>
<br>
<font face="sans-serif" size="2">Here is the command I sent</font>
<br>
<font face="sans-serif" size="2">ogr2ogr -f "PostgreSQL" PG:"host=xxx
user=xxx password=xxx dbname=geo" "ODBC:odbc_urg,test" -nln
"testODBCxls" -overwrite</font>
<br>
<br>
<font face="sans-serif" size="2">where test is the sheet name inside
the excel file</font>
<br>
<br>
<font face="sans-serif" size="2">Anyone has a better idea on how to
programmatically
import excel data into postgis?</font>
<br>
<font face="sans-serif" size="2">thanks</font>
<br>
<font face="sans-serif" size="2">Steve</font>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
</body>
</html>