is there a way to get grass to import geodata without creating a location first? Grass will not start unless the location is already there or is created in the GUI.
What I mean is:
how can I write a script that will create a new location using projection and extent from an existing file with geodata and then import that file to that location? So that when starting grass the location and the data are already there.
This should be possible with no more than 2 commands (one for create and one for import) but I have no idea how to get grass to run the commands without starting it first.
is there a way to get grass to import geodata without creating a location
first? Grass will not start unless the location is already there or is
created in the GUI.
What I mean is:
how can I write a script that will create a new location using projection
and extent from an existing file with geodata and then import that file to
that location? So that when starting grass the location and the data are
already there.
start GRASS with some location, using
r.in.gdal location=<newlocation> ...
for raster data or
v.in.ogr location=<newlocation> ...
for vector data
you can create new location based on imported data and import data
into the new location in one command.
That works in principle and automatically imports the data from the shapefile into location ‘import’. Unfortunately only partially. One third of the polygons gets imported, the rest is missing.
I also started grass with gui, selected “tmplocation” and the on the commandline entered exactly the command used above (v.in.ogr dsn=mydata.shp location=import output=‘mydata’ min_area=0.0001 snap=-1). Then all the objects get imported correctly.
thanks you for the info.
Unfortunately that changed nothing.
The script was executed as expected but afterwards only part of the data has been imported.