[GRASS-dev] RE: [GRASS-user] Question with Python-SWIG example [SEC=UNCLASSIFIED]

Martin Landa landa.martin at gmail.com
Tue May 18 13:18:19 EDT 2010


Hi,

2010/5/18 Glynn Clements <glynn at gclements.plus.com>:
> Odd. Can you try it under GDB and check what arguments
> G_find_raster2() is getting?
>
> Also, are you calling G_gisinit() first?

sample script below

---
#!/usr/bin/env python
import os, sys
from grass.lib import grass, raster
from ctypes import *

input = sys.argv[1]

grass.G_gisinit(sys.argv[0])

mapset = grass.G_find_raster2(input, "")
print mapset
---

Running

python example.py elevation

I get

D1/5: G_find_raster2(): name=�  ��� mapset=elevation
WARNING: Illegal filename <� ���>. Character <� not allowed.
�

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa


More information about the grass-user mailing list