Dear Jonathan,

the error is due to grass_session that is not creating the location if
missing.
I don't have time in this day to fix this issue in grass_session, so the
fastest fsolution at the momenth is to check and create what is needed step
by step.

I did not have xyz file to test so I've only execute g.gisenv and it works,
let me know if it works also with r.inxyz:

```python
from __future__ import print_function
import os
from grass_session import Session
from grass.script import core as gcore

GISDBASE = "/tmp/grassdata"
LOCATION = "nrw"
EPSG = "EPSG:4326"


if not os.path.exists(GISDBASE):
    os.makedirs(GISDBASE)

if not os.path.exists(os.path.join(GISDBASE, LOCATION)):
    with Session(gisdb=GISDBASE, location=LOCATION,
                 create_opts=EPSG):
        print("Created a new location!")
else:
    print("Location already exist!")


with Session(gisdb=GISDBASE, location=LOCATION, mapset="elevation",
             create_opts=""):
    gcore.run_command("g.gisenv")
```

Best regards

Pietro
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to