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

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


details:   http://hg.liblas.orghg/rev/1eb4a894350e
changeset: 2896:1eb4a894350e
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 ffb0c24febce -r 1eb4a894350e src/spatialreference.cpp
--- a/src/spatialreference.cpp	Fri Mar 04 21:30:13 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