<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">
<div>João -<br>
<br>
Try to get to ogr2ogr command to work (or not work) from GDAL
command-line environment (SDKShell.bat) with one shape file.<br>
<br>
And don't depend on defaults in the database connection string,
ie. PG:"<b>host=localhost port=5432 </b>dbname='temp_gis'
user='test_user' password='test_pss'"<br>
<br>
You might try to simply create a new table in stead of appending
to an existing table.<br>
<br>
At a glance I suspect you have some kind of permission problem
in the database<br>
<br>
Checkpoint 101:<br>
<ol>
<li>Have you a Postgres/Postgis databaser server installed at
localhost and listening on port 5432 ?<br>
</li>
<li>Is your database user and password set correctly ?<br>
</li>
<li>Has you a database 'temp_gis' with PostGIS enabled running
on the local database server ?<br>
</li>
<li>Has you a schema 'temp' in the database and a table
'upload' in schema ?</li>
<li>Has the table the right structure and a geometry column ?
<br>
</li>
<li>Does the database user has permission to write data to the
table ? </li>
</ol>
I suspect that no. 5 or 6 is the culprit.<br>
<br>
Regards<br>
Bo Victor Thomsen<br>
Aestas-GIS<br>
Denmark<br>
</div>
<br>
Den 29-08-2014 12:45, João Gaspar skrev:<br>
</div>
<blockquote
cite="mid:CAM+zXj1WhJ_aHEsfb=rbpQo5KYZVSgjiGLy__HHxLfnpKUt66w@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi guys,<br>
<br>
</div>
i'm giving the first steps in this kind of programming.<br>
<br>
</div>
So the scenario is:<br>
<br>
</div>
I have a lot of users that dump work shapfiles into a
folder, then i need to upload this files to a database into
a single table (at this time i'm testing the PostGIS).<br>
<br>
</div>
So I read some snippets code and some tutorials and i try to
do the .bat but at this time i have some errors.<br>
<br>
</div>
<div>Note: I put the name of user and password with dummy value
:)<br>
</div>
<div><br>
</div>
The error that give me for the 2 test shapefiles that i try to
import is:<br>
<br>
ERROR 1: Unable to write feature 0 from layer Polygon1.<br>
<br>
ERROR 1: Terminating translation prematurely after failed<br>
translation of layer Polygon1 (use -skipfailures to skip errors)<br>
<br>
ERROR 1: Unable to write feature 0 from layer Polygon2.<br>
<br>
ERROR 1: Terminating translation prematurely after failed<br>
translation of layer Polygon2 (use -skipfailures to skip errors)<br>
<div><br>
My actual code of the .bat is:<br>
<br>
<br>
<div>@echo off<br>
for %%I in (inputs_pggis\*.shp) do (<br>
echo Import shapefile %%~nxI to schema temp.upload<br>
Tabela PostGIS ...<br>
ogr2ogr -append -update -f PostgreSQL PG:"dbname='temp_gis'
user='test_user' password='test_pss'" inputs_pggis/%%~nxI
-nln temp.upload<br>
)<br>
<br>
<br>
</div>
<div>Best Regards,<br>
</div>
<div>João<br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</body>
</html>