~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to swig/python/test.py

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
# must be executed in the GRASS env
4
 
# test case for Spearfish location
5
 
 
6
 
 
7
 
import os, sys
8
 
from grass.lib import grass
9
 
 
10
 
if not os.environ.has_key("GISBASE"):
11
 
    print "You must be in GRASS GIS to run this program."
12
 
    sys.exit(1)
13
 
 
14
 
rname = 'elevation.dem'
15
 
mapset = 'PERMANENT'
16
 
 
17
 
grass.G_gisinit('')
18
 
grass.G_find_cell2(rname,'')
19
 
 
20
 
print mapset
21
 
 
22
 
print 'prints 0 if map was found'
23
 
 
24
 
print 'roads raster map:'
25
 
print grass.G_raster_map_type('roads',mapset)
26
 
 
27
 
print 'elevation.dem raster map:'
28
 
print grass.G_raster_map_type(rname,mapset)
29