浏览代码

boosted to GRASS 7 for parallel installation

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@31533 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 17 年之前
父节点
当前提交
da54482439

+ 2 - 2
macosx/app/Info.plist.in

@@ -11,9 +11,9 @@
 	<key>CFBundleIconFile</key>
 	<key>CFBundleIconFile</key>
 	<string>app.icns</string>
 	<string>app.icns</string>
 	<key>CFBundleIdentifier</key>
 	<key>CFBundleIdentifier</key>
-	<string>org.osgeo.grass6</string>
+	<string>org.osgeo.grass7</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
+	<string>7.0</string>
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>

+ 6 - 6
swig/python/Makefile.in

@@ -11,24 +11,24 @@ LDFLAGS=-shared -L$(ARCH_LIBDIR) $(GDALLIBS) $(PYTHONLDFLAGS) -lgrass_I -lgrass_
 #SUBDIRS = NumPtr
 #SUBDIRS = NumPtr
 #include $(MODULE_TOPDIR)/include/Make/Dir.make
 #include $(MODULE_TOPDIR)/include/Make/Dir.make
 
 
-default: python_grass6.so
+default: python_grass7.so
 
 
 clean:
 clean:
-	-rm -f *.o *.so python_grass6_wrap.c python_grass6.pyc python_grass6.py
+	-rm -f *.o *.so python_grass7_wrap.c python_grass7.pyc python_grass7.py
 
 
 distclean: clean
 distclean: clean
 	-rm -f Makefile
 	-rm -f Makefile
 
 
-python_grass6_wrap.c: python_grass6.i
+python_grass7_wrap.c: python_grass7.i
 	$(MAKE) -C interfaces
 	$(MAKE) -C interfaces
 	$(SWIG) -python -shadow $<
 	$(SWIG) -python -shadow $<
 
 
 
 
-python_grass6_wrap.o: python_grass6_wrap.c
+python_grass7_wrap.o: python_grass7_wrap.c
 	$(CC) $(CFLAGS) $(INCLUDE_DIRS) $<
 	$(CC) $(CFLAGS) $(INCLUDE_DIRS) $<
 
 
-python_grass6.so: python_grass6_wrap.o
-	$(LD) $(LDFLAGS) $< -o _python_grass6.so
+python_grass7.so: python_grass7_wrap.o
+	$(LD) $(LDFLAGS) $< -o _python_grass7.so
 
 
 # doxygen:
 # doxygen:
 DOXNAME=
 DOXNAME=

+ 1 - 1
swig/python/NumPtr/README.GRASS

@@ -24,7 +24,7 @@ How to build:
 
 
 How to install:
 How to install:
  Copy the fruits of the build into the same place as the GRASS SWIG
  Copy the fruits of the build into the same place as the GRASS SWIG
-   module (_python_grass6.so etc.). for example:
+   module (_python_grass7.so etc.). for example:
 
 
  cp build/lib.linux-i686-2.4/*NumPtr.* ../
  cp build/lib.linux-i686-2.4/*NumPtr.* ../
    or to some place on your system: 
    or to some place on your system: 

+ 5 - 5
swig/python/README

@@ -16,11 +16,11 @@ How to INSTALL?
 
 
 3. Run make in the swig/python/ directory
 3. Run make in the swig/python/ directory
 
 
-It will create two files, python_grass6.py and _python_grass6.so.
+It will create two files, python_grass7.py and _python_grass7.so.
 
 
 4. From within GRASS (or a fake grass session) run "python test.py" to
 4. From within GRASS (or a fake grass session) run "python test.py" to
    test and to automatically create a byte-compiled version of the module
    test and to automatically create a byte-compiled version of the module
-   (python_grass6.pyc). The .pyc file is platform independent and may be
+   (python_grass7.pyc). The .pyc file is platform independent and may be
    safely shared among systems. Even so, it doesn't hurt to rebuild it
    safely shared among systems. Even so, it doesn't hurt to rebuild it
    ourselves while we still have write permissions and to make sure we
    ourselves while we still have write permissions and to make sure we
    are using an up to date copy. (out of date copies will be ignored)
    are using an up to date copy. (out of date copies will be ignored)
@@ -31,11 +31,11 @@ It will create two files, python_grass6.py and _python_grass6.so.
 How to use it?
 How to use it?
 --------------
 --------------
 
 
-import python_grass6
+import python_grass7
 GRASS functions will be available in this module.
 GRASS functions will be available in this module.
 Eg: 
 Eg: 
-	import python_grass6
-	mapset=python_grass6.G_mapset()
+	import python_grass7
+	mapset=python_grass7.G_mapset()
 	print mapset
 	print mapset
 
 
 See examples/m.distance for an example of a working SWIG-Python module.
 See examples/m.distance for an example of a working SWIG-Python module.

+ 15 - 15
swig/python/examples/m.distance

@@ -54,24 +54,24 @@ def main():
     #### add your code here ####
     #### add your code here ####
 
 
     # run this before starting python to append module search path:
     # run this before starting python to append module search path:
-    #   export PYTHONPATH=/usr/src/grass63/swig/python
+    #   export PYTHONPATH=/usr/src/grass70/swig/python
     #   check with "import sys; sys.path"
     #   check with "import sys; sys.path"
     # or:
     # or:
-    sys.path.append("/usr/src/grass63/swig/python")
-    # FIXME: install the g6lib.py bindings in $GISBASE/lib/ ?
-    import python_grass6 as g6lib
+    sys.path.append("/usr/src/grass70/swig/python")
+    # FIXME: install the g7lib.py bindings in $GISBASE/lib/ ?
+    import python_grass7 as g7lib
  
  
     # for passing pointers
     # for passing pointers
     import Numeric
     import Numeric
     import NumPtr
     import NumPtr
 
 
-    g6lib.G_gisinit('m.distance')
+    g7lib.G_gisinit('m.distance')
     # returns 0 on success
     # returns 0 on success
 
 
 
 
     ### calc distance ###
     ### calc distance ###
     
     
-    proj_type = g6lib.G_begin_distance_calculations()
+    proj_type = g7lib.G_begin_distance_calculations()
     # returns 0 if projection has no metrix (ie. imagery)
     # returns 0 if projection has no metrix (ie. imagery)
     # returns 1 if projection is planimetric
     # returns 1 if projection is planimetric
     # returns 2 if projection is latitude-longitude
     # returns 2 if projection is latitude-longitude
@@ -114,8 +114,8 @@ def main():
 
 
         # TODO: for clarity, figure out how to replace "3" with
         # TODO: for clarity, figure out how to replace "3" with
         #       the defined LOCATION_LL constant from gis.i
         #       the defined LOCATION_LL constant from gis.i
-        g6lib.G_scan_easting(coords[0], eastPtr, 3)
-        g6lib.G_scan_northing(coords[1], northPtr, 3)
+        g7lib.G_scan_easting(coords[0], eastPtr, 3)
+        g7lib.G_scan_northing(coords[1], northPtr, 3)
         x1 = float(easting)
         x1 = float(easting)
         y1 = float(northing)
         y1 = float(northing)
     else:
     else:
@@ -129,15 +129,15 @@ def main():
     for i in range(1, (len(coords) / 2)):
     for i in range(1, (len(coords) / 2)):
 
 
         if proj_type == 2:
         if proj_type == 2:
-            g6lib.G_scan_easting (coords[ i*2 + 0 ], eastPtr, 3)
-            g6lib.G_scan_northing(coords[ i*2 + 1 ], northPtr, 3)
+            g7lib.G_scan_easting (coords[ i*2 + 0 ], eastPtr, 3)
+            g7lib.G_scan_northing(coords[ i*2 + 1 ], northPtr, 3)
             x2 = float(easting)
             x2 = float(easting)
             y2 = float(northing)
             y2 = float(northing)
         else:
         else:
             x2 = float(coords[ i*2 + 0 ])
             x2 = float(coords[ i*2 + 0 ])
             y2 = float(coords[ i*2 + 1 ])
             y2 = float(coords[ i*2 + 1 ])
 
 
-        segment_distance = g6lib.G_distance(x1, y1, x2, y2)
+        segment_distance = g7lib.G_distance(x1, y1, x2, y2)
         overall_distance += segment_distance
         overall_distance += segment_distance
 
 
         print "segment %d distance is %.2f meters" % (i, segment_distance)
         print "segment %d distance is %.2f meters" % (i, segment_distance)
@@ -160,7 +160,7 @@ def main():
     if len(coords) < 6:
     if len(coords) < 6:
         return
         return
  
  
-    g6lib.G_begin_polygon_area_calculations()
+    g7lib.G_begin_polygon_area_calculations()
     # returns 0 if the projection is not measurable (ie. imagery or xy)
     # returns 0 if the projection is not measurable (ie. imagery or xy)
     # returns 1 if the projection is planimetric (ie. UTM or SP)
     # returns 1 if the projection is planimetric (ie. UTM or SP)
     # returns 2 if the projection is non-planimetric (ie. latitude-longitude)
     # returns 2 if the projection is non-planimetric (ie. latitude-longitude)
@@ -178,7 +178,7 @@ def main():
     Ys = Numeric.array(y, Numeric.Float64)
     Ys = Numeric.array(y, Numeric.Float64)
     Yptr = NumPtr.getpointer(Ys)
     Yptr = NumPtr.getpointer(Ys)
     
     
-    area = g6lib.G_area_of_polygon(Xptr, Yptr, npoints)
+    area = g7lib.G_area_of_polygon(Xptr, Yptr, npoints)
     print "AREA:  %10.2f square meters" % area
     print "AREA:  %10.2f square meters" % area
     print
     print
 
 
@@ -186,9 +186,9 @@ def main():
     # we don't need this, but just to have a look
     # we don't need this, but just to have a look
     if False:
     if False:
         if proj_type == 1:
         if proj_type == 1:
-            g6lib.G_database_units_to_meters_factor()
+            g7lib.G_database_units_to_meters_factor()
             # 1.0
             # 1.0
-        print "Location units are", g6lib.G_database_unit_name(True)
+        print "Location units are", g7lib.G_database_unit_name(True)
 
 
 
 
     #### end of your code ####
     #### end of your code ####

+ 7 - 7
swig/python/examples/rasteraccess.py

@@ -3,7 +3,7 @@
 # run within GRASS Spearfish session
 # run within GRASS Spearfish session
 
 
 import os, sys
 import os, sys
-import python_grass6 as g6lib
+import python_grass7 as g7lib
 
 
 if not os.environ.has_key("GISBASE"):
 if not os.environ.has_key("GISBASE"):
     print "You must be in GRASS GIS to run this program."
     print "You must be in GRASS GIS to run this program."
@@ -12,17 +12,17 @@ if not os.environ.has_key("GISBASE"):
 input = 'elevation.dem'
 input = 'elevation.dem'
 mapset = 'PERMANENT'
 mapset = 'PERMANENT'
 
 
-g6lib.G_gisinit('')
-infd = g6lib.G_open_cell_old(input, mapset)
+g7lib.G_gisinit('')
+infd = g7lib.G_open_cell_old(input, mapset)
 
 
-cell = g6lib.G_allocate_cell_buf()
+cell = g7lib.G_allocate_cell_buf()
 
 
 rown=0
 rown=0
 while 1:
 while 1:
-    myrow = g6lib.G_get_map_row_nomask(infd, cell, rown)
+    myrow = g7lib.G_get_map_row_nomask(infd, cell, rown)
     print rown,myrow[0:10]
     print rown,myrow[0:10]
     rown = rown+1
     rown = rown+1
     if rown==476:break
     if rown==476:break
 
 
-g6lib.G_close_cell(infd)
-g6lib.G_free(cell)
+g7lib.G_close_cell(infd)
+g7lib.G_free(cell)

+ 14 - 14
swig/python/examples/vectoraccess.py

@@ -3,7 +3,7 @@
 # run within GRASS Spearfish session
 # run within GRASS Spearfish session
 
 
 import os, sys
 import os, sys
-import python_grass6 as g6lib
+import python_grass7 as g7lib
 
 
 if not os.environ.has_key("GISBASE"):
 if not os.environ.has_key("GISBASE"):
     print "You must be in GRASS GIS to run this program."
     print "You must be in GRASS GIS to run this program."
@@ -17,31 +17,31 @@ else:
 mapset = 'PERMANENT'
 mapset = 'PERMANENT'
 
 
 # initialize
 # initialize
-g6lib.G_gisinit('')
+g7lib.G_gisinit('')
 
 
 # define map structure
 # define map structure
-map = g6lib.Map_info()
+map = g7lib.Map_info()
 
 
 # define open level (level 2: topology)
 # define open level (level 2: topology)
-g6lib.Vect_set_open_level (2)
+g7lib.Vect_set_open_level (2)
 
 
 # open existing map
 # open existing map
-g6lib.Vect_open_old(map, input, mapset)
+g7lib.Vect_open_old(map, input, mapset)
 
 
 # query
 # query
 print 'Vect map: ', input
 print 'Vect map: ', input
-print 'Vect is 3D: ', g6lib.Vect_is_3d (map)
-print 'Vect DB links: ', g6lib.Vect_get_num_dblinks(map)
-print 'Map Scale:  1:', g6lib.Vect_get_scale(map)
+print 'Vect is 3D: ', g7lib.Vect_is_3d (map)
+print 'Vect DB links: ', g7lib.Vect_get_num_dblinks(map)
+print 'Map Scale:  1:', g7lib.Vect_get_scale(map)
 # misleading:
 # misleading:
-# print 'Number of lines:', g6lib.Vect_get_num_lines(map)
-print 'Number of points: ', g6lib.Vect_get_num_primitives(map,g6lib.GV_POINT)
+# print 'Number of lines:', g7lib.Vect_get_num_lines(map)
+print 'Number of points: ', g7lib.Vect_get_num_primitives(map,g7lib.GV_POINT)
 # confusing:
 # confusing:
-#print 'Number of lines: ', g6lib.Vect_get_num_primitives(map,g6lib.GV_LINE)
-#print 'Number of areas:', g6lib.Vect_get_num_primitives(map,g6lib.GV_AREA)
-print 'Number of areas:', g6lib.Vect_get_num_areas(map)
+#print 'Number of lines: ', g7lib.Vect_get_num_primitives(map,g7lib.GV_LINE)
+#print 'Number of areas:', g7lib.Vect_get_num_primitives(map,g7lib.GV_AREA)
+print 'Number of areas:', g7lib.Vect_get_num_areas(map)
 
 
 # close map
 # close map
-g6lib.Vect_close(map)
+g7lib.Vect_close(map)
 ## end of the python script
 ## end of the python script
 
 

+ 2 - 2
swig/python/python_grass6.i

@@ -1,4 +1,4 @@
-//File : python_grass6.i
+//File : python_grass7.i
 
 
 %include "carrays.i"
 %include "carrays.i"
 %array_functions(int, intArray);
 %array_functions(int, intArray);
@@ -10,7 +10,7 @@
 %pointer_functions(float, floatp);
 %pointer_functions(float, floatp);
 %pointer_functions(double, doublep);
 %pointer_functions(double, doublep);
 
 
-%module python_grass6
+%module python_grass7
 %{
 %{
 #include <stdio.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdarg.h>

+ 5 - 5
swig/python/test.py

@@ -5,7 +5,7 @@
 
 
 
 
 import os, sys
 import os, sys
-import python_grass6 as g6lib
+import python_grass7 as g7lib
 
 
 if not os.environ.has_key("GISBASE"):
 if not os.environ.has_key("GISBASE"):
     print "You must be in GRASS GIS to run this program."
     print "You must be in GRASS GIS to run this program."
@@ -14,16 +14,16 @@ if not os.environ.has_key("GISBASE"):
 rname = 'elevation.dem'
 rname = 'elevation.dem'
 mapset = 'PERMANENT'
 mapset = 'PERMANENT'
 
 
-g6lib.G_gisinit('')
-g6lib.G_find_cell2(rname,'')
+g7lib.G_gisinit('')
+g7lib.G_find_cell2(rname,'')
 
 
 print mapset
 print mapset
 
 
 print 'prints 0 if map was found'
 print 'prints 0 if map was found'
 
 
 print 'roads:'
 print 'roads:'
-print g6lib.G_raster_map_type('roads',mapset)
+print g7lib.G_raster_map_type('roads',mapset)
 
 
 print 'elevation.dem:'
 print 'elevation.dem:'
-print g6lib.G_raster_map_type(rname,mapset)
+print g7lib.G_raster_map_type(rname,mapset)
 
 

+ 1 - 1
swig/swiglib.dox

@@ -57,7 +57,7 @@ The source code is available here:
 
 
 <ul>
 <ul>
 <li> in <a href="http://grass.osgeo.org/devel/index.php#software">GRASS SVN</a>
 <li> in <a href="http://grass.osgeo.org/devel/index.php#software">GRASS SVN</a>
-<li> in the <a href="http://grass.osgeo.org/grass63/source/snapshot/">weekly SVN snapshot</a> (swig/ subdirectory)
+<li> in the <a href="http://grass.osgeo.org/grass70/source/snapshot/">weekly SVN snapshot</a> (swig/ subdirectory)
 <li> via <a href="http://trac.osgeo.org/grass/browser/grass">SVN TracBrowser interface</a>
 <li> via <a href="http://trac.osgeo.org/grass/browser/grass">SVN TracBrowser interface</a>
 </ul>
 </ul>
 
 

+ 2 - 2
tools/build_html_index.sh

@@ -79,9 +79,9 @@ GPL'ed), image processing and geographic information system (GIS).</p>
 
 
 <h3>Quick Introduction</h3>
 <h3>Quick Introduction</h3>
 
 
-<!-- the files grass6.html & helptext.html file live in lib/init/ -->
+<!-- the files grass7.html & helptext.html file live in lib/init/ -->
 <ul>
 <ul>
-<li><a href=\"grass6.html\">GRASS startup manual page</a></li>
+<li><a href=\"grass7.html\">GRASS startup manual page</a></li>
 <li><a href=\"helptext.html\">How to start with GRASS</a></li>
 <li><a href=\"helptext.html\">How to start with GRASS</a></li>
 <li>Introductions
 <li>Introductions
  <ul>
  <ul>