Re: [gdal-dev] Re: Dump Shapefile into DB using ogr2ogr
Hi *, I already tried the approach below - without success. The result of my operation is: The command: ogr2ogr -f ESRI Shapefile -sql SELECT cast(999 as integer(3)) as river_id from SRCShape DESTShape.shp SRCShape.shp The command's result: - ERROR 1: SQL: Unrecognised field name 999 On Fri, Aug 19, 2011 at 09:29:23PM +0530, Chaitanya kumar CH wrote: That should work just fine. On Fri, Aug 19, 2011 at 9:23 PM, Hermann Peifer pei...@gmx.eu wrote: On 19/08/2011 15:05, Ingo Weinzierl wrote: Thanks for the quick reply, but the -select option only solves one of the two parts of my problem. I still need to append a further column that does not exist in the shapefile and which should be defined manually. I am not sure if I fully understood the issue, but... what about: ... -sql select cast(999 as integer(3)) as field from ... (If you want an additional integer column with name `field', where all values are defined to be 999) Hermann Regards, Ingo -- Ingo Weinzierl | ++49-541-335083-0 | OpenPGP key: 0x2D2E2573 Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998 Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Re: Dump Shapefile into DB using ogr2ogr
On 22/08/2011 13:13, Ingo Weinzierl wrote: Hi *, I already tried the approach below - without success. The result of my operation is: The command: ogr2ogr -f ESRI Shapefile -sql SELECT cast(999 as integer(3)) as river_id from SRCShape DESTShape.shp SRCShape.shp The command's result: - ERROR 1: SQL: Unrecognised field name 999 What does ogr2ogr --version say? On my side, it says: GDAL 1.9dev, released 2011/01/18 BTW: you could drop `-f ESRI Shapefile', as it is the default. Hermann ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Re: Dump Shapefile into DB using ogr2ogr
Hi Hermann, On Mon, Aug 22, 2011 at 01:30:00PM +0200, Hermann Peifer wrote: On 22/08/2011 13:13, Ingo Weinzierl wrote: Hi *, I already tried the approach below - without success. The result of my operation is: The command: ogr2ogr -f ESRI Shapefile -sql SELECT cast(999 as integer(3)) as river_id from SRCShape DESTShape.shp SRCShape.shp The command's result: - ERROR 1: SQL: Unrecognised field name 999 What does ogr2ogr --version say? On my side, it says: GDAL 1.9dev, released 2011/01/18 BTW: you could drop `-f ESRI Shapefile', as it is the default. It says GDAL 1.6.3, released 2009/11/19. This version comes along with Debian Squeeze. Ingo -- Ingo Weinzierl | ++49-541-335083-0 | OpenPGP key: 0x2D2E2573 Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998 Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Re: Dump Shapefile into DB using ogr2ogr
On 22/08/2011 14:08, Ingo Weinzierl wrote: It says GDAL 1.6.3, released 2009/11/19. This version comes along with Debian Squeeze. You have to upgrade to GDAL/OGR = 1.8.0 in order to make use of the new OGR SQL functionality, http://www.gdal.org/ogr/ogr_sql.html Hermann ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Re: Dump Shapefile into DB using ogr2ogr
On 19/08/2011 15:05, Ingo Weinzierl wrote: Thanks for the quick reply, but the -select option only solves one of the two parts of my problem. I still need to append a further column that does not exist in the shapefile and which should be defined manually. I am not sure if I fully understood the issue, but... what about: ... -sql select cast(999 as integer(3)) as field from ... (If you want an additional integer column with name `field', where all values are defined to be 999) Hermann ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Re: Dump Shapefile into DB using ogr2ogr
That should work just fine. On Fri, Aug 19, 2011 at 9:23 PM, Hermann Peifer pei...@gmx.eu wrote: On 19/08/2011 15:05, Ingo Weinzierl wrote: Thanks for the quick reply, but the -select option only solves one of the two parts of my problem. I still need to append a further column that does not exist in the shapefile and which should be defined manually. I am not sure if I fully understood the issue, but... what about: ... -sql select cast(999 as integer(3)) as field from ... (If you want an additional integer column with name `field', where all values are defined to be 999) Hermann __**_ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/**mailman/listinfo/gdal-devhttp://lists.osgeo.org/mailman/listinfo/gdal-dev -- Best regards, Chaitanya kumar CH. +91-9494447584 17.2416N 80.1426E ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev