[gdal-dev] Try to create a .bat for ogr2ogr

João Gaspar joao.f.r.gaspar at gmail.com
Fri Aug 29 03:45:08 PDT 2014


Hi guys,

i'm giving the first steps in this kind of programming.

So the scenario is:

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).

So I read some snippets code and some tutorials and i try to do the .bat
but at this time i have some errors.

Note: I put the name of user and password with dummy value :)

The error that give me for the 2 test shapefiles that i try to import is:

ERROR 1: Unable to write feature 0 from layer Polygon1.

ERROR 1: Terminating translation prematurely after failed
translation of layer Polygon1 (use -skipfailures to skip errors)

ERROR 1: Unable to write feature 0 from layer Polygon2.

ERROR 1: Terminating translation prematurely after failed
translation of layer Polygon2 (use -skipfailures to skip errors)

My actual code of the .bat is:


@echo off
for %%I in (inputs_pggis\*.shp) do (
echo Import shapefile %%~nxI to schema temp.upload
  Tabela PostGIS ...
ogr2ogr -append -update -f PostgreSQL PG:"dbname='temp_gis'
user='test_user' password='test_pss'" inputs_pggis/%%~nxI -nln temp.upload
)


Best Regards,
João
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140829/ede336c5/attachment.html>


More information about the gdal-dev mailing list