Issue #2947 Make GridCoverage implement IGridGeometryProvider.

Former-commit-id: f2a204c593f65c67c87e16fa513d00383ad568e5
This commit is contained in:
Ben Steffensmeier 2014-04-11 16:43:10 -05:00
parent 695878c6aa
commit e911a4c917
2 changed files with 6 additions and 14 deletions

View file

@ -99,6 +99,8 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
* made init method public for use in GFEDao * made init method public for use in GFEDao
* 09/30/13 #2333 mschenke Added method to construct from {@link IGridGeometryProvider} * 09/30/13 #2333 mschenke Added method to construct from {@link IGridGeometryProvider}
* 10/22/13 #2361 njensen Remove XML annotations * 10/22/13 #2361 njensen Remove XML annotations
* 04/11/14 #2947 bsteffen Remove ISpatialObject constructor.
*
* *
* *
* </pre> * </pre>
@ -343,19 +345,6 @@ public class GridLocation extends PersistableDataObject<String> implements
"GMT"); "GMT");
} }
/**
* @param id
* @param coverage
*/
public GridLocation(String id, ISpatialObject coverage) {
this.siteId = id;
this.crsObject = coverage.getCrs();
this.crsWKT = this.crsObject.toWKT();
this.geometry = (Polygon) coverage.getGeometry();
this.nx = coverage.getNx();
this.ny = coverage.getNy();
}
/** /**
* @param id * @param id
* @param provider * @param provider

View file

@ -51,6 +51,7 @@ import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.geospatial.CRSCache; import com.raytheon.uf.common.geospatial.CRSCache;
import com.raytheon.uf.common.geospatial.IGridGeometryProvider;
import com.raytheon.uf.common.geospatial.ISpatialObject; import com.raytheon.uf.common.geospatial.ISpatialObject;
import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.gridcoverage.exception.GridCoverageException; import com.raytheon.uf.common.gridcoverage.exception.GridCoverageException;
@ -77,6 +78,7 @@ import com.vividsolutions.jts.geom.Geometry;
* spatial * spatial
* Oct 15, 2013 2473 bsteffen add @XmlSeeAlso for self contained JAXB * Oct 15, 2013 2473 bsteffen add @XmlSeeAlso for self contained JAXB
* context. * context.
* Apr 11, 2014 2947 bsteffen Implement IGridGeometryProvider.
* *
* </pre> * </pre>
* *
@ -93,7 +95,7 @@ import com.vividsolutions.jts.geom.Geometry;
StereographicGridCoverage.class }) StereographicGridCoverage.class })
@DynamicSerialize @DynamicSerialize
public abstract class GridCoverage extends PersistableDataObject<Integer> public abstract class GridCoverage extends PersistableDataObject<Integer>
implements ISpatialObject { implements ISpatialObject, IGridGeometryProvider {
private static final long serialVersionUID = -1355232934065074837L; private static final long serialVersionUID = -1355232934065074837L;
@ -394,6 +396,7 @@ public abstract class GridCoverage extends PersistableDataObject<Integer>
this.description = description; this.description = description;
} }
@Override
public GridGeometry2D getGridGeometry() { public GridGeometry2D getGridGeometry() {
if (gridGeometry == null) { if (gridGeometry == null) {
gridGeometry = MapUtil.getGridGeometry(this); gridGeometry = MapUtil.getGridGeometry(this);