[Liblas-commits] hg: update tests to track GDAL 1.9+ output

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Jun 23 11:43:39 EDT 2011


details:   http://hg.liblas.orghg/rev/b0a7356977d5
changeset: 3000:b0a7356977d5
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Jun 23 10:43:11 2011 -0500
description:
update tests to track GDAL 1.9+ output
Subject: hg: detect LASzip by default and update GDAL requirement to 1.7.0 #235 and #234

details:   http://hg.liblas.orghg/rev/9d11e09e3dad
changeset: 3001:9d11e09e3dad
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Jun 23 10:43:33 2011 -0500
description:
detect LASzip by default and update GDAL requirement to 1.7.0 #235 and #234

diffstat:

 CMakeLists.txt            |  53 ++++++++++++++++------------------------------
 python/tests/Header.txt   |   2 +-
 python/tests/SRS-GDAL.txt |   2 +-
 3 files changed, 21 insertions(+), 36 deletions(-)

diffs (99 lines):

diff -r bc17a199464d -r 9d11e09e3dad CMakeLists.txt
--- a/CMakeLists.txt	Thu Jun 23 09:53:22 2011 -0500
+++ b/CMakeLists.txt	Thu Jun 23 10:43:33 2011 -0500
@@ -192,30 +192,31 @@
 mark_as_advanced(CLEAR Boost_LIBRARY_DIRS) 
 link_directories(${Boost_LIBRARY_DIRS}) 
 
+# LASZIP support - optional, default=ON
+set(WITH_LASZIP FALSE CACHE BOOL "Choose if LASzip support should be built")
+set(WITH_STATIC_LASZIP FALSE CACHE BOOL "Choose of LASzip should be statically linked")
+mark_as_advanced(WITH_STATIC_LASZIP)
+
+find_package(LASzip 2.0.0)
+if(LASZIP_FOUND)    
+    set(CMAKE_REQUIRED_LIBRARIES ${LASZIP_LIBRARY})
+    include_directories(${LASZIP_INCLUDE_DIR})
+    add_definitions(-DHAVE_LASZIP=1)
+    mark_as_advanced(CLEAR LASZIP_INCLUDE_DIR) 
+    mark_as_advanced(CLEAR LASZIP_LIBRARY) 
+    mark_as_advanced(CLEAR LASZIP_VERSION) 
+    set(WITH_LASZIP TRUE CACHE BOOL "Choose if LASzip support should be built" FORCE)
+endif()
+
 
 # GDAL/OGR support - optional, default=OFF
 set(WITH_GDAL FALSE CACHE BOOL "Choose if GDAL support should be built")
 
 if(WITH_GDAL)
 
-  find_package(GDAL 1.6.0)
-
-  # if(GDAL_FOUND)
-  #   # Confirm required API is available
-  #   include(CheckFunctionExists) 
-  #   set(CMAKE_REQUIRED_LIBRARIES ${GDAL_LIBRARY})
-  #   check_function_exists(OSRSetEquirectangular2 HAVE_OSRSETEQUIRECTANGULAR2)
-  #   
-  #   if(NOT HAVE_OSRSETEQUIRECTANGULAR2)
-  #     # Reset to NOT found for GDAL/OGR
-  #     set(GDAL_FOUND)
-  #     message(FATAL_ERROR
-  #       "Unable to find OSRSetEquirectangular2 within GDAL library at ${GDAL_INCLUDE_DIR} ${GDAL_LIBRARY}")
-  #   else()
-      include_directories(${GDAL_INCLUDE_DIR})
-      add_definitions(-DHAVE_GDAL=1)
-  #   endif()
-  # endif()
+  find_package(GDAL 1.7.0)
+  include_directories(${GDAL_INCLUDE_DIR})
+  add_definitions(-DHAVE_GDAL=1)
 
   mark_as_advanced(CLEAR GDAL_INCLUDE_DIR) 
   mark_as_advanced(CLEAR GDAL_LIBRARY) 
@@ -280,23 +281,7 @@
   endif()
 endif()
 
-# LASZIP support - optional, default=OFF
-set(WITH_LASZIP FALSE CACHE BOOL "Choose if LASzip support should be built")
-set(WITH_STATIC_LASZIP FALSE CACHE BOOL "Choose of LASzip should be statically linked")
-mark_as_advanced(WITH_STATIC_LASZIP)
 
-if(WITH_LASZIP)
-  find_package(LASzip 2.0.0)
-
-  if(LASZIP_FOUND)    
-    set(CMAKE_REQUIRED_LIBRARIES ${LASZIP_LIBRARY})
-    include_directories(${LASZIP_INCLUDE_DIR})
-    add_definitions(-DHAVE_LASZIP=1)
-    mark_as_advanced(CLEAR LASZIP_INCLUDE_DIR) 
-    mark_as_advanced(CLEAR LASZIP_LIBRARY) 
-    mark_as_advanced(CLEAR LASZIP_VERSION) 
-  endif()
-endif()
 
 if(WITH_ENDIANAWARE)
     add_definitions(-DLIBLAS_ENDIAN_AWARE=1)
diff -r bc17a199464d -r 9d11e09e3dad python/tests/Header.txt
--- a/python/tests/Header.txt	Thu Jun 23 09:53:22 2011 -0500
+++ b/python/tests/Header.txt	Thu Jun 23 10:43:33 2011 -0500
@@ -120,4 +120,4 @@
   20
   
   >>> h.xml
-  '<?xml version="1.0" encoding="utf-8"?>\n<filesignature>LASF</filesignature><projectdid>00000000-0000-0000-0000-000000000000</projectdid><systemid>Python</systemid><softwareid>hobuhobuhobuhobuhobuhobuhobuhob</softwareid><version>1.2</version><filesourceid>0</filesourceid><reserved>0</reserved><srs><proj4>None</proj4><prettywkt>None</prettywkt><wkt>None</wkt><compoundwkt>None</compoundwkt><prettycompoundwkt>None</prettycompoundwkt><gtiff>None</gtiff></srs><date>78/2008</date><size>227</size><dataoffset>742</dataoffset><count>42</count><dataformatid>0</dataformatid><datarecordlength>20</datarecordlength><compressed>false</compressed><returns><return><id>0</id><count>1341235</count></return><return><id>1</id><count>3412341222</count></return><return><id>2</id><count>0</count></return><return><id>3</id><count>0</count></return><return><id>4</id><count>4321</count></return></returns><scale><x>0.5</x><y>0.5</y><z>0.001</z></scale><offset><x>32</x><y>32</y><z>256</z></offset><min
 imum><x>33452344.2333</x><y>523442.344</y><z>-90.99299999999999</z></minimum><maximum><x>33452344.2333</x><y>523442.344</y><z>-90.99299999999999</z></maximum><schema><LASSchema><dimensions><dimension><name>X</name><description>x coordinate as a long integer.  You must use the scale and offset information of the header to determine the double value.</description><position>0</position><active>1</active><size>32</size><integer>1</integer><signed>1</signed><required>1</required><byteoffset>0</byteoffset><bitoffset>0</bitoffset><bytesize>4</bytesize></dimension><dimension><name>Y</name><description>y coordinate as a long integer.  You must use the scale and offset information of the header to determine the double value.</description><position>1</position><active>1</active><size>32</size><integer>1</integer><signed>1</signed><required>1</required><byteoffset>4</byteoffset><bitoffset>0</bitoffset><bytesize>4</bytesize></dimension><dimension><name>Z</name><description>z coordinate a
 s a long integer.  You must use the scale and offset information of the header to determine the double value.</description><position>2</position><active>1</active><size>32</size><integer>1</integer><signed>1</signed><required>1</required><byteoffset>8</byteoffset><bitoffset>0</bitoffset><bytesize>4</bytesize></dimension><dimension><name>Intensity</name><description>The intensity value is the integer representation of the pulse return magnitude. This value is optional and system specific. However, it should always be included if available.</description><position>3</position><active>1</active><size>16</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>12</byteoffset><bitoffset>0</bitoffset><bytesize>2</bytesize></dimension><dimension><name>Return Number</name><description>Return Number: The Return Number is the pulse return number for a given output pulse. A given output laser pulse can have many returns, and they must be marked in sequence of return
 . The first return will have a Return Number of one, the second a Return Number of two, and so on up to five returns.</description><position>4</position><active>1</active><size>3</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>14</byteoffset><bitoffset>3</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Number of Returns</name><description>Number of Returns (for this emitted pulse): The Number of Returns is the total number of returns for a given pulse. For example, a laser data point may be return two (Return Number) within a total number of five returns.</description><position>5</position><active>1</active><size>3</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>14</byteoffset><bitoffset>6</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Scan Direction</name><description>The Scan Direction Flag denotes the direction at which the scanner mirror was traveling at the time of the output pulse. 
 A bit value of 1 is a positive scan direction, and a bit value of 0 is a negative scan direction (where positive scan direction is a scan moving from the left side of the in-track direction to the right side and negative the opposite). </description><position>6</position><active>1</active><size>1</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>14</byteoffset><bitoffset>7</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Flightline Edge</name><description>The Edge of Flight Line data bit has a value of 1 only when the point is at the end of a scan. It is the last point on a given scan line before it changes direction.</description><position>7</position><active>1</active><size>1</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>14</byteoffset><bitoffset>8</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Classification</name><description>Classification in LAS 1.0 was essentially user defined and 
 optional. LAS 1.1 defines a standard set of ASPRS classifications. In addition, the field is now mandatory. If a point has never been classified, this byte must be set to zero. There are no user defined classes since both point format 0 and point format 1 supply 8 bits per point for user defined operations. Note that the format for classification is a bit encoded field with the lower five bits used for class and the three high bits used for flags.</description><position>8</position><active>1</active><size>8</size><integer>0</integer><signed>0</signed><required>1</required><byteoffset>15</byteoffset><bitoffset>0</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Scan Angle Rank</name><description>The Scan Angle Rank is a signed one-byte number with a valid range from -90 to +90. The Scan Angle Rank is the angle (rounded to the nearest integer in the absolute value sense) at which the laser point was output from the laser system including the roll of the aircraft. T
 he scan angle is within 1 degree of accuracy from +90 to -90 degrees. The scan angle is an angle based on 0 degrees being nadir, and -90 degrees to the left side of the aircraft in the direction of flight.</description><position>9</position><active>1</active><size>8</size><integer>1</integer><signed>1</signed><required>1</required><byteoffset>16</byteoffset><bitoffset>0</bitoffset><bytesize>1</bytesize></dimension><dimension><name>User Data</name><description>This field may be used at the user&apos;s discretion</description><position>10</position><active>1</active><size>8</size><integer>0</integer><signed>0</signed><required>1</required><byteoffset>17</byteoffset><bitoffset>0</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Point Source ID</name><description>This value indicates the file from which this point originated. Valid values for this field are 1 to 65,535 inclusive with zero being used for a special case discussed below. The numerical value corresponds 
 to the File Source ID from which this point originated. Zero is reserved as a convenience to system implementers. A Point Source ID of zero implies that this point originated in this file. This implies that processing software should set the Point Source ID equal to the File Source ID of the file containing this point at some time during processing. </description><position>11</position><active>1</active><size>16</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>18</byteoffset><bitoffset>0</bitoffset><bytesize>2</bytesize></dimension></dimensions><version>1.0</version><liblas>1.7.0</liblas><formatid>0</formatid></LASSchema></schema>'
+  '<?xml version="1.0" encoding="utf-8"?>\n<filesignature>LASF</filesignature><projectdid>00000000-0000-0000-0000-000000000000</projectdid><systemid>Python</systemid><softwareid>hobuhobuhobuhobuhobuhobuhobuhob</softwareid><version>1.2</version><filesourceid>0</filesourceid><reserved>0</reserved><srs><proj4/><prettywkt/><wkt/><compoundwkt/><prettycompoundwkt/><gtiff>Geotiff_Information:\n   Version: 1\n   Key_Revision: 1.0\n   Tagged_Information:\n      End_Of_Tags.\n   Keyed_Information:\n      End_Of_Keys.\n   End_Of_Geotiff.\n</gtiff></srs><date>78/2008</date><size>227</size><dataoffset>742</dataoffset><count>42</count><dataformatid>0</dataformatid><datarecordlength>20</datarecordlength><compressed>false</compressed><returns><return><id>0</id><count>1341235</count></return><return><id>1</id><count>3412341222</count></return><return><id>2</id><count>0</count></return><return><id>3</id><count>0</count></return><return><id>4</id><count>4321</count></return></returns><scale><x
 >0.5</x><y>0.5</y><z>0.001</z></scale><offset><x>32</x><y>32</y><z>256</z></offset><minimum><x>33452344.2333</x><y>523442.344</y><z>-90.99299999999999</z></minimum><maximum><x>33452344.2333</x><y>523442.344</y><z>-90.99299999999999</z></maximum><schema><LASSchema><dimensions><dimension><name>X</name><description>x coordinate as a long integer.  You must use the scale and offset information of the header to determine the double value.</description><position>0</position><active>1</active><size>32</size><integer>1</integer><signed>1</signed><required>1</required><byteoffset>0</byteoffset><bitoffset>0</bitoffset><bytesize>4</bytesize></dimension><dimension><name>Y</name><description>y coordinate as a long integer.  You must use the scale and offset information of the header to determine the double value.</description><position>1</position><active>1</active><size>32</size><integer>1</integer><signed>1</signed><required>1</required><byteoffset>4</byteoffset><bitoffset>0</bitoffset
 ><bytesize>4</bytesize></dimension><dimension><name>Z</name><description>z coordinate as a long integer.  You must use the scale and offset information of the header to determine the double value.</description><position>2</position><active>1</active><size>32</size><integer>1</integer><signed>1</signed><required>1</required><byteoffset>8</byteoffset><bitoffset>0</bitoffset><bytesize>4</bytesize></dimension><dimension><name>Intensity</name><description>The intensity value is the integer representation of the pulse return magnitude. This value is optional and system specific. However, it should always be included if available.</description><position>3</position><active>1</active><size>16</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>12</byteoffset><bitoffset>0</bitoffset><bytesize>2</bytesize></dimension><dimension><name>Return Number</name><description>Return Number: The Return Number is the pulse return number for a given output pulse. A given 
 output laser pulse can have many returns, and they must be marked in sequence of return. The first return will have a Return Number of one, the second a Return Number of two, and so on up to five returns.</description><position>4</position><active>1</active><size>3</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>14</byteoffset><bitoffset>3</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Number of Returns</name><description>Number of Returns (for this emitted pulse): The Number of Returns is the total number of returns for a given pulse. For example, a laser data point may be return two (Return Number) within a total number of five returns.</description><position>5</position><active>1</active><size>3</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>14</byteoffset><bitoffset>6</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Scan Direction</name><description>The Scan Direction Flag denotes th
 e direction at which the scanner mirror was traveling at the time of the output pulse. A bit value of 1 is a positive scan direction, and a bit value of 0 is a negative scan direction (where positive scan direction is a scan moving from the left side of the in-track direction to the right side and negative the opposite). </description><position>6</position><active>1</active><size>1</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>14</byteoffset><bitoffset>7</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Flightline Edge</name><description>The Edge of Flight Line data bit has a value of 1 only when the point is at the end of a scan. It is the last point on a given scan line before it changes direction.</description><position>7</position><active>1</active><size>1</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>14</byteoffset><bitoffset>8</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Classi
 fication</name><description>Classification in LAS 1.0 was essentially user defined and optional. LAS 1.1 defines a standard set of ASPRS classifications. In addition, the field is now mandatory. If a point has never been classified, this byte must be set to zero. There are no user defined classes since both point format 0 and point format 1 supply 8 bits per point for user defined operations. Note that the format for classification is a bit encoded field with the lower five bits used for class and the three high bits used for flags.</description><position>8</position><active>1</active><size>8</size><integer>0</integer><signed>0</signed><required>1</required><byteoffset>15</byteoffset><bitoffset>0</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Scan Angle Rank</name><description>The Scan Angle Rank is a signed one-byte number with a valid range from -90 to +90. The Scan Angle Rank is the angle (rounded to the nearest integer in the absolute value sense) at which
  the laser point was output from the laser system including the roll of the aircraft. The scan angle is within 1 degree of accuracy from +90 to -90 degrees. The scan angle is an angle based on 0 degrees being nadir, and -90 degrees to the left side of the aircraft in the direction of flight.</description><position>9</position><active>1</active><size>8</size><integer>1</integer><signed>1</signed><required>1</required><byteoffset>16</byteoffset><bitoffset>0</bitoffset><bytesize>1</bytesize></dimension><dimension><name>User Data</name><description>This field may be used at the user&apos;s discretion</description><position>10</position><active>1</active><size>8</size><integer>0</integer><signed>0</signed><required>1</required><byteoffset>17</byteoffset><bitoffset>0</bitoffset><bytesize>1</bytesize></dimension><dimension><name>Point Source ID</name><description>This value indicates the file from which this point originated. Valid values for this field are 1 to 65,535 inclusive wi
 th zero being used for a special case discussed below. The numerical value corresponds to the File Source ID from which this point originated. Zero is reserved as a convenience to system implementers. A Point Source ID of zero implies that this point originated in this file. This implies that processing software should set the Point Source ID equal to the File Source ID of the file containing this point at some time during processing. </description><position>11</position><active>1</active><size>16</size><integer>1</integer><signed>0</signed><required>1</required><byteoffset>18</byteoffset><bitoffset>0</bitoffset><bytesize>2</bytesize></dimension></dimensions><version>1.0</version><liblas>1.7.0</liblas><formatid>0</formatid></LASSchema></schema>'
\ No newline at end of file
diff -r bc17a199464d -r 9d11e09e3dad python/tests/SRS-GDAL.txt
--- a/python/tests/SRS-GDAL.txt	Thu Jun 23 09:53:22 2011 -0500
+++ b/python/tests/SRS-GDAL.txt	Thu Jun 23 10:43:33 2011 -0500
@@ -7,7 +7,7 @@
   >>> s.proj4
   ''
   >>> s.proj4 = '+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs'
-  >>> s.proj4 == '+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs '
+  >>> s.proj4 == '+proj=utm +zone=15 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '
   True
   
   >>> s = srs.SRS()


More information about the Liblas-commits mailing list