[Liblas-commits] hg: 3 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Nov 1 20:17:34 EDT 2010


changeset 0ffb3912366e in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=0ffb3912366e
summary: avoid geo_gtiffp.h and cpl_serv.h in lasspatialreference.hpp

changeset 94c43e41b2cd in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=94c43e41b2cd
summary: update to latest from GDAL, fixes some cross heap issues

changeset ff4948e28c32 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=ff4948e28c32
summary: forced merge

diffstat:

 .hgignore                              |   1 +
 hobu-config.bat                        |   9 +-
 include/liblas/iterator.hpp            |   3 +
 include/liblas/lasbounds.hpp           |  13 ++++-
 include/liblas/lasspatialreference.hpp |   6 +-
 src/gt_wkt_srs.cpp                     |  90 +++++++++++++++++++++++----------
 src/lasspatialreference.cpp            |  24 +++++---
 7 files changed, 100 insertions(+), 46 deletions(-)

diffs (truncated from 342 to 300 lines):

diff -r 5283f808adf4 -r ff4948e28c32 .hgignore
--- a/.hgignore	Mon Nov 01 15:53:50 2010 -0500
+++ b/.hgignore	Mon Nov 01 19:17:19 2010 -0500
@@ -75,6 +75,7 @@
 test/data/*.dat
 test/data/*.idx
 .dirstamp
+*.dir
 CMakeScripts
 libLAS.xcodeproj
 build/libLAS.build
diff -r 5283f808adf4 -r ff4948e28c32 hobu-config.bat
--- a/hobu-config.bat	Mon Nov 01 15:53:50 2010 -0500
+++ b/hobu-config.bat	Mon Nov 01 19:17:19 2010 -0500
@@ -1,14 +1,14 @@
 @echo off
 
-REM set G="NMake Makefiles"
-set G="Visual Studio 9 2008"
+set G="NMake Makefiles"
+REM set G="Visual Studio 9 2008"
 set LIBLAS=D:\liblas
 set OSGEO4W=C:\OSGeo4W
 set BOOST=D:\boost\boost_1_44
 set ORACLE_HOME=%OSGEO4W%
 REM set BUILD_TYPE=RelWithDebInfo
-REM set BUILD_TYPE=Debug
-set BUILD_TYPE=Release
+set BUILD_TYPE=Debug
+REM set BUILD_TYPE=Release
 
 set PATH=%OSGEO4W%\apps\gdal-dev\bin;%OSGEO4W%\bin;%PATH%
 
@@ -26,4 +26,5 @@
     -DORACLE_INCLUDE_DIR=%ORACLE_HOME%\include ^
     -DORACLE_OCI_LIBRARY=%ORACLE_HOME%\lib\oci.lib ^
     -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
+    -DCMAKE_VERBOSE_FILE=OFF
     %LIBLAS%
\ No newline at end of file
diff -r 5283f808adf4 -r ff4948e28c32 include/liblas/iterator.hpp
--- a/include/liblas/iterator.hpp	Mon Nov 01 15:53:50 2010 -0500
+++ b/include/liblas/iterator.hpp	Mon Nov 01 19:17:19 2010 -0500
@@ -307,6 +307,9 @@
 /// Public specialization of LASWriter output iterator for liblas::LASPoint type.
 typedef writer_iterator<Point> laswriter_iterator;
 
+template class LAS_DLL reader_iterator<Point>;
+template class LAS_DLL writer_iterator<Point>;
+
 } // namespace liblas
 
 #endif // LIBLAS_ITERATOR_HPP_INCLUDED
diff -r 5283f808adf4 -r ff4948e28c32 include/liblas/lasbounds.hpp
--- a/include/liblas/lasbounds.hpp	Mon Nov 01 15:53:50 2010 -0500
+++ b/include/liblas/lasbounds.hpp	Mon Nov 01 19:17:19 2010 -0500
@@ -159,6 +159,13 @@
         if (v > max)
             max = v;
     }
+
+    void grow(Range const& r) 
+    {
+        grow(r.min);
+        grow(r.max);
+    }
+
     T length() const
     {
         return max - min;
@@ -166,7 +173,7 @@
 };
     
 template <typename T>
-class LAS_DLL Bounds
+class Bounds
 {
 public:
 
@@ -578,6 +585,10 @@
 };
 
 
+
 } // namespace liblas
 
+template class LAS_DLL liblas::Range<double>;
+template class LAS_DLL liblas::Bounds<double>;
+
 #endif // ndef LIBLAS_LASBOUNDS_HPP_INCLUDED
diff -r 5283f808adf4 -r ff4948e28c32 include/liblas/lasspatialreference.hpp
--- a/include/liblas/lasspatialreference.hpp	Mon Nov 01 15:53:50 2010 -0500
+++ b/include/liblas/lasspatialreference.hpp	Mon Nov 01 19:17:19 2010 -0500
@@ -54,9 +54,9 @@
 #ifdef HAVE_GDAL
 #include <ogr_srs_api.h>
 #include <cpl_port.h>
-#include <cpl_serv.h>
-#include <geo_tiffp.h>
-#define CPL_ERROR_H_INCLUDED
+//#include <cpl_serv.h>
+//#include <geo_tiffp.h>
+//#define CPL_ERROR_H_INCLUDED
 #include <geo_normalize.h>
 #include <geovalues.h>
 #include <ogr_spatialref.h>
diff -r 5283f808adf4 -r ff4948e28c32 src/gt_wkt_srs.cpp
--- a/src/gt_wkt_srs.cpp	Mon Nov 01 15:53:50 2010 -0500
+++ b/src/gt_wkt_srs.cpp	Mon Nov 01 19:17:19 2010 -0500
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: gt_wkt_srs.cpp 20480 2010-08-28 21:20:15Z rouault $
+ * $Id$
  *
  * Project:  GeoTIFF Driver
  * Purpose:  Implements translation between GeoTIFF normalized projection
@@ -42,7 +42,7 @@
 #include "xtiffio.h"
 #include "cpl_multiproc.h"
 
-CPL_CVSID("$Id: gt_wkt_srs.cpp 20480 2010-08-28 21:20:15Z rouault $")
+CPL_CVSID("$Id$")
 
 CPL_C_START
 int CPL_DLL VSIFCloseL( FILE * );
@@ -65,6 +65,12 @@
 CPLErr CPL_DLL GTIFWktFromMemBuf( int nSize, unsigned char *pabyBuffer, 
                           char **ppszWKT, double *padfGeoTransform,
                           int *pnGCPCount, GDAL_GCP **ppasGCPList );
+
+#undef CSVReadParseLine
+char CPL_DLL  **CSVReadParseLine( FILE *fp);
+#undef CSLDestroy
+void CPL_DLL CPL_STDCALL CSLDestroy(char **papszStrList);
+
 CPL_C_END
 
 TIFF* VSI_TIFFOpen(const char* name, const char* mode);
@@ -102,6 +108,24 @@
                           char	**ppszAngularUnits);
 
 /************************************************************************/
+/*                       GTIFToCPLRecyleString()                        */
+/*                                                                      */
+/*      This changes a string from the libgeotiff heap to the GDAL      */
+/*      heap.                                                           */
+/************************************************************************/
+
+static void GTIFToCPLRecycleString( char **ppszTarget )
+
+{
+    if( *ppszTarget == NULL )
+        return;
+
+    char *pszTempString = CPLStrdup(*ppszTarget);
+    GTIFFreeMemory( *ppszTarget );
+    *ppszTarget = pszTempString;
+}
+
+/************************************************************************/
 /*                          WKTMassageDatum()                           */
 /*                                                                      */
 /*      Massage an EPSG datum name into WMT format.  Also transform     */
@@ -114,14 +138,7 @@
     int		i, j;
     char	*pszDatum;
 
-/* -------------------------------------------------------------------- */
-/*      First copy string and allocate with our CPLStrdup() to so we    */
-/*      know when we are done this function we will have a CPL          */
-/*      string, not a GTIF one.                                         */
-/* -------------------------------------------------------------------- */
-    pszDatum = CPLStrdup(*ppszDatum);
-    GTIFFreeMemory( *ppszDatum );
-    *ppszDatum = pszDatum;
+    pszDatum = *ppszDatum;
     if (pszDatum[0] == '\0')
         return;
 
@@ -179,11 +196,11 @@
 /************************************************************************/
 
 /* For example:
-   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"
+   GTCitationGeoKey (Ascii,215): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision$ $Date$\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: 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)"
+   GeogCitationGeoKey (Ascii,267): "IMAGINE GeoTIFF Support\nCopyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision$ $Date$\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: 20480 $ $Date: 2010-08-28 17:20:15 -0400 (Sat, 28 Aug 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$ $Date$\nUTM Zone 10N\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)"
  
 */
 
@@ -354,23 +371,36 @@
         && hGTIF != NULL 
         && GTIFKeyGet( hGTIF, GeogCitationGeoKey, szGCSName, 0, 
                        sizeof(szGCSName)) )
-      GetGeogCSFromCitation(szGCSName, sizeof(szGCSName),
-                            GeogCitationGeoKey, 
-                          &pszGeogName, &pszDatumName,
-                          &pszPMName, &pszSpheroidName,
-                          &pszAngularUnits);
-
+    {
+        GetGeogCSFromCitation(szGCSName, sizeof(szGCSName),
+                              GeogCitationGeoKey, 
+                              &pszGeogName, &pszDatumName,
+                              &pszPMName, &pszSpheroidName,
+                              &pszAngularUnits);
+    }
+    else
+        GTIFToCPLRecycleString( &pszGeogName );
+        
     if( !pszDatumName )
+    {
       GTIFGetDatumInfo( psDefn->Datum, &pszDatumName, NULL );
+      GTIFToCPLRecycleString( &pszDatumName );
+    }
     if( !pszSpheroidName )
+    {
       GTIFGetEllipsoidInfo( psDefn->Ellipsoid, &pszSpheroidName, NULL, NULL );
+      GTIFToCPLRecycleString( &pszSpheroidName );
+    }
     else
     {
       GTIFKeyGet(hGTIF, GeogSemiMajorAxisGeoKey, &(psDefn->SemiMajor), 0, 1 );
       GTIFKeyGet(hGTIF, GeogInvFlatteningGeoKey, &dfInvFlattening, 0, 1 );
     }
     if( !pszPMName )
-      GTIFGetPMInfo( psDefn->PM, &pszPMName, NULL );
+    {
+        GTIFGetPMInfo( psDefn->PM, &pszPMName, NULL );
+        GTIFToCPLRecycleString( &pszPMName );
+    }
     else
       GTIFKeyGet(hGTIF, GeogPrimeMeridianLongGeoKey, &(psDefn->PMLongToGreenwich), 0, 1 );
     
@@ -379,6 +409,8 @@
       GTIFGetUOMAngleInfo( psDefn->UOMAngle, &pszAngularUnits, NULL );
       if( pszAngularUnits == NULL )
           pszAngularUnits = CPLStrdup("unknown");
+      else
+          GTIFToCPLRecycleString( &pszAngularUnits );
     }
     else
     {
@@ -386,8 +418,8 @@
       aUnitGot = TRUE;
     }
 
-    if( pszDatumName != NULL )            /* was a GTIFFreeMemory'able string */
-        WKTMassageDatum( &pszDatumName ); /* now a CPLFree'able string */
+    if( pszDatumName != NULL )
+        WKTMassageDatum( &pszDatumName );
 
     dfSemiMajor = psDefn->SemiMajor;
     if( dfSemiMajor == 0.0 )
@@ -408,9 +440,10 @@
     }
     if(!pszGeogName || strlen(pszGeogName) == 0)
     {
-      GTIFFreeMemory(pszGeogName);             /* was a GTIFFreeMemory'able string */
-      pszGeogName = CPLStrdup( pszDatumName ); /* now a CPLFree'able string */
+        CPLFree(pszGeogName);
+        pszGeogName = CPLStrdup( pszDatumName );
     }
+
     if(aUnitGot)
       oSRS.SetGeogCS( pszGeogName, pszDatumName, 
                       pszSpheroidName, dfSemiMajor, dfInvFlattening,
@@ -437,9 +470,9 @@
 
     CPLFree( pszGeogName );
     CPLFree( pszDatumName );
-    GTIFFreeMemory( pszPMName );
-    GTIFFreeMemory( pszSpheroidName );
-    GTIFFreeMemory( pszAngularUnits );
+    CPLFree( pszSpheroidName );
+    CPLFree( pszPMName );
+    CPLFree( pszAngularUnits );
         
 /* ==================================================================== */
 /*      Handle projection parameters.                                   */
@@ -895,6 +928,7 @@
     char	**papszTokens;
     int		nReturn = KvUserDefined;
 
+
 /* -------------------------------------------------------------------- */
 /*      Do we know it as a built in?                                    */
 /* -------------------------------------------------------------------- */
@@ -909,7 +943,7 @@
         return Datum_WGS84;
     else if( EQUAL(pszOGCName,"WGS72") || EQUAL(pszOGCName,"WGS_1972") )
         return Datum_WGS72;
-    
+
 /* -------------------------------------------------------------------- */
 /*      Open the table if possible.                                     */


More information about the Liblas-commits mailing list