diff src/java/de/intevation/mxd/MapReader.java @ 25:cbd67b1100d8

Initial commit of the first prototype.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 08 Apr 2011 11:47:59 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java/de/intevation/mxd/MapReader.java	Fri Apr 08 11:47:59 2011 +0200
@@ -0,0 +1,53 @@
+//package de.intevation.mxd;
+
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+
+import com.esri.arcgis.carto.IMap;
+import com.esri.arcgis.carto.Map;
+import com.esri.arcgis.geometry.ISpatialReference;
+import com.esri.arcgis.geometry.ProjectedCoordinateSystem;
+import com.esri.arcgis.geometry.GeographicCoordinateSystem;
+import com.esri.arcgis.geometry.IProjection;
+import com.esri.arcgis.geometry.Projection;
+/**
+ * Reads map information.
+ *
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class MapReader{
+
+    //Member
+    IMap map;
+
+    private static final Logger logger = Logger.getLogger(MapReader.class);
+
+    //Constructor
+    public MapReader(IMap map){
+        logger.debug("constructor()");
+        this.map = map;
+    }
+
+
+    //Methods
+
+    /**
+     * Reads the Map attributes.
+     */
+    public void read() throws IOException{
+        logger.debug("read()");
+        ISpatialReference sr = map.getSpatialReference();
+        logger.debug("Instance: " + sr.getClass().toString());
+        if(sr instanceof ProjectedCoordinateSystem){
+            ProjectedCoordinateSystem pcs = (ProjectedCoordinateSystem)sr;
+            Projection p = (Projection)pcs.getProjection();
+            System.out.println("Projection       = " + p.getName());
+        }
+        else if(sr instanceof GeographicCoordinateSystem){
+            GeographicCoordinateSystem gcs = (GeographicCoordinateSystem)sr;
+            System.out.println("Name             = " + gcs.getName());
+        }
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)