Revision: 4921
          http://sourceforge.net/p/jump-pilot/code/4921
Author:   ma15569
Date:     2016-05-23 10:03:05 +0000 (Mon, 23 May 2016)
Log Message:
-----------
Workaround if projection definition uses other syntax than WKT or contains 
different information

Modified Paths:
--------------
    core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java

Modified: core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java
===================================================================
--- core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java      
2016-05-21 17:33:58 UTC (rev 4920)
+++ core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java      
2016-05-23 10:03:05 UTC (rev 4921)
@@ -434,13 +434,14 @@
      * @return <String> - SRS definition
      */
     private static String decodeProjDescription(String textProj) {
+      String prjname = "";
+      try {
       // Workaround if aux.xml has been download from web.
       // convert HTML quotes [&quot;] to ["]
       textProj = textProj.replaceAll("&quot;", "\"");
         int start = textProj.indexOf("[\"");
         int end = textProj.indexOf("\",", start);
-        String prjname = "";
-        prjname = textProj.substring(start + 2, end);
+         prjname = textProj.substring(start + 2, end);
         // The following set of replacements allows to "harmonize" OGC, ESRI 
and
         // few other WKT projection definitions
         prjname = prjname.replaceAll("_", " ").replace(" / ", " ")
@@ -461,8 +462,12 @@
                 .replace("\\bParis\\b", "(Paris)")
                 .replace("\\bFerro\\b", "(Ferro)");
 
-        return prjname;
-    }
+      } catch (Exception ex) {
+          // If there is other info than a WKT definition in the aux file
+          prjname = NOT_RECOGNIZED;
+      }
+      return prjname;
+  }
 
     /**
      * returns OGC WKT string located between projection tags (<WKT> or <SRS>)


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to