Ciao Grass users.
Probably my question is trivial, but I can not fix.
1) I want to import many files. kml (all in the same folder) and then I
would like a merge(with v.patch).
I tried to import v.in.ogr all together .... maybe I'm wrong.
2) Maybe I can do a merge of all files with ogr2ogr?
Probably my question is trivial, but I can not fix.
1) I want to import many files. kml (all in the same
folder) and then I
would like a merge(with v.patch).
I tried to import v.in.ogr all together .... maybe I'm
wrong.
I'll let others talk about new developments in v.in.ogr and
the GUI which may help with that.
but from the unix command line (or Msys command line in MS
Windows) you could do like:
- make sure filenames are SQL compliant (no dots except the.kml,
start with a letter, ..)
- run a little loop on the unix command line:
for file in *.kml ; do
v.in.ogr dsn="$file" output=`basename $file .kml`
done
I think I can see two problems with the script:
First, the dsn= parameter should be the full kml file name, i.e. ${i} as you have set up the loop, and not the just the basename ${cartella}.
Second, I think that the layer= option is not necessary. And you surely should not set it to the output name $nome. The layer= option takes a number (i.e. the number of the layer).
HTH
I think I can see two problems with the script:
First, the dsn= parameter should be the full kml file name, i.e. ${i} as you
have set up the loop, and not the just the basename ${cartella}.
Second, I think that the layer= option is not necessary. And you surely
should not set it to the output name $nome. The layer= option takes a number
(i.e. the number of the layer).
For pretty much all other vector modules, the layer option takes a
number and refers to a GRASS vector layer number. For v.in.ogr, the
layer option is the name, not the number, of an OGR layer. OGR layer
names available in a given dsn are printed with v.in.ogr -l. BTW, one
single kml file can contain several layers.
I think I can see two problems with the script:
First, the dsn= parameter should be the full kml file name, i.e. ${i} as you
have set up the loop, and not the just the basename ${cartella}.
Second, I think that the layer= option is not necessary. And you surely
should not set it to the output name $nome. The layer= option takes a number
(i.e. the number of the layer).
For pretty much all other vector modules, the layer option takes a
number and refers to a GRASS vector layer number. For v.in.ogr, the
layer option is the name, not the number, of an OGR layer. OGR layer
names available in a given dsn are printed with v.in.ogr -l. BTW, one
single kml file can contain several layers.
Ooops, sorry for misleading, and thanks, Markus, for catching that.
(BTW, will the term "layer" be changing its meaning in GRASS 7?? There was much discussion on this some time ago, and alternative names were suggested for the database connection concept that "layer" was meant to refer to)