[GRASS-SVN] r42014 - grass-addons/ossim_grass/r.planet

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 24 07:15:12 EDT 2010


Author: epifanio
Date: 2010-04-24 07:15:11 -0400 (Sat, 24 Apr 2010)
New Revision: 42014

Modified:
   grass-addons/ossim_grass/r.planet/description.html
   grass-addons/ossim_grass/r.planet/r.planet.py
Log:
added flag to run the ossim executables using MPI (mpirun -np 'process number')

Modified: grass-addons/ossim_grass/r.planet/description.html
===================================================================
--- grass-addons/ossim_grass/r.planet/description.html	2010-04-24 10:44:19 UTC (rev 42013)
+++ grass-addons/ossim_grass/r.planet/description.html	2010-04-24 11:15:11 UTC (rev 42014)
@@ -1,9 +1,12 @@
 <h2>DESCRIPTION</h2>
 
 
-<em><b>r.planet.py : </b></em> Scripts to generate vrt layer from a selected grass raster layer and add/zoomTo/remove the data to ossimplanet using the ossimplanet tcp listner.
+<em><b>r.planet.py : </b></em> Scripts to : 
+<p>
+- generate vrt layer from a selected grass raster layer and add/zoomTo/remove the data from/to ossimplanet using the ossimplanet tcp listner.
+<p>
+- generate ossimplanet 3d tiles from elevation data.
 
-
 <h2>EXAMPLE</h2>
 
 Add selected map to ossimplanet screen and zoom to it :
@@ -16,6 +19,11 @@
 r.planet.py map=elevation.10m -r
 </pre></div>
 <p>
+Generate 3D tiles :
+<div class="code"><pre>
+r.planet.py map=elevation.10m -d tile=3601
+</pre></div>
+<p>
 
 
 <h2>REFERENCES</h2>

Modified: grass-addons/ossim_grass/r.planet/r.planet.py
===================================================================
--- grass-addons/ossim_grass/r.planet/r.planet.py	2010-04-24 10:44:19 UTC (rev 42013)
+++ grass-addons/ossim_grass/r.planet/r.planet.py	2010-04-24 11:15:11 UTC (rev 42014)
@@ -57,6 +57,14 @@
 #% required : no
 #%end
 #%option
+#% key: np
+#% type: integer
+#% key_desc: Processor-Number
+#% answer: 0
+#% description: Mpi Processor Number
+#% required : no
+#%end
+#%option
 #% key: tile
 #% type: double
 #% key_desc: tile
@@ -75,6 +83,10 @@
 #% key: d
 #% description: Orthoigen 
 #%END
+#%flag
+#% key: m
+#% description: MPI 
+#%END
 
 
 import sys
@@ -87,10 +99,12 @@
     add = flags['a']
     remove = flags['r']
     orthoigen = flags['d']
+    mpi = flags['m']
     host = options['host']
     dport = options['dport']
     pport = options['pport']
     tile = options['tile']
+    np = options['np']
     grassenv = grass.gisenv()
     mappa = options['map'].replace("@"," ")
     mappa = mappa.split()
@@ -277,7 +291,19 @@
     if not os.path.exists(d):
         os.makedirs(d)
 
+
+def WhichPlatform():
+    #global platform
+    platforms = platform.system()
+    return platforms
+
+
 def make3d(tile, elev, outdir):
+    systemplatform = WhichPlatform()
+    if systemplatform == 'Darwin':
+        orthoigenexec = '/Users/sasha/OssimBuilds/Release/ossim-orthoigen'
+    else :
+        orthoigenexec = 'ossim-orthoigen'
     makedir(outdir)
     kwl = 'elev.kwl'
     template = 'igen.slave_tile_buffers: 5 \n'
@@ -307,7 +333,11 @@
     template += 'product.projection.type: ossimEquDistCylProjection \n'
     open(kwl,'w').write(template)
     instr = 'export DYLD_FRAMEWORK_PATH=/Users/sasha/OssimBuilds/Release/ ; '
-    instr += '/Users/sasha/OssimBuilds/Release/ossim-orthoigen'
+    if mpi :
+        instr += 'mpirun -np %s ' % np
+        instr += orthoigenexec
+    else :
+        instr += orthoigenexec
     instr += ' --tiling-template '
     instr += kwl
     instr +=' --view-template '
@@ -323,7 +353,14 @@
 
 
 def makeoverview(input):
-    os.system("ossim-img2rr %s" % input)
+    if systemplatform == 'Darwin':
+        img2rrexec = '/Users/sasha/OssimBuilds/Release/ossim-img2rr'
+    else :
+        img2rrexec = 'ossim-img2rr'
+    if mpi :
+        os.system("mpirun -np %s %s %s" % np, img2rrexec, input)
+    else :
+        os.system("%s %s" % img2rrexec, input)
 
 
 if __name__ == "__main__":



More information about the grass-commit mailing list