[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Sep 20 22:24:08 EDT 2010


changeset eea8a3c507dc in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=eea8a3c507dc
summary: utilize GDAL's vertcs lookup, enable transformations with vertical datums

changeset d730f1203e92 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=d730f1203e92
summary: some sort of merge crazyness

diffstat:

 doc/_templates/indexsidebar.html |   4 ---
 doc/compilation.txt              |   6 ++--
 src/gt_wkt_srs.cpp               |  41 ++++++++++++++++++++++++++-------------
 src/lasspatialreference.cpp      |   2 +-
 src/lastransform.cpp             |   4 +-
 5 files changed, 33 insertions(+), 24 deletions(-)

diffs (155 lines):

diff -r 400bf7b7c425 -r d730f1203e92 doc/_templates/indexsidebar.html
--- a/doc/_templates/indexsidebar.html	Mon Sep 20 11:41:03 2010 -0500
+++ b/doc/_templates/indexsidebar.html	Mon Sep 20 22:17:44 2010 -0400
@@ -10,10 +10,6 @@
 </p>
 
 <p>
-<a href="http://2010.foss4g.org"><img src="http://2010.foss4g.org/images/logo_125x125.jpg" /></a>
-</p>
-
-<p>
 <script type="text/javascript" src="http://www.ohloh.net/p/10742/widgets/project_thin_badge.js"></script>
 </p>
 
diff -r 400bf7b7c425 -r d730f1203e92 doc/compilation.txt
--- a/doc/compilation.txt	Mon Sep 20 11:41:03 2010 -0500
+++ b/doc/compilation.txt	Mon Sep 20 22:17:44 2010 -0400
@@ -137,9 +137,9 @@
     them::
         
         cd $ORACLE_HOME
-        ln -s libocci.so.10.1 libocci.so
-        ln -s libclntsh.so.10.1 libclntsh.so
-        ln -s libociei.so.10.1 libociei.so
+        ln -s libocci.so.11.1 libocci.so
+        ln -s libclntsh.so.11.1 libclntsh.so
+        ln -s libociei.so.11.1 libociei.so
 
 .. note::
     MSVC should only require the oci.lib and oci.dll library and dlls.
diff -r 400bf7b7c425 -r d730f1203e92 src/gt_wkt_srs.cpp
--- a/src/gt_wkt_srs.cpp	Mon Sep 20 11:41:03 2010 -0500
+++ b/src/gt_wkt_srs.cpp	Mon Sep 20 22:17:44 2010 -0400
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: gt_wkt_srs.cpp 18562 2010-01-16 04:56:05Z warmerdam $
+ * $Id: gt_wkt_srs.cpp 20480 2010-08-28 21:20:15Z rouault $
  *
  * Project:  GeoTIFF Driver
  * Purpose:  Implements translation between GeoTIFF normalized projection
@@ -42,15 +42,9 @@
 #include "xtiffio.h"
 #include "cpl_multiproc.h"
 
-CPL_CVSID("$Id: gt_wkt_srs.cpp 18562 2010-01-16 04:56:05Z warmerdam $")
-
-#if defined(WIN32) 
-#  define EQUALN(a,b,n)           (_strnicmp(a,b,n)==0)
-#  define EQUAL(a,b)              (_stricmp(a,b)==0)
-#endif
+CPL_CVSID("$Id: gt_wkt_srs.cpp 20480 2010-08-28 21:20:15Z rouault $")
 
 CPL_C_START
-void GTiffOneTimeInit();
 int CPL_DLL VSIFCloseL( FILE * );
 int CPL_DLL VSIUnlink( const char * );
 FILE CPL_DLL *VSIFileFromMemBuffer( const char *pszFilename, 
@@ -185,11 +179,11 @@
 /************************************************************************/
 
 /* For example:
-   GTCitationGeoKey (Ascii,215): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 18562 $ $Date: 2010-01-15 23:56:05 -0500 (Fri, 15 Jan 2010) $\nProjection Name = UTM\nUnits = meters\nGeoTIFF Units = meters"
+   GTCitationGeoKey (Ascii,215): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 20480 $ $Date: 2010-08-28 17:20:15 -0400 (Sat, 28 Aug 2010) $\nProjection Name = UTM\nUnits = meters\nGeoTIFF Units = meters"
 
-   GeogCitationGeoKey (Ascii,267): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 18562 $ $Date: 2010-01-15 23:56:05 -0500 (Fri, 15 Jan 2010) $\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
+   GeogCitationGeoKey (Ascii,267): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 20480 $ $Date: 2010-08-28 17:20:15 -0400 (Sat, 28 Aug 2010) $\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
 
-   PCSCitationGeoKey (Ascii,214): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 18562 $ $Date: 2010-01-15 23:56:05 -0500 (Fri, 15 Jan 2010) $\nUTM Zone 10N\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
+   PCSCitationGeoKey (Ascii,214): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 20480 $ $Date: 2010-08-28 17:20:15 -0400 (Sat, 28 Aug 2010) $\nUTM Zone 10N\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
  
 */
 
@@ -656,6 +650,8 @@
     const char *pszFilename = NULL;
     const char *pszValue;
     char szSearchKey[128];
+    bool bNeedManualVertCS = false;
+    char citation[2048];
 
     // Don't do anything if there is no apparent vertical information.
     GTIFKeyGet( hGTIF, VerticalCSTypeGeoKey, &verticalCSType, 0, 1 );
@@ -665,8 +661,6 @@
     if( (verticalCSType != -1 || verticalDatum != -1 || verticalUnits != -1)
         && (oSRS.IsGeographic() || oSRS.IsProjected() || oSRS.IsLocal()) )
     {
-        char citation[2048];
-        
         if( !GTIFKeyGet( hGTIF, VerticalCitationGeoKey, &citation, 
                          0, sizeof(citation) ) )
             strcpy( citation, "unknown" );
@@ -709,11 +703,30 @@
         oSRS.Clear();
         oSRS.SetNode( "COMPD_CS", "unknown" );
         oSRS.GetRoot()->AddChild( poOldRoot );
-        
+
+/* -------------------------------------------------------------------- */
+/*      If we have the vertical cs, try to look it up using the         */
+/*      vertcs.csv file, and use the definition provided by that.       */
+/* -------------------------------------------------------------------- */
+        bNeedManualVertCS = true;
+
+        if( verticalCSType != KvUserDefined && verticalCSType > 0 )
+        {
+            OGRSpatialReference oVertSRS;
+            if( oVertSRS.importFromEPSG( verticalCSType ) == OGRERR_NONE )
+            {
+                oSRS.GetRoot()->AddChild( oVertSRS.GetRoot()->Clone() );
+                bNeedManualVertCS = false;
+            }
+        }
+    }
+
 /* -------------------------------------------------------------------- */
 /*      Collect some information from the VerticalCS if not provided    */
 /*      via geokeys.                                                    */
 /* -------------------------------------------------------------------- */
+    if( bNeedManualVertCS )
+    {
         if( verticalCSType > 0 && verticalCSType != KvUserDefined )
         {
             pszFilename = CSVFilename( "coordinate_reference_system.csv" );
diff -r 400bf7b7c425 -r d730f1203e92 src/lasspatialreference.cpp
--- a/src/lasspatialreference.cpp	Mon Sep 20 11:41:03 2010 -0500
+++ b/src/lasspatialreference.cpp	Mon Sep 20 22:17:44 2010 -0400
@@ -545,7 +545,7 @@
 {
 #ifdef HAVE_GDAL
     
-    std::string wkt = GetWKT();
+    std::string wkt = GetWKT(eCompoundOK);
     const char* poWKT = wkt.c_str();
     
     OGRSpatialReference srs(NULL);
diff -r 400bf7b7c425 -r d730f1203e92 src/lastransform.cpp
--- a/src/lastransform.cpp	Mon Sep 20 11:41:03 2010 -0500
+++ b/src/lastransform.cpp	Mon Sep 20 22:17:44 2010 -0400
@@ -73,7 +73,7 @@
     m_in_ref = OSRNewSpatialReference(0);
     m_out_ref = OSRNewSpatialReference(0);
     
-    int result = OSRSetFromUserInput(m_in_ref, inSRS.GetWKT().c_str());
+    int result = OSRSetFromUserInput(m_in_ref, inSRS.GetWKT(liblas::SpatialReference::eCompoundOK).c_str());
     if (result != OGRERR_NONE) 
     {
         std::ostringstream msg; 
@@ -83,7 +83,7 @@
         throw std::runtime_error(msg.str());
     }
     
-    result = OSRSetFromUserInput(m_out_ref, outSRS.GetWKT().c_str());
+    result = OSRSetFromUserInput(m_out_ref, outSRS.GetWKT(liblas::SpatialReference::eCompoundOK).c_str());
     if (result != OGRERR_NONE) 
     {
         std::ostringstream msg; 


More information about the Liblas-commits mailing list