Revision 5905 org.gvsig.raster.gdal/trunk/org.gvsig.raster.gdal/org.gvsig.raster.gdal.io/src/main/java/org/gvsig/raster/gdal/io/GdalProvider.java
GdalProvider.java | ||
---|---|---|
302 | 302 |
setColorInterpretation(file.colorInterpr); |
303 | 303 |
setColorTable(file.palette); |
304 | 304 |
noData = file.getNoDataValue(); |
305 |
ICRSFactory crsFactory = CRSFactory.getCRSFactory(); |
|
305 | 306 |
|
306 |
IProjection proj = null; |
|
307 |
File prjFile = getPrjFile(params.getURI()); |
|
308 |
if (prjFile.exists()) { |
|
309 |
String wktEsri = loadPrj(prjFile); |
|
310 |
if (wktEsri != null) { |
|
311 |
proj = CRSFactory.getCRSFactory().get(ICRSFactory.FORMAT_WKT_ESRI, wktEsri); |
|
307 |
IProjection proj = params.getSRS(); |
|
308 |
if (proj == null) { |
|
309 |
File prjFile = getPrjFile(params.getURI()); |
|
310 |
if (prjFile.exists()) { |
|
311 |
String wktEsri = loadPrj(prjFile); |
|
312 |
if (wktEsri != null) { |
|
313 |
proj = crsFactory.get(ICRSFactory.FORMAT_WKT_ESRI, |
|
314 |
wktEsri); |
|
315 |
} |
|
312 | 316 |
} |
313 | 317 |
} |
314 | 318 |
if (proj == null) { |
315 | 319 |
String wktProjection = file.getProjectionRef(); |
316 |
if (!StringUtils.isEmpty(wktProjection)) { |
|
320 |
if (!StringUtils.isEmpty(wktProjection) ) {
|
|
317 | 321 |
try { |
318 |
proj = CRSFactory.getCRSFactory().get(ICRSFactory.FORMAT_WKT, wktProjection);
|
|
322 |
proj = crsFactory.get(ICRSFactory.FORMAT_WKT, wktProjection);
|
|
319 | 323 |
setProjection(proj, true); |
320 |
} catch (Exception e) { |
|
324 |
if ( StringUtils.isEmpty( proj.getAbrev()) ){ |
|
325 |
proj=null; |
|
326 |
} else { |
|
327 |
setProjection(proj, true); |
|
328 |
} |
|
329 |
} catch (Exception e ) { |
|
330 |
proj=null; |
|
321 | 331 |
logger.info("Error reading WKT from the raster provider", e); |
322 | 332 |
} |
323 | 333 |
} |
Also available in: Unified diff