001: /*
002: * uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004,
003: * Refractions Research Inc. This library is free software; you can redistribute it and/or modify it
004: * under the terms of the GNU Lesser General Public License as published by the Free Software
005: * Foundation; version 2.1 of the License. This library is distributed in the hope that it will be
006: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
007: * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
008: */
009: package net.refractions.udig.project.internal.render.impl;
010:
011: import org.opengis.metadata.extent.Extent;
012: import org.opengis.referencing.crs.CoordinateReferenceSystem;
013:
014: /**
015: * Provides ...TODO summary sentence
016: * <p>
017: * TODO Description
018: * </p>
019: * <p>
020: * Responsibilities:
021: * <ul>
022: * <li>
023: * <li>
024: * </ul>
025: * </p>
026: * <p>
027: * Example Use:
028: *
029: * <pre><code>
030: *
031: * ViewportValidAreaHelper x = new ViewportValidAreaHelper( ... );
032: * TODO code example
033: *
034: * </code></pre>
035: *
036: * </p>
037: *
038: * @author jones
039: * @since 0.3
040: */
041: class ViewportValidAreaHelper {
042: public static Extent createValidArea(CoordinateReferenceSystem crs) {
043: // if( crs instanceof GeographicCoordinateSystem ){
044: // final GeographicCoordinateSystem gcs=(GeographicCoordinateSystem) crs;
045: // return new Extent(){
046: //
047: // public InternationalString getDescription() {
048: // return null;
049: // }
050: //
051: // public GeographicExtent getGeographicElement() {
052: // Envelope bounds=gcs.getDefaultEnvelope();
053: //
054: // double north=90, south=-90, east=180, west=-180;
055: //
056: // for( int i=0; i<gcs.getDimension();i++){
057: // AxisInfo current=gcs.getAxis(i);
058: // if( current.getDirection()==AxisDirection.NORTH ){
059: // north=bounds.getMaximum(i);
060: // south=bounds.getMinimum(i);
061: // }
062: // else if ( current.getDirection()==AxisDirection.SOUTH ){
063: // south=bounds.getMaximum(i);
064: // north=bounds.getMinimum(i);
065: // }
066: // if( current.getDirection()==AxisDirection.EAST ){
067: // east=bounds.getMaximum(i);
068: // west=bounds.getMinimum(i);
069: // }
070: // else if ( current.getDirection()==AxisDirection.WEST ){
071: // west=bounds.getMaximum(i);
072: // east=bounds.getMinimum(i);
073: // }
074: // }
075: // GeographicBoundingBox gbox= new GeographicBoundingBox(west, east, south, north);
076: // gbox.setInclusion(true);
077: // return gbox;
078: // }
079: //
080: // public TemporalExtent getTemporalElement() {
081: // return null;
082: // }
083: //
084: // public VerticalExtent getVerticalElement() {
085: // return null;
086: // }
087: //
088: // };
089: // }
090: // if( crs instanceof ProjectedCoordinateSystem ){
091: // final ProjectedCoordinateSystem pcs=(ProjectedCoordinateSystem) crs;
092: // return new Extent(){
093: //
094: // public InternationalString getDescription() {
095: // return null;
096: // }
097: //
098: // public GeographicExtent getGeographicElement() {
099: // double north=90, south=-90, east=180, west=-180;
100: //
101: // ParameterList params=pcs.getProjection().getParameters();
102: //
103: // ParameterListDescriptor descs=params.getParameterListDescriptor();
104: //
105: // for (int i = 0; i < descs.getParamNames().length; i++) {
106: // String name = descs.getParamNames()[i];
107: // Object obj=params.getObjectParameter(name);
108: // System.out.println(name+" "+obj);
109: // }
110: //
111: // GeographicBoundingBox gbox= new GeographicBoundingBox(west, east, south, north);
112: // gbox.setInclusion(true);
113: // return gbox;
114: // }
115: //
116: // public TemporalExtent getTemporalElement() {
117: // return null;
118: // }
119: //
120: // public VerticalExtent getVerticalElement() {
121: // return null;
122: // }
123: //
124: // };
125: // }
126: return null;
127: }
128:
129: }
|