[Schmitzm-commits] r240 - in trunk/src: schmitzm/geotools/io skrueger

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jul 28 10:49:06 CEST 2009


Author: alfonx
Date: 2009-07-28 10:49:05 +0200 (Tue, 28 Jul 2009)
New Revision: 240

Removed:
   trunk/src/skrueger/jnlp/
Modified:
   trunk/src/schmitzm/geotools/io/GeoExportUtil.java
Log:
* Moved JNLPUtil back to Atlas-Framework-project because it would pull an extra JAR into SCHMITZM.
* GP-BugFix: Some fine-tuning with the default CRS stuff
* Fixed comments in AtlasML.xsd


Modified: trunk/src/schmitzm/geotools/io/GeoExportUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/io/GeoExportUtil.java	2009-07-28 08:46:47 UTC (rev 239)
+++ trunk/src/schmitzm/geotools/io/GeoExportUtil.java	2009-07-28 08:49:05 UTC (rev 240)
@@ -217,17 +217,23 @@
   }
 
   /**
-   * Schreibt ein Projektions-File (.prj) fuer ein {@link CoordinateReferenceSystem}.
-   * @param crs Koordinaten-System
-   * @param output Datei in die die Projektion geschrieben wird
-   * @exception IOException falls die Datei nicht geschrieben werden kann
-   */
-  public static void writeProjectionFile(CoordinateReferenceSystem crs, File output) throws IOException {
-    PrintWriter out = new PrintWriter(output);
-    out.println( crs.toWKT() );
-    out.flush();
-    out.close();
-  }
+	 * Schreibt ein Projektions-File (.prj) fuer ein
+	 * {@link CoordinateReferenceSystem}.
+	 * 
+	 * @param crs
+	 *            Koordinaten-System
+	 * @param output
+	 *            Datei in die die Projektion geschrieben wird
+	 * @exception IOException
+	 *                falls die Datei nicht geschrieben werden kann
+	 */
+	public static void writeProjectionFile(CoordinateReferenceSystem crs,
+			File output) throws IOException {
+		PrintWriter out = new PrintWriter(output);
+		out.println(crs.toWKT());
+		out.flush();
+		out.close();
+	}
   
 
   /**
@@ -245,35 +251,36 @@
 	public static void writeProjectionFilePrefereEPSG(
 			CoordinateReferenceSystem crs, File output) throws IOException {
 		PrintWriter out = new PrintWriter(output);
-		
+
 		try {
-			
-		String whatToWrite = null;
 
-		/**
-		 * LetIf we can determine the EPSG code for this, let's save it as
-		 * "EPSG:12345" to the file.
-		 */
-		if (!crs.getIdentifiers().isEmpty()) {
-			Object next = crs.getIdentifiers().iterator().next();
-			if (next instanceof Identifier) {
-				Identifier identifier = (Identifier) next;
-				if (identifier.getAuthority().getTitle().equals(
-						"European Petroleum Survey Group")) {
-					whatToWrite = "EPSG:" + identifier.getCode();
+			String whatToWrite = null;
+
+			/**
+			 * LetIf we can determine the EPSG code for this, let's save it as
+			 * "EPSG:12345" to the file.
+			 */
+			if (!crs.getIdentifiers().isEmpty()) {
+				Object next = crs.getIdentifiers().iterator().next();
+				if (next instanceof Identifier) {
+					Identifier identifier = (Identifier) next;
+					if (identifier.getAuthority().getTitle().toString().equals(
+							"European Petroleum Survey Group")
+							|| identifier.toString().startsWith("EPSG:")) {
+						whatToWrite = "EPSG:" + identifier.getCode();
+					}
 				}
 			}
-		}
 
-		if (whatToWrite == null) {
-			/*
-			 * If we don't know the EPSG code for the CRS, save it as WKT
-			 */
-			whatToWrite = crs.toWKT();
-		}
+			if (whatToWrite == null) {
+				/*
+				 * If we don't know the EPSG code for the CRS, save it as WKT
+				 */
+				whatToWrite = crs.toWKT();
+			}
 
-		out.println(whatToWrite);
-		out.flush();
+			out.println(whatToWrite);
+			out.flush();
 		} finally {
 			out.close();
 		}



More information about the Schmitzm-commits mailing list