0

I wrote the following python script to try to import a raster file into GRASS:

import os
os.chdir(r'C:\Users\Desktop')
import sys
sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python'))
import grass.script as g
import grass.script.setup as gsetup
gisbase = os.environ['GISBASE']
gisdb = 'C:\Users\Documents\grassdata'
location = 'newLocation'
mapset = 'mTW'
gsetup.init(gisbase, gisdb, location, mapset)

g.run_command('r.in.gdal', input = 'middle TW', output = 'middl_TW')

But I got this error:

ERROR: GISRC - variable not set

And then this box message showed up:

enter image description here

It means that the procedure entry point sqlite3_rtree_geometry_callback could not be located in the dynamic link library C:\OSGeo4W\bin\spatialite.dll

And then this showed up:

enter image description here

Seems that the r.in.gdal module crashed just as I called it.

If I directly use GRASS GUI, this box message showed up and the program crashed after I choose one mapset:

enter image description here

How to solve this problem? I am using GRASS 6.4.3, python 2.7.6 under WIN 8.1

Heinz
  • 2,415
  • 6
  • 26
  • 34
  • A potential answer is provided here: http://gis.stackexchange.com/a/70035 – markusN Jan 09 '15 at 09:54
  • I have one sqlite3.dll in that folder mentioned in that post, and I still get the same result after I rename it from sqlite3.dll to xxsqlite3.dll – Heinz Jan 09 '15 at 10:12

1 Answers1

1

After I uninstalled OSGEO4W by deleting its whole folder under C:\OSGEO4W, now I can launch GRASS and use its module normally.

Heinz
  • 2,415
  • 6
  • 26
  • 34