Revision 19419 branches/v10/extensions/extPublish/src/org/gvsig/publish/infoproject/datasources/RasterInfo.java
RasterInfo.java | ||
---|---|---|
41 | 41 |
package org.gvsig.publish.infoproject.datasources; |
42 | 42 |
|
43 | 43 |
import java.awt.geom.Rectangle2D; |
44 |
import java.io.File; |
|
44 | 45 |
|
46 |
import org.cresques.cts.ICoordTrans; |
|
45 | 47 |
import org.cresques.cts.IProjection; |
46 | 48 |
import org.gvsig.publish.infoproject.IDataSourceInfo; |
47 | 49 |
|
50 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
|
48 | 51 |
import com.iver.cit.gvsig.fmap.drivers.raster.CmsRasterDriver; |
49 | 52 |
import com.iver.utiles.FileUtils; |
50 | 53 |
|
... | ... | |
72 | 75 |
return driver.getNumBands(); |
73 | 76 |
} |
74 | 77 |
|
75 |
public Rectangle2D getBBox() { |
|
78 |
public Rectangle2D getNativeBBox() {
|
|
76 | 79 |
return extent; |
77 | 80 |
} |
78 | 81 |
/** |
... | ... | |
129 | 132 |
} |
130 | 133 |
|
131 | 134 |
|
132 |
|
|
135 |
/** |
|
136 |
* |
|
137 |
* @see org.gvsig.publish.infoproject.IDataSourceInfo#getLatLonBBox() |
|
138 |
*/ |
|
139 |
public Rectangle2D getLatLonBBox() { |
|
140 |
IProjection proj_source = CRSFactory.getCRS(getEPSG()); |
|
141 |
IProjection proj_dest = CRSFactory.getCRS("EPSG:4326"); |
|
142 |
ICoordTrans trans = proj_source.getCT(proj_dest); |
|
143 |
return trans.convert(getNativeBBox()); |
|
144 |
} |
|
145 |
/** |
|
146 |
* the datastore is the file itself |
|
147 |
* @return file name |
|
148 |
* @see org.gvsig.publish.infoproject.IDataSourceInfo#getConnectionName() |
|
149 |
*/ |
|
150 |
public String getConnectionName() { |
|
151 |
return getFileName(); |
|
152 |
} |
|
153 |
/* |
|
154 |
* (non-Javadoc) |
|
155 |
* @see org.gvsig.publish.infoproject.datasources.IFileInfo#getFile() |
|
156 |
*/ |
|
157 |
public File getFile() { |
|
158 |
return driver.getFile(); |
|
159 |
} |
|
160 |
/* |
|
161 |
* (non-Javadoc) |
|
162 |
* @see org.gvsig.publish.infoproject.datasources.IFileInfo#getFilenameWithoutExtension() |
|
163 |
*/ |
|
164 |
public String getFilenameWithoutExtension() { |
|
165 |
String[] aux = getFileName().split("."); |
|
166 |
if (aux.length > 0){ |
|
167 |
return aux[1]; |
|
168 |
}else{ |
|
169 |
return null; |
|
170 |
} |
|
171 |
} |
|
133 | 172 |
} |
Also available in: Unified diff