Revision 21916
trunk/extensions/extRasterTools-SE/src/org/gvsig/fmap/raster/layers/FLyrRasterSE.java | ||
---|---|---|
331 | 331 |
String code = null; |
332 | 332 |
String name = null; |
333 | 333 |
try { |
334 |
if(dataset.getWktProjection() != null && !dataset.getWktProjection().equals("")) { |
|
334 |
if (dataset.getWktProjection() != null && !dataset.getWktProjection().equals("")) {
|
|
335 | 335 |
OGRSpatialReference oSRSSource = new OGRSpatialReference(); |
336 |
try { |
|
337 |
OGRSpatialReference.importFromWkt(oSRSSource, dataset.getWktProjection()); |
|
338 |
if(!oSRSSource.isGeographic()) { |
|
339 |
code = oSRSSource.getAuthorityCode("PROJCS"); |
|
340 |
name = oSRSSource.getAuthorityName("PROJCS"); |
|
341 |
} else { |
|
336 |
try { |
|
337 |
OGRSpatialReference.importFromWkt(oSRSSource, dataset.getWktProjection()); |
|
338 |
code = oSRSSource.getAuthorityCode("PROJCS"); |
|
339 |
if (code == null) |
|
342 | 340 |
code = oSRSSource.getAuthorityCode("GEOGCS"); |
341 |
name = oSRSSource.getAuthorityName("PROJCS"); |
|
342 |
if (name == null) |
|
343 | 343 |
name = oSRSSource.getAuthorityName("GEOGCS"); |
344 |
} |
|
345 | 344 |
try { |
346 | 345 |
return CRSFactory.getCRS(name + ":" + code); |
347 | 346 |
} catch (NumberFormatException ex) { |
... | ... | |
352 | 351 |
} catch (CrsGdalException e) { |
353 | 352 |
Logger.getLogger(getClass().getName()).debug("Problemas obteniendo el c?digo EPSG", e); |
354 | 353 |
} |
355 |
}
|
|
356 |
|
|
354 |
} |
|
355 |
|
|
357 | 356 |
} catch (RasterDriverException e1) { |
358 | 357 |
Logger.getLogger(getClass().getName()).debug("Problemas accediendo a getWktProjection. Driver no inicializado", e1); |
359 | 358 |
} |
... | ... | |
497 | 496 |
* @return |
498 | 497 |
*/ |
499 | 498 |
public boolean isReproyectable() { |
499 |
if (dataset == null) |
|
500 |
return false; |
|
501 |
|
|
500 | 502 |
int nFiles = dataset.getDatasetCount(); |
501 | 503 |
for (int i = 0; i < nFiles; i++) |
502 | 504 |
if (!dataset.getDataset(i)[0].isReproyectable()) |
Also available in: Unified diff