GeoServer之發布Geotiff存在的問題
首次使用geoserver發布geotiff時,在導入geotiff會遇到這樣的問題:
Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file://F:\tif\11.tif and hints Hints: REPOSITORY = org.geoserver.catalog.CatalogRepository@11d3c487 EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@583d19fb[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] System defaults: GRID_COVERAGE_FACTORY = GridCoverageFactory TILE_ENCODING = null FILTER_FACTORY = FilterFactoryImpl LENIENT_DATUM_SHIFT = true FORCE_AXIS_ORDER_HONORING = http FEATURE_FACTORY = org.geotools.feature.LenientFeatureFactoryImpl@1e0f9063 FORCE_LONGITUDE_FIRST_AXIS_ORDER = true COMPARISON_TOLERANCE = 1.0E-8 STYLE_FACTORY = StyleFactoryImpl
出現這種情況時因為所選的TIFF的頭文件有問題或者geoserver無法識別投影坐標系。
解決方法:通過gdal_translate(提前安裝了gdal)重寫TIFF文件
CMD命令行輸入:gdal_translate -of GTiff -scale 輸入文件路徑 輸出文件路徑
官方鏈接:https://gdal.org/1.11/gdal_translate.html