Revision 26873 branches/v2_0_0_prep/libraries/libRaster/src/org/gvsig/raster/dataset/io/ErmapperWriter.java
ErmapperWriter.java | ||
---|---|---|
32 | 32 |
import org.gvsig.raster.dataset.Params.Param; |
33 | 33 |
import org.gvsig.raster.dataset.io.features.WriteFileFormatFeatures; |
34 | 34 |
import org.gvsig.raster.util.RasterUtilities; |
35 |
import org.gvsig.raster.util.extensionPoints.ExtensionPoint; |
|
35 |
import org.gvsig.tools.ToolsLocator; |
|
36 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
37 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
36 | 38 |
|
37 | 39 |
import es.gva.cit.jecwcompress.EcwException; |
38 | 40 |
import es.gva.cit.jecwcompress.JniObject; |
... | ... | |
55 | 57 |
public class ErmapperWriter extends GeoRasterWriter { |
56 | 58 |
|
57 | 59 |
public static void register() { |
58 |
ExtensionPoint point = ExtensionPoint.getExtensionPoint("RasterWriter"); |
|
60 |
ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager(); |
|
61 |
ExtensionPoint point=extensionPoints.get("RasterWriter"); |
|
59 | 62 |
WriteFileFormatFeatures features = null; |
60 | 63 |
|
61 | 64 |
String os = System.getProperties().getProperty("os.version"); |
62 | 65 |
if (os.startsWith("2.4")){ |
63 |
point.register("ecw", ErmapperWriter.class);
|
|
66 |
point.append("ecw", "", ErmapperWriter.class);
|
|
64 | 67 |
features = new WriteFileFormatFeatures("Ecw", "ecw", new int[]{3}, null, ErmapperWriter.class); |
65 | 68 |
fileFeature.put("ecw", features); |
66 | 69 |
} |
67 |
point.register("jp2", ErmapperWriter.class);
|
|
70 |
point.append("jp2", "", ErmapperWriter.class);
|
|
68 | 71 |
features = new WriteFileFormatFeatures("Jpeg2000", "jp2", new int[]{3}, null, ErmapperWriter.class); |
69 | 72 |
fileFeature.put("jp2", features); |
70 | 73 |
} |
... | ... | |
137 | 140 |
Integer outSizeY, |
138 | 141 |
Integer dataType, |
139 | 142 |
Params params, |
140 |
IProjection proj,
|
|
143 |
IProjection proj, |
|
141 | 144 |
Boolean geo) throws EcwException, IOException { |
142 |
|
|
145 |
|
|
143 | 146 |
//La libreria de ECW no se traga caracteres raros al escribir. Los cambiamos por X de momento y ya se apa?a el usuario |
144 |
|
|
147 |
|
|
145 | 148 |
String ext = RasterUtilities.getExtensionFromFileName(outFileName); |
146 | 149 |
String fname = outFileName.substring(outFileName.lastIndexOf(File.separator) + 1, outFileName.lastIndexOf(".")).replaceAll("[^a-zA-Z0-9_]", "X"); |
147 | 150 |
outFileName = outFileName.substring(0, outFileName.lastIndexOf(File.separator) + 1) + fname + "." + ext; |
148 |
|
|
151 |
|
|
149 | 152 |
this.proj = proj; |
150 | 153 |
ident = RasterUtilities.getExtensionFromFileName(outFileName); |
151 | 154 |
driver = ((WriteFileFormatFeatures)fileFeature.get(ident)).getDriverName(); |
... | ... | |
168 | 171 |
|
169 | 172 |
pixelSizeX = (at.getScaleX() > 0) ? at.getScaleX() : -at.getScaleX(); |
170 | 173 |
pixelSizeY = (at.getScaleY() < 0) ? at.getScaleY() : -at.getScaleY(); |
171 |
|
|
174 |
|
|
172 | 175 |
String outRmf = RasterUtilities.getNameWithoutExtension(outFileName); |
173 | 176 |
if(geo.booleanValue()) |
174 | 177 |
RasterUtilities.saveGeoInfo(outRmf, at, new Point2D.Double(sizeWindowX, sizeWindowY)); |
... | ... | |
221 | 224 |
|
222 | 225 |
compressclient.setCellSizeUnits(1); |
223 | 226 |
int blocksize = RasterLibrary.blockHeight; |
224 |
|
|
227 |
|
|
225 | 228 |
if (dataWriter != null) { |
226 | 229 |
readerObj = new Reader(dataWriter, compressclient, sizeWindowX, |
227 | 230 |
sizeWindowY, blocksize, nBands, this, dataType); |
Also available in: Unified diff