comparison src/java/de/intevation/mxd/reader/FeatureLayerReader.java @ 246:87e92debc53f

Added extent and projection as ows metadata to the mapfile.
author raimund renkert <raimund.renkert@intevation.de>
date Wed, 10 Aug 2011 13:18:53 +0200
parents df4e0946ef02
children 191b7d18c79e
comparison
equal deleted inserted replaced
245:2eeeae07aaa2 246:87e92debc53f
27 import com.esri.arcgis.carto.IAnnotateLayerProperties; 27 import com.esri.arcgis.carto.IAnnotateLayerProperties;
28 import com.esri.arcgis.carto.LabelEngineLayerProperties; 28 import com.esri.arcgis.carto.LabelEngineLayerProperties;
29 import com.esri.arcgis.geodatabase.FeatureClassName; 29 import com.esri.arcgis.geodatabase.FeatureClassName;
30 import com.esri.arcgis.system.IName; 30 import com.esri.arcgis.system.IName;
31 import com.esri.arcgis.system.IPropertySet; 31 import com.esri.arcgis.system.IPropertySet;
32 import com.esri.arcgis.geometry.Envelope;
33
32 import org.w3c.dom.Element; 34 import org.w3c.dom.Element;
33 35
34 import de.intevation.mxd.utils.MapToXMLUtils; 36 import de.intevation.mxd.utils.MapToXMLUtils;
35 import java.io.IOException; 37 import java.io.IOException;
36 import com.esri.arcgis.interop.AutomationException; 38 import com.esri.arcgis.interop.AutomationException;
206 " Stopped reading layer " + layer.getName() + "."); 208 " Stopped reading layer " + layer.getName() + ".");
207 util.removeLayer(layerElement); 209 util.removeLayer(layerElement);
208 return null; 210 return null;
209 } 211 }
210 212
213 try {
214 Envelope rect = (Envelope)layer.getExtent();
215 layerElement.setAttribute(
216 "extent_min_x",
217 String.valueOf(rect.getXMin ()));
218 layerElement.setAttribute(
219 "extent_max_x",
220 String.valueOf(rect.getXMax()));
221 layerElement.setAttribute(
222 "extent_y_min",
223 String.valueOf(rect.getYMin()));
224 layerElement.setAttribute(
225 "extent_y_max",
226 String.valueOf(rect.getYMax()));
227 }
228 catch(IOException ioe) {
229 logger.warn(
230 "Could not read extent from layer "
231 + layer.getName() + ".");
232 }
211 try { 233 try {
212 String datatype = layer.getDataSourceType(); 234 String datatype = layer.getDataSourceType();
213 if(layer.getWorkspace().getType() == 0) { 235 if(layer.getWorkspace().getType() == 0) {
214 layerElement.setAttribute("connection_type", "local"); 236 layerElement.setAttribute("connection_type", "local");
215 layerElement.setAttribute( 237 layerElement.setAttribute(
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)