com.supermap.data
类 MosaicToolkit
- java.lang.Object
-
- com.supermap.data.MosaicToolkit
-
public class MosaicToolkit extends Object
-
-
构造器概要
构造器 构造器和说明 MosaicToolkit()
-
方法概要
所有方法 静态方法 具体方法 已过时的方法 限定符和类型 方法和说明 static boolean
addMosaicFilesWithFile(DatasetMosaic sourceDataset, String filePath, String clipFileType)
使用清单文件向镶嵌数据集添加文件。static boolean
addMosaicFilesWithFile(DatasetMosaic sourceDataset, String filePath, String clipFileType, StringBuilder resultJson)
使用清单文件向镶嵌数据集添加文件。static boolean
addMosaicFilesWithFile(DatasetMosaic sourceDataset, String filePath, String clipFileType, StringBuilder resultJson, MosaicSteppedListener listener)
使用清单文件向镶嵌数据集添加文件。static boolean
buildHistograms(String filePath, boolean rebuild)
计算影像文件直方图, 目前只能支持本地/共享路径下的文件保存出aux文件来复用,后面考虑如果通过临时文件来进行多进程加速static boolean
buildPyramid(String filePath, PyramidResampleType type)
已过时。为指定影像数据创建金字塔。static boolean
buildPyramid(String filePath, PyramidResampleType type, TiffCompressType compressType)
为指定影像数据创建金字塔。static boolean
buildPyramid(String filePath, String rasterType, String rasterParams, PyramidResampleType type, TiffCompressType compressType)
为指定影像数据创建金字塔。static boolean
buildStatistics(String filePath)
计算影像文件统计信息static String
checkDatasetMosaic(DatasetMosaic datasetMosaic, boolean outputJsonOrXML)
检查镶嵌数据集。static String
checkDatasetMosaic(DatasetMosaic datasetMosaic, boolean outputJsonOrXML, MosaicSteppedListener listener)
检查镶嵌数据集。static String
checkMosaicFile(String filePath, boolean outputJsonOrXML)
static boolean
cleanPyramid(String filePath)
static Colors
computeColorTable(DatasetMosaic datasetMosaic)
计算镶嵌数据集颜色表。static double[]
computeNoDataValues(DatasetMosaic datasetMosaic, MosaicSteppedListener listener)
计算镶嵌数据集无值。static boolean
createCOGCopy(String srcFile, String destFile, int resampleType, int nCompressType)
static boolean
createCOGCopy(String srcFile, String destFile, int resampleType, int nCompressType, MosaicSteppedListener listener)
static int
createOverviewFile(String defineFile)
static int
defineOverview(DatasetMosaic datasetMosaic, String path, int maxWidth, int maxHeight, int ratio, boolean hasNoValue, double noValue, String defineFolder)
定义镶嵌数据集的概视图(Overview)。static int
defineOverview(DatasetMosaic datasetMosaic, String path, int maxWidth, int maxHeight, int ratio, boolean hasNoValue, double noValue, String defineFolder, MosaicSteppedListener listener)
定义镶嵌数据集的概视图(Overview)。static boolean
forceRebuildPyramid(String filePath, PyramidResampleType type, TiffCompressType compressType)
static boolean
forceRebuildPyramid(String filePath, String rasterType, String rasterParams, PyramidResampleType type, TiffCompressType compressType)
static HashMap<Integer,String>
getAllFiles(DatasetMosaic datasetMosaic, Boolean containsOverviews)
返回镶嵌数据集中所添加的所有影像信息。static String
getFileEncode(File file)
判断文件的编码格式static String
getFileInfo(String filePath)
返回指定影像文件的信息,如波段数、位深等。static HashMap<Integer,String>
getFilesByBounds(DatasetMosaic datasetMosaic, Rectangle2D extractBounds, Boolean containsOverviews)
返回镶嵌数据集指定范围内的所有影像信息。static HashMap<Integer,String>
getFilesByGeoRegion(DatasetMosaic datasetMosaic, GeoRegion extractRegion, Boolean containsOverviews)
通过空间查询出与指定对象相交的影像文件。static int
getFilesCount(DatasetMosaic datasetMosaic)
获取镶嵌数据集中文件的数量,不包含概视图文件。static MosaicPixelValues
getValue(DatasetMosaic datasetMosaic, Point2D point2D)
返回镶嵌数据集指定点的栅格信息。static boolean
hasPyramid(String filePath)
返回文件是否已创建了金字塔。static boolean
hasPyramid(String filePath, String rasterType, String rasterParams)
判断文件是否创建金字塔static boolean
isValidCOG(String srcFile)
static boolean
refreshMetadata(DatasetMosaic datasetMosaic)
static boolean
RefreshPyramid(DatasetMosaic datasetMosaic)
读取金字塔信息,刷新对应的属性表static String
testDataAccessSpeed(DatasetMosaic datasetMosaic, int tileCount, int pyramidLevel)
static String
testSingleFileAccessSpeed(String srcFile, int testCount, int pyramidLevel)
-
-
-
方法详细资料
-
getAllFiles
public static HashMap<Integer,String> getAllFiles(DatasetMosaic datasetMosaic, Boolean containsOverviews)
返回镶嵌数据集中所添加的所有影像信息。- 参数:
datasetMosaic
- 指定的镶嵌数据集。containsOverviews
- 返回信息是否包含概视图信息。- 返回:
- 返回镶嵌数据集中所添加的所有影像信息。信息为一个字典类,其中的键为图幅ID号,键对应得值为该图幅的影像路径信息。
-
getFilesByBounds
public static HashMap<Integer,String> getFilesByBounds(DatasetMosaic datasetMosaic, Rectangle2D extractBounds, Boolean containsOverviews)
返回镶嵌数据集指定范围内的所有影像信息。- 参数:
datasetMosaic
- 指定的镶嵌数据集。extractBounds
- 指定的范围。containsOverviews
- 查询结果是否包含概视图影像文件。- 返回:
- 返回镶嵌数据集指定范围内的所有影像信息。信息为一个字典类,其中的键为图幅ID号,键对应得值为该图幅的影像路径信息。
-
getFilesByGeoRegion
public static HashMap<Integer,String> getFilesByGeoRegion(DatasetMosaic datasetMosaic, GeoRegion extractRegion, Boolean containsOverviews)
通过空间查询出与指定对象相交的影像文件。- 参数:
datasetMosaic
- 查询的镶嵌数据集。extractRegion
- 作为查询范围的几何对象。containsOverviews
- 查询结果是否包含概视图影像文件。- 返回:
- 返回通过空间查询出与指定对象相交的影像文件信息。信息为一个字典类,其中的键为图幅ID号,键对应得值为该图幅的影像路径信息。
-
hasPyramid
public static boolean hasPyramid(String filePath)
返回文件是否已创建了金字塔。- 参数:
filePath
- 指定的影像文件路径。- 返回:
- 返回文件是否已创建了金字塔,true表示建立了金字塔;false表示没有建立金字塔。
-
hasPyramid
public static boolean hasPyramid(String filePath, String rasterType, String rasterParams)
判断文件是否创建金字塔- 参数:
filePath
- 文件路径rasterType
- 栅格类型rasterParams
- 栅格参数- 返回:
- 是否存在金字塔。存在返回true,否则返回false。
-
buildPyramid
@Deprecated public static boolean buildPyramid(String filePath, PyramidResampleType type)
已过时。 为指定影像数据创建金字塔。- 参数:
filePath
- 指定的要创建金字塔的影像文件路径。type
- 金字塔重采样方式。- 返回:
- 成功创建返回true;否则返回false。
-
buildPyramid
public static boolean buildPyramid(String filePath, PyramidResampleType type, TiffCompressType compressType)
为指定影像数据创建金字塔。- 参数:
filePath
- 指定的要创建金字塔的影像文件路径。type
- 金字塔重采样方式。compressType
- 金字塔压缩方式。- 返回:
- 成功创建返回true;否则返回false。
-
buildPyramid
public static boolean buildPyramid(String filePath, String rasterType, String rasterParams, PyramidResampleType type, TiffCompressType compressType)
为指定影像数据创建金字塔。- 参数:
filePath
- 文件路径rasterType
- 栅格类型rasterParams
- 栅格参数type
- 重采样方式compressType
- 压缩方式- 返回:
- 成功创建返回true;否则返回false。
-
cleanPyramid
public static boolean cleanPyramid(String filePath)
-
forceRebuildPyramid
public static boolean forceRebuildPyramid(String filePath, PyramidResampleType type, TiffCompressType compressType)
-
forceRebuildPyramid
public static boolean forceRebuildPyramid(String filePath, String rasterType, String rasterParams, PyramidResampleType type, TiffCompressType compressType)
-
getValue
public static MosaicPixelValues getValue(DatasetMosaic datasetMosaic, Point2D point2D)
返回镶嵌数据集指定点的栅格信息。- 参数:
datasetMosaic
- 指定的镶嵌数据集。point2D
- 指定的点。- 返回:
- 返回镶嵌数据集指定点的栅格信息。
-
getFileInfo
public static String getFileInfo(String filePath)
返回指定影像文件的信息,如波段数、位深等。- 参数:
filePath
- 指定影像文件的全路径。- 返回:
- 返回指定影像文件的信息,如波段数、位深等。
-
checkDatasetMosaic
public static String checkDatasetMosaic(DatasetMosaic datasetMosaic, boolean outputJsonOrXML, MosaicSteppedListener listener)
检查镶嵌数据集。- 参数:
datasetMosaic
- 指定待检查的镶嵌数据集。outputJsonOrXML
- 检查结果可以使用JSON或者XML格式化字符串显示。该参数为 true,检查结果输出JSON格式字符串;false,检查结果输出XML格式字符串。listener
- 事件监听,用于获取方法执行的进度与取消操作。- 返回:
- 返回检查结果报告。
-
checkDatasetMosaic
public static String checkDatasetMosaic(DatasetMosaic datasetMosaic, boolean outputJsonOrXML)
检查镶嵌数据集。- 参数:
datasetMosaic
- 指定待检查的镶嵌数据集。outputJsonOrXML
- 检查结果可以使用JSON或者XML格式化字符串显示。该参数为 true,检查结果输出JSON格式字符串;false,检查结果输出XML格式字符串。- 返回:
- 返回检查结果报告。
-
defineOverview
public static int defineOverview(DatasetMosaic datasetMosaic, String path, int maxWidth, int maxHeight, int ratio, boolean hasNoValue, double noValue, String defineFolder)
定义镶嵌数据集的概视图(Overview)。- 参数:
datasetMosaic
- 指定待定义概视图的镶嵌数据集。path
- 概视图的输出路径。maxWidth
- 每幅概视图影像文件的宽度,单位为像素。maxHeight
- 每幅概视图影像文件的高度,单位为像素。ratio
- 相邻概视图层级间的比率。hasNoValue
- 影像中是否有无值区域。noValue
- 指定无值的具体数值。在生成概视图时,将去除指定的无值。defineFolder
- 概视图定义文件的输出路径。- 返回:
- 成功返回0;否则返回一个非零的错误码。
-
defineOverview
public static int defineOverview(DatasetMosaic datasetMosaic, String path, int maxWidth, int maxHeight, int ratio, boolean hasNoValue, double noValue, String defineFolder, MosaicSteppedListener listener)
定义镶嵌数据集的概视图(Overview)。- 参数:
datasetMosaic
- 指定待定义概视图的镶嵌数据集。path
- 概视图的输出路径。maxWidth
- 每幅概视图影像文件的宽度,单位为像素。maxHeight
- 每幅概视图影像文件的高度,单位为像素。ratio
- 相邻概视图层级间的比率。hasNoValue
- 影像中是否有无值区域。noValue
- 指定无值的具体数值。在生成概视图时,将去除指定的无值。defineFolder
- 概视图定义文件的输出路径。listener
- 事件监听,用于获取方法执行的进度与取消操作。- 返回:
-
createOverviewFile
public static int createOverviewFile(String defineFile)
-
createCOGCopy
public static boolean createCOGCopy(String srcFile, String destFile, int resampleType, int nCompressType)
-
createCOGCopy
public static boolean createCOGCopy(String srcFile, String destFile, int resampleType, int nCompressType, MosaicSteppedListener listener)
-
isValidCOG
public static boolean isValidCOG(String srcFile)
-
testDataAccessSpeed
public static String testDataAccessSpeed(DatasetMosaic datasetMosaic, int tileCount, int pyramidLevel)
-
testSingleFileAccessSpeed
public static String testSingleFileAccessSpeed(String srcFile, int testCount, int pyramidLevel)
-
refreshMetadata
public static boolean refreshMetadata(DatasetMosaic datasetMosaic)
-
addMosaicFilesWithFile
public static boolean addMosaicFilesWithFile(DatasetMosaic sourceDataset, String filePath, String clipFileType)
使用清单文件向镶嵌数据集添加文件。清单文件为一个.txt 文本文件,清单文件中一行记录为一个影像文件的全路径,全路径写法:Linux系统的写法,如:/home/data/images/H48C002002.tif;Windows系统的写法,如: E:\data\imageChina\H48C002002.tif。- 参数:
sourceDataset
- 待添加影像文件的镶嵌数据集。filePath
- 清单文件路径。清单文件为一个.txt 文本文件,清单文件中一行记录为一个影像文件的全路径,全路径写法:Linux系统的写法,如:/home/data/images/H48C002002.tif;Windows系统的写法,如: E:\data\imageChina\H48C002002.tif。clipFileType
- 用于影像裁剪显示的裁剪区形状文件的扩展名。影像裁剪区的矢量文件类型。影像的裁剪区为影像的有效值范围,若影像有配套的限定其裁剪区的矢量文件,通过指定该参数,影像添加时,将影像的裁剪区将更新到镶嵌数据集的裁剪子数据集中,后续用于去除无值的显示设置。若裁剪区的矢量文件类型为shapefile,该参数值为.shp。- 返回:
- 添加成功返回true;否则,返回false。
-
addMosaicFilesWithFile
public static boolean addMosaicFilesWithFile(DatasetMosaic sourceDataset, String filePath, String clipFileType, StringBuilder resultJson)
使用清单文件向镶嵌数据集添加文件。清单文件为一个.txt 文本文件,清单文件中一行记录为一个影像文件的全路径,全路径写法:Linux系统的写法,如:/home/data/images/H48C002002.tif;Windows系统的写法,如: E:\data\imageChina\H48C002002.tif。- 参数:
sourceDataset
- 待添加影像文件的镶嵌数据集。filePath
- 清单文件路径。清单文件为一个.txt 文本文件,清单文件中一行记录为一个影像文件的全路径,全路径写法:Linux系统的写法,如:/home/data/images/H48C002002.tif;Windows系统的写法,如: E:\data\imageChina\H48C002002.tif。clipFileType
- 用于影像裁剪显示的裁剪区形状文件的扩展名。影像裁剪区的矢量文件类型。影像的裁剪区为影像的有效值范围,若影像有配套的限定其裁剪区的矢量文件,通过指定该参数,影像添加时,将影像的裁剪区将更新到镶嵌数据集的裁剪子数据集中,后续用于去除无值的显示设置。若裁剪区的矢量文件类型为shapefile,该参数值为.shp。resultJson
- 添加结果报告。- 返回:
- 添加成功返回true;否则,返回false。
-
addMosaicFilesWithFile
public static boolean addMosaicFilesWithFile(DatasetMosaic sourceDataset, String filePath, String clipFileType, StringBuilder resultJson, MosaicSteppedListener listener)
使用清单文件向镶嵌数据集添加文件。清单文件为一个.txt 文本文件,清单文件中一行记录为一个影像文件的全路径,全路径写法:Linux系统的写法,如:/home/data/images/H48C002002.tif;Windows系统的写法,如: E:\data\imageChina\H48C002002.tif。- 参数:
sourceDataset
- 待添加影像文件的镶嵌数据集。filePath
- 清单文件路径。清单文件为一个.txt 文本文件,清单文件中一行记录为一个影像文件的全路径,全路径写法:Linux系统的写法,如:/home/data/images/H48C002002.tif;Windows系统的写法,如: E:\data\imageChina\H48C002002.tif。clipFileType
- 用于影像裁剪显示的裁剪区形状文件的扩展名。影像裁剪区的矢量文件类型。影像的裁剪区为影像的有效值范围,若影像有配套的限定其裁剪区的矢量文件,通过指定该参数,影像添加时,将影像的裁剪区将更新到镶嵌数据集的裁剪子数据集中,后续用于去除无值的显示设置。若裁剪区的矢量文件类型为shapefile,该参数值为.shp。resultJson
- 添加结果报告。listener
- 事件监听,用于获取方法执行的进度与取消操作。- 返回:
- 添加成功返回true;否则,返回false。
-
buildStatistics
public static boolean buildStatistics(String filePath)
计算影像文件统计信息- 参数:
filePath
- 影像文件路径- 返回:
- 是否成功
-
buildHistograms
public static boolean buildHistograms(String filePath, boolean rebuild)
计算影像文件直方图, 目前只能支持本地/共享路径下的文件保存出aux文件来复用,后面考虑如果通过临时文件来进行多进程加速- 参数:
filePath
- 影像文件路径rebuild
- 是否重新计算- 返回:
- 是否成功
-
RefreshPyramid
public static boolean RefreshPyramid(DatasetMosaic datasetMosaic)
读取金字塔信息,刷新对应的属性表- 参数:
datasetMosaic
- 镶嵌数据集- 返回:
- 是否成功
-
getFilesCount
public static int getFilesCount(DatasetMosaic datasetMosaic)
获取镶嵌数据集中文件的数量,不包含概视图文件。- 参数:
datasetMosaic
- 镶嵌数据集- 返回:
- 条目数
-
computeNoDataValues
public static double[] computeNoDataValues(DatasetMosaic datasetMosaic, MosaicSteppedListener listener)
计算镶嵌数据集无值。 返回的数组长度与镶嵌数据集的波段数相同。如果无法计算出无值,则返回长度为0的空数组。- 参数:
datasetMosaic
- 镶嵌数据集listener
- 进度条监听对象- 返回:
- 无值数组
-
computeColorTable
public static Colors computeColorTable(DatasetMosaic datasetMosaic)
计算镶嵌数据集颜色表。- 参数:
datasetMosaic
- 镶嵌数据集- 返回:
- 颜色表
-
-
Copyright © 2021–2024 SuperMap. All rights reserved.