Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-02 Thread aborruso
On 2 May 2016 at 09:32, Rahkonen Jukka (MML) [via OSGeo.org] < ml-node+s1560n5263838...@n6.nabble.com> wrote: > It seems to me that adding a general support for adding multiple columns > with a single request into OGR SQL dialect would require to go through > every driver: With PostgreSQL, build

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-02 Thread Rahkonen Jukka (MML)
Andrea wrote: >Hi Jukka, >Rahkonen Jukka (MML) wrote >> Do you know some database that accepts SQL "ALTER TABLE foo ADD COLUMN >> bar1, bar2"? At least SQLite and PostgreSQL don't. That kind of usage is >> not mentioned in a bunch of documents about SQL language which I browsed >>

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-02 Thread aborruso
Hi Jukka, Rahkonen Jukka (MML) wrote > Do you know some database that accepts SQL "ALTER TABLE foo ADD COLUMN > bar1, bar2"? At least SQLite and PostgreSQL don't. That kind of usage is > not mentioned in a bunch of documents about SQL language which I browsed > through, for example

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread Rahkonen Jukka (MML)
Andrea Borruso wrote: >thank you very much. I had read that page, but stupidly I did not think >that "ALTER TABLE tablename ADD [COLUMN] columnname columntype" meant >strictly that I could only use it in this way. >My wrong intepretion was that I could use "alter table add" SQL command >and its

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread andy
Hi Even, On 1 May 2016 at 22:28, Even Rouault wrote: > Because it is not implemented... OGR SQL has many implementation > limitations. > What is supported is documented here : http://gdal.org/ogr_sql.html > thank you very much. I had read that page, but stupidly I

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread Even Rouault
Le dimanche 01 mai 2016 19:11:36, aborruso a écrit : > Hi Jeff, > thank you from Italy! > > > jmckenna wrote > > > When I responded earlier I was testing and you cannot do this in one > > single ogrinfo command (so that answers your initial question). What > > would be great, if you could add

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread aborruso
Hi Jeff, thank you from Italy! jmckenna wrote > > When I responded earlier I was testing and you cannot do this in one > single ogrinfo command (so that answers your initial question). What > would be great, if you could add your working example to the docs: here > is an existing wiki page

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread Jeff McKenna
On 2016-05-01 10:30 AM, aborruso wrote: jmckenna wrote I think you have to use 2 ogrinfo statements. I know it, it works with 2 statements. Do you know why I cannot use my kind of SQL command with all in one statement? And what do you think about to add some note in the documentation, about

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread Christine Waigl
I see. Thanks for the correction. On Sun, May 1, 2016 at 6:58 AM, aborruso wrote: > Hi Christine, > thank you. > > > Christine Waigl wrote > > > > As far as I'm aware -- please correct me if I'm wrong -- > > ogrinfo only lists information about a file and doesn't > > alter

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread aborruso
aborruso wrote > As I written in my message I'm able to use ogrinfo to alterate my source > file, but if I want to add 3 fields I must write 3 ogrinfo statements; I > would like to know why a single statemente with a correct SQL command. ops, I'm sorry ... why I cannot use a single ogrinfo

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread aborruso
Hi Christine, thank you. Christine Waigl wrote > > As far as I'm aware -- please correct me if I'm wrong -- > ogrinfo only lists information about a file and doesn't > alter it. As I written in my message I'm able to use ogrinfo to alterate my source file, but if I want to add 3 fields I must

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread Christine Waigl
On Sun, May 1, 2016 at 5:30 AM, aborruso wrote: > > > jmckenna wrote > > I think you have to use 2 ogrinfo statements. As far as I'm aware -- please correct me if I'm wrong -- ogrinfo only lists information about a file and doesn't alter it. "ogrinfo -sql" may well be

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread aborruso
Hi Jeff, thank you. jmckenna wrote > I think you have to use 2 ogrinfo statements. I know it, it works with 2 statements. Do you know why I cannot use my kind of SQL command with all in one statement? And what do you think about to add some note in the documentation, about the origin of the

Re: [gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread Jeff McKenna
On 2016-05-01 5:20 AM, aborruso wrote: Hi, I have no problem to add a column to a shapefile with: ogrinfo myfile.shp -sql "ALTER TABLE myfile ADD fieldX integer" But if I use, the second column is not added to the file. ogrinfo myfile.shp -sql "ALTER TABLE myfile ADD fieldX integer(3), fieldY

[gdal-dev] How to add more than one column to a shapefile using ogrinfo

2016-05-01 Thread aborruso
Hi, I have no problem to add a column to a shapefile with: ogrinfo myfile.shp -sql "ALTER TABLE myfile ADD fieldX integer" But if I use, the second column is not added to the file. ogrinfo myfile.shp -sql "ALTER TABLE myfile ADD fieldX integer(3), fieldY integer(3)" The shell gives me only