Revision 42464 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.shp/src/main/java/org/gvsig/fmap/dal/store/shp/SHPStoreProvider.java
SHPStoreProvider.java | ||
---|---|---|
64 | 64 |
import org.gvsig.fmap.dal.store.shp.utils.ISHPFile; |
65 | 65 |
import org.gvsig.fmap.dal.store.shp.utils.SHPFile2; |
66 | 66 |
import org.gvsig.fmap.geom.Geometry; |
67 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
68 | 67 |
import org.gvsig.fmap.geom.GeometryLocator; |
69 | 68 |
import org.gvsig.fmap.geom.GeometryManager; |
70 | 69 |
import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
... | ... | |
111 | 110 |
public Object getDynValue(String name) throws DynFieldNotFoundException { |
112 | 111 |
if (DataStore.METADATA_CRS.equalsIgnoreCase(name)) { |
113 | 112 |
|
114 |
/* |
|
115 |
* String srs = this.shpFile.getSRSParameters(); |
|
116 |
if (srs != null){ |
|
117 |
// This can be non null but not sure how to handle |
|
118 |
} |
|
119 |
*/ |
|
120 | 113 |
return this.getShpParameters().getCRS(); |
121 | 114 |
|
122 | 115 |
} else if (DataStore.METADATA_ENVELOPE.equalsIgnoreCase(name)) { |
... | ... | |
507 | 500 |
close(); |
508 | 501 |
resourceCloseRequest(); |
509 | 502 |
|
503 |
//FIXME: Descomentarizar este c?digo cuando se consiga exportar la proyecci?n al formato de WKT_ESRI. |
|
504 |
// File tmpPrjFile = SHP.getPrjFile(tmpParams.getSHPFile()); |
|
505 |
// try { |
|
506 |
// FileUtils.writeStringToFile(tmpPrjFile, tmpParams.getCRS().export(ICRSFactory.FORMAT_WKT_ESRI)); |
|
507 |
// } catch(Exception e) { |
|
508 |
// logger.info("Can't write prj file '"+tmpPrjFile.getAbsolutePath()+"'."); |
|
509 |
// } |
|
510 |
|
|
510 | 511 |
if (!shpParams.getDBFFile().delete()) { |
511 | 512 |
logger.debug("Can't delete dbf file '"+shpParams.getDBFFile()+"'."); |
512 | 513 |
throw new IOException("Can't delete dbf '"+FilenameUtils.getBaseName(shpParams.getDBFFileName())+"' file to replace with the new dbf.\nThe new dbf is in temporary file '"+str_base+"'"); |
... | ... | |
519 | 520 |
logger.debug("Can't delete dbf file '"+shpParams.getSHXFile()+"'."); |
520 | 521 |
throw new IOException("Can't delete shx '"+FilenameUtils.getBaseName(shpParams.getSHXFileName())+"' file to replace with the new shx.\nThe new shx is in temporary file '"+str_base+"'"); |
521 | 522 |
} |
523 |
//FIXME: Descomentarizar este c?digo cuando se consiga exportar la proyecci?n al formato de WKT_ESRI. |
|
524 |
// if (SHP.getPrjFile(shpParams.getSHPFile()).exists()) { |
|
525 |
// if (!SHP.getPrjFile(shpParams.getSHPFile()).delete()) { |
|
526 |
// logger.debug("Can't delete prj file '" + SHP.getPrjFile(shpParams.getSHPFile()) + "'."); |
|
527 |
// throw new IOException("Can't delete shx '" |
|
528 |
// + FilenameUtils.getBaseName(SHP.getPrjFile(shpParams.getSHPFile()).getPath()) |
|
529 |
// + "' file to replace with the new shx.\nThe new shx is in temporary file '" |
|
530 |
// + str_base + "'"); |
|
531 |
// } |
|
532 |
// } |
|
522 | 533 |
FileUtils.moveFile( |
523 | 534 |
tmpParams.getDBFFile(), |
524 | 535 |
shpParams.getDBFFile()); |
... | ... | |
528 | 539 |
FileUtils.moveFile( |
529 | 540 |
tmpParams.getSHXFile(), |
530 | 541 |
shpParams.getSHXFile()); |
542 |
//FIXME: Descomentarizar este c?digo cuando se consiga exportar la proyecci?n al formato de WKT_ESRI. |
|
543 |
// FileUtils.moveFile( |
|
544 |
// tmpPrjFile, |
|
545 |
// SHP.getPrjFile(shpParams.getSHPFile())); |
|
531 | 546 |
|
532 | 547 |
resourcesNotifyChanges(); |
533 | 548 |
initFeatureType(); |
Also available in: Unified diff