comparison src/java/de/intevation/mxd/reader/MapReader.java @ 26:3e24fffdf2bb

Moved reader components to reader folder.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 08 Apr 2011 12:26:17 +0200
parents src/java/de/intevation/mxd/MapReader.java@cbd67b1100d8
children e5fdc37f8f94
comparison
equal deleted inserted replaced
25:cbd67b1100d8 26:3e24fffdf2bb
1 //package de.intevation.mxd.reader;
2
3 import java.io.IOException;
4
5 import org.apache.log4j.Logger;
6
7 import com.esri.arcgis.carto.IMap;
8 import com.esri.arcgis.carto.Map;
9 import com.esri.arcgis.geometry.ISpatialReference;
10 import com.esri.arcgis.geometry.ProjectedCoordinateSystem;
11 import com.esri.arcgis.geometry.GeographicCoordinateSystem;
12 import com.esri.arcgis.geometry.IProjection;
13 import com.esri.arcgis.geometry.Projection;
14 /**
15 * Reads map information.
16 *
17 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
18 */
19 public class MapReader{
20
21 //Member
22 IMap map;
23
24 private static final Logger logger = Logger.getLogger(MapReader.class);
25
26 //Constructor
27 public MapReader(IMap map){
28 logger.debug("constructor()");
29 this.map = map;
30 }
31
32
33 //Methods
34
35 /**
36 * Reads the Map attributes.
37 */
38 public void read() throws IOException{
39 logger.debug("read()");
40 ISpatialReference sr = map.getSpatialReference();
41 logger.debug("Instance: " + sr.getClass().toString());
42 if(sr instanceof ProjectedCoordinateSystem){
43 ProjectedCoordinateSystem pcs = (ProjectedCoordinateSystem)sr;
44 Projection p = (Projection)pcs.getProjection();
45 System.out.println("Projection = " + p.getName());
46 }
47 else if(sr instanceof GeographicCoordinateSystem){
48 GeographicCoordinateSystem gcs = (GeographicCoordinateSystem)sr;
49 System.out.println("Name = " + gcs.getName());
50 }
51 }
52 }
53 // 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)