[Liblas-commits] hg-1.6: fix #220 to notify users about the existence of SRS keys...

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Mar 7 12:44:25 EST 2011


details:   http://hg.liblas.orghg-1.6/rev/0058891eaee5
changeset: 2858:0058891eaee5
user:      Howard Butler <hobu.inc at gmail.com>
date:      Mon Mar 07 11:42:38 2011 -0600
description:
fix #220 to notify users about the existence of SRS keys, but the fact that GeoTIFF/GDAL aren't available to do anything with them

diffstat:

 src/spatialreference.cpp |  35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diffs (51 lines):

diff -r 961c21006361 -r 0058891eaee5 src/spatialreference.cpp
--- a/src/spatialreference.cpp	Thu Feb 24 15:44:33 2011 -0600
+++ b/src/spatialreference.cpp	Mon Mar 07 11:42:38 2011 -0600
@@ -842,12 +842,47 @@
     using liblas::property_tree::ptree;
     ptree srs;
 
+#if defined(HAVE_GDAL)
     srs.put("proj4", GetProj4());
     srs.put("prettywkt", GetWKT(liblas::SpatialReference::eHorizontalOnly, true));
     srs.put("wkt", GetWKT(liblas::SpatialReference::eHorizontalOnly, false));
     srs.put("compoundwkt", GetWKT(eCompoundOK, false));
     srs.put("prettycompoundwkt", GetWKT(eCompoundOK, true));
     srs.put("gtiff", GetGTIFFText());
+#endif
+
+#if defined(HAVE_LIBGEOTIFF) && !defined(HAVE_GDAL)
+
+    std::string message("Reference defined, but GDAL is not available for WKT support");
+    srs.put("proj4", GetProj4());
+    srs.put("prettywkt", message);
+    srs.put("wkt", message);
+    srs.put("compoundwkt", message);
+    srs.put("prettycompoundwkt", message);
+    srs.put("gtiff", GetGTIFFText());
+#endif
+
+#if !defined(HAVE_LIBGEOTIFF) && !defined(HAVE_GDAL)
+
+    std::string message;
+    if (m_vlrs.size() > 0 && m_wkt.size() == 0)
+    {
+        message = "Reference defined with VLR keys, but GeoTIFF and GDAL support are not available to produce definition";
+    } else if (m_wkt.size() > 0)
+    {
+        message = "Reference defined with WKT, but GeoTIFF and GDAL support are not available to produce definition";
+    } else
+    {
+        message = "None";
+    }
+
+    srs.put("proj4", message);
+    srs.put("prettywkt", message);
+    srs.put("wkt", message);
+    srs.put("compoundwkt", message);
+    srs.put("prettycompoundwkt", message);
+    srs.put("gtiff", message);
+#endif
     
     return srs;
     


More information about the Liblas-commits mailing list