跳转至

支持的数据格式

QField supports a wide variety of formats via QGIS data providers and GDAL. This page offers a non-exhaustive list of supported data formats.

数据格式 支持 备注
Spatialite
Geopackage
WMS
WFS
WFS-T
Postgis
MBTiles
Shapefile
Tiff
JPEG2000
WEBP
ECW 许可限制使用。
MrSID 许可限制使用。

如果您在此表未找到满意的数据格式,请检查是否有效并 调整以上列表 以分享您的发现。如果是不支持的数据格式,请 提交问题 。我们很高兴帮助您实现梦想。

栅格数据

栅格数据可能会很大,当处理未压缩的 tiff 文件时,通常是几个 Gb 的数据。尤其是在移动设备上,这是非常低效的。

使用 COG (云优化的GeoTIFF)

The Cloud Optimized Geotiff (COG) format will offer best user experience for offline basemaps. Combined with JPEG compression, it will reduce the raster size.

以下命令使用JPEG压缩方法将名为 raster.tif 的文件转换为COG文件 raster_cog.tif

gdal_translate raster.tif raster_cog.tif -of COG -co BLOCKSIZE=512 -co COMPRESS=JPEG -co QUALITY=75 -co BIGTIFF=YES

COG的高级示例

If you have several files to assemble, first, you need to create a VRT file with QGIS or through following commands to index all TIF files inside a directory. Make sure you adjust EPSG:2056 to your desired CRS.

gdalbuildvrt raster_mosaic.vrt TIF_Directory/*.tif -addalpha -hidenodata -a_srs EPSG:2056

Then convert the VRT file to COG.

gdal_translate raster_mosaic.vrt raster_cog.tif -of COG -co BLOCKSIZE=512 -co COMPRESS=JPEG -co QUALITY=75 -co BIGTIFF=YES

If the data quality of the raster data is too low, adjust the compression level and set QUALITY=85.

可以设置一些其他参数:

  • a_srs can also be used in gdal_translate command when the CRS is not defined in the source raster dataset.
  • OVERVIEW_RESAMPLING offer different renderer when zooming out. The default value is NEAREST but you can try also BILINEAR or AVERAGE.
  • NUM_THREADS will help you to balance between use all your CPU resources or only part. Set ALL_CPUS or define the number of thread you want to use.

综合所有上述参数,命令行或许如下所示:

gdal_translate raster.tif raster_cog.tif -a_srs EPSG:2056 -of COG -co BLOCKSIZE=512 -co OVERVIEW_RESAMPLING=BILINEAR -co COMPRESS=JPEG -co QUALITY=75 -co NUM_THREADS=6 -co BIGTIFF=YES