Revision: 6586
http://sourceforge.net/p/jump-pilot/code/6586
Author: ma15569
Date: 2020-10-08 10:34:26 +0000 (Thu, 08 Oct 2020)
Log Message:
-----------
Added method to get the Envelope form the extension of the grid
Modified Paths:
--------------
core/trunk/src/org/openjump/core/rasterimage/sextante/rasterWrappers/GridExtent.java
Modified:
core/trunk/src/org/openjump/core/rasterimage/sextante/rasterWrappers/GridExtent.java
===================================================================
---
core/trunk/src/org/openjump/core/rasterimage/sextante/rasterWrappers/GridExtent.java
2020-10-08 10:27:49 UTC (rev 6585)
+++
core/trunk/src/org/openjump/core/rasterimage/sextante/rasterWrappers/GridExtent.java
2020-10-08 10:34:26 UTC (rev 6586)
@@ -24,7 +24,9 @@
import org.openjump.core.rasterimage.sextante.ISextanteLayer;
import org.openjump.core.rasterimage.sextante.ISextanteRasterLayer;
+import com.vividsolutions.jts.geom.Envelope;
+
/**
* This class defines a grid system (coordinates and cellsize)
* @author Victor Olaya
@@ -38,9 +40,10 @@
double m_dXMax;
double m_dYMax;
double m_dCellSizeX = 1;
- double m_dCellSizeY = 1;
+ double m_dCellSizeY = 1;
int m_iNX;
int m_iNY;
+ Envelope m_Envelope;
public GridExtent(){}
@@ -109,7 +112,7 @@
public void setCellSize(double cellSizeX, double cellSizeY) {
m_dCellSizeX = cellSizeX;
- m_dCellSizeY = cellSizeY;
+ m_dCellSizeY = cellSizeY;
recalculateNXAndNY();
}
@@ -134,6 +137,15 @@
}
+ /**
+ * Returns the extension of Grid as com.vividsolutions.jts.geom.Envelope
+ * @return Envelope
+ */
+
+ public Envelope getEnvelope() {
+ return m_Envelope;
+ }
+
private void recalculateNXAndNY(){
m_iNY = (int) Math.floor((m_dYMax - m_dYMin) / m_dCellSizeY);
@@ -140,6 +152,9 @@
m_iNX = (int) Math.floor((m_dXMax - m_dXMin) / m_dCellSizeX);
m_dXMax = m_dXMin + m_dCellSizeX * m_iNX;
m_dYMax = m_dYMin + m_dCellSizeY * m_iNY;
+ //Recalculating we get the Envelope, useful when a raster is
saved as
+ //layer
+ m_Envelope = new Envelope(m_dXMin,m_dXMax,m_dYMin, m_dYMax );
}
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel