[GRASS-SVN] r40935 - grass-addons/ossim_grass/r.planet
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 11 17:18:39 EST 2010
Author: epifanio
Date: 2010-02-11 17:18:38 -0500 (Thu, 11 Feb 2010)
New Revision: 40935
Modified:
grass-addons/ossim_grass/r.planet/r.planet.py
Log:
adde tile size option, adjusted flags
Modified: grass-addons/ossim_grass/r.planet/r.planet.py
===================================================================
--- grass-addons/ossim_grass/r.planet/r.planet.py 2010-02-11 21:45:12 UTC (rev 40934)
+++ grass-addons/ossim_grass/r.planet/r.planet.py 2010-02-11 22:18:38 UTC (rev 40935)
@@ -56,6 +56,13 @@
#% description: Position Port
#% required : no
#%end
+#%option
+#% key: tile
+#% type: double
+#% key_desc: tile
+#% description: tile
+#% required : no
+#%end
#%flag
#% key: a
#% description: Add raster
@@ -83,13 +90,14 @@
host = options['host']
dport = options['dport']
pport = options['pport']
+ tile = options['tile']
grassenv = grass.gisenv()
mappa = options['map'].replace("@"," ")
mappa = mappa.split()
- nflags = len(filter(None, [add, remove]))
+ nflags = len(filter(None, [add, remove, orthoigen]))
if nflags > 1:
- grass.run_command('g.message' , message = 'Cannot add & remove a map at same time.')
+ grass.run_command('g.message' , message = 'Cannot add & remove a map or use orthoigen at the same time.')
if nflags < 1:
grass.run_command('g.message' , message = 'No action requested , please choose one from "-a : add" or "-r : remove" flags.')
try :
@@ -117,26 +125,32 @@
lat = zoom_position[0]
lon = zoom_position[1]
distance = zoom_position[2]
- if add :
- addzoom(output,lon,lat,distance,host,dport,pport)
- print 'Added raster file :', mappa[0]
- print 'Camera positioned to : '
- print 'Longitude = ',lon
- print 'Latitude = ', lat
- print 'Altitude = ' , distance
- if remove :
- removefile(output,host,dport)
- print 'Removed raster file :', mappa[0]
- if orthoigen :
- path = os.path.dirname(output)
- print path
- elevdir = os.path.join(path,'elevation',mappa[0])
- os.makedirs(elevdir)
- print elevdir
- elev = mappa[0]+'.tiff'
- exportiff(output,elev)
- instr = make3d(10801, elev, elevdir)
- os.system(instr)
+ if nflags == 1:
+ if add :
+ try :
+ addzoom(output,lon,lat,distance,host,dport,pport)
+ print 'Added raster file :', mappa[0]
+ print 'Camera positioned to : '
+ print 'Longitude = ',lon
+ print 'Latitude = ', lat
+ print 'Altitude = ' , distance
+ except :
+ print "conecction error"
+ if remove :
+ removefile(output,host,dport)
+ print 'Removed raster file :', mappa[0]
+ if orthoigen :
+ if tile != '':
+ path = os.path.dirname(output)
+ elevdir = os.path.join(path,'elevation',mappa[0])
+ if not os.path.exists(d):
+ os.makedirs(elevdir)
+ elev = mappa[0]+'.tiff'
+ exportiff(output,elev)
+ instr = make3d(tile, elev, elevdir)
+ os.system(instr)
+ if tile == '':
+ print 'please set the tile dimension'
def exportiff(infile,outfile):
More information about the grass-commit
mailing list