arcgis java调用AE多波段合成实现
一般条件下运营商提供的影像都是分波段文件提供的,无法展现影像的颜色效果,通过arcgis提供的波段合成功能达到影像彩色。
通过java调用AE运行,具体代码实现如下:
初始化运行条件
[java /**
* 初始化ArcgisEngine
*/
public static void initializeAE() {
EngineInitializer.initializeVisualBeans();
EngineInitializer.initializeEngine();
try {
com.esri.arcgis.system.AoInitialize ao = new com.esri.arcgis.system.AoInitialize();
ao.initialize(com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeArcInfo);
if (ao.isProductCodeAvailable(com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeArcInfo) == com.esri.arcgis.system.esriLicenseStatus.esriLicenseAvailable)
ao.initialize(com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeArcInfo);
else
System.out.println("license failed");
ao.checkOutExtension(com.esri.arcgis.system.esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst);
ao.checkOutExtension(com.esri.arcgis.system.esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst);
ao.checkOutExtension(com.esri.arcgis.system.esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst);
ao.initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
ao.initialize(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB);
ao.initialize(esriLicenseProductCode.esriLicenseProductCodeArcEditor);
ao.checkOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst);
System.out.println("AE初始化成功");
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 初始化ArcgisEngine
*/
public static void initializeAE() {
EngineInitializer.initializeVisualBeans();
EngineInitializer.initializeEngine();
try {
com.esri.arcgis.system.AoInitialize ao = new com.esri.arcgis.system.AoInitialize();
ao.initialize(com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeArcInfo);
if (ao.isProductCodeAvailable(com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeArcInfo) == com.esri.arcgis.system.esriLicenseStatus.esriLicenseAvailable)
ao.initialize(com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeArcInfo);
else
System.out.println("license failed");
ao.checkOutExtension(com.esri.arcgis.system.esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst);
ao.checkOutExtension(com.esri.arcgis.system.esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst);
ao.checkOutExtension(com.esri.arcgis.system.esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst);
ao.initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
ao.initialize(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB);
ao.initialize(esriLicenseProductCode.esriLicenseProductCodeArcEditor);
ao.checkOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst);
System.out.println("AE初始化成功");
} catch (Exception e) {
e.printStackTrace();
}
}
代码多波段合成
[java]
public void compositeBands (String inPath , String outPath ) {
CompositeBands compositeBands = new CompositeBands();
compositeBands.setInRasters(inPath);
compositeBands.setOutRaster(outPath);
GeoProcessor geoprocessor;
GPTool pGPProcess = compositeBands;
try {
geoprocessor = new GeoProcessor();
geoprocessor.setOverwriteOutput(true);
geoprocessor.execute(pGPProcess, null);
} catch (IOException e) {
e.printStackTrace();
}
}
public void compositeBands (String inPath , String outPath ) {
CompositeBands compositeBands = new CompositeBands();
compositeBands.setInRasters(inPath);
compositeBands.setOutRaster(outPath);
GeoProcessor geoprocessor;
GPTool pGPProcess = compositeBands;
try {
geoprocessor = new GeoProcessor();
geoprocessor.setOverwriteOutput(true);
geoprocessor.execute(pGPProcess, null);
} catch (IOException e) {
e.printStackTrace();
}
}代码执行调用
[java]
RastersToMosaicDataset.initializeAE();
RastersToMosaicDataset add = new RastersToMosaicDataset();
String arrys = "D:\\HJ1A-CCD1-7-116-20130707-L20001018860\\1018860\\HJ1A-CCD1-7-116-20130707-L20001018860-1.TIF;D:\\HJ1A-CCD1-7-116-20130707-L20001018860\\1018860\\HJ1A-CCD1-7-116-20130707-L20001018860-2.TIF;D:\\HJ1A-CCD1-7-116-20130707-L20001018860\\1018860\\HJ1A-CCD1-7-116-20130707-L20001018860-3.TIF;D:\\HJ1A-CCD1-7-116-20130707-L20001018860\\1018860\\HJ1A-CCD1-7-116-20130707-L20001018860-4.TIF";
&nbs
补充:软件开发 , Java ,