[原][osgearth]osgearth本地(离线)数据源处理小结

参考:http://docs.osgearth.org/en/latest/data.html

Processing Local Source Data

If you have geospatial data that you would like to view in osgEarth, you can usually use the GDAL driver. If you plan on doing this, try loading it as-is first. If you find that it’s too slow, here are some tips for optimizing your data for tiled access.

Reproject your data隐射自己的数据

osgEarth will reproject your data on-the-fly if it does not have the necessary coordinate system. For instance, if you are trying to view a UTM image on a geodetic globe (epsg:4326). However, osgEarth will run much faster if your data is already in the correct coordinate system. You can use any tool you want to reproject your data such as GDAL, Global Mapper or ArcGIS.

osgEarth将reproject数据动态,如果没有必要的坐标系统。例如,如果您正试图查看UTM形象在全球大地(epsg:4326)。然而,osgEarth将运行更快如果你的数据已经在正确的坐标系统。你可以使用任何你想要的工具reproject GDAL等数据,全球映射器或ArcGIS。

For example, to reproject a UTM image to geodetic using gdal_warp:

gdalwarp -t_srs epsg:4326 my_utm_image.tif my_gd_image.tif

Build internal tiles建立内部瓦片

Typically formats such as GeoTiff store their pixel data in scanlines. This generally works well, but because of the tiled approach that osgEarth uses to access the data, you may find that using a tiled dataset will be more efficient as osgEarth doens’t need to read nearly as much data from disk to extract a tile.

通常格式如GeoTiff扫描线存储像素数据。这通常工作得很好,但由于瓷砖osgEarth使用方法来访问数据,你可能会发现,使用的数据集将更有效osgEarth多恩不需要从磁盘读取差不多数据提取一个瓷砖。

To create a tiled GeoTiff using gdal_translate, issue the following command:

gdal_translate -of GTiff -co "TILED=YES" myfile.tif myfile_tiled.tif

Build overviews建造概述?

Adding overviews (also called ‘’pyramids’’ or ‘’rsets’‘) can sometimes increase the performance of a datasource in osgEarth. You can use the gdaladdo utility to add overviews to a dataset.

添加概述(也称为“金字塔”或“资源集”)有时在osgEarth增加数据源的性能。您可以使用gdaladdo效用将概述添加到数据集。添加概述(也称为“金字塔”或“资源集”)有时在osgEarth增加数据源的性能。您可以使用gdaladdo效用将概述添加到数据集。

For example:

gdaladdo -r average myimage.tif 2 4 8 16

Building tile sets设置瓦片建造参数

Another way to speed up imagery and elevation loading in osgEarth is to build tile sets. In fact, if you want to serve your data over the network, this is the only way!

This process takes the source data and chops it up into a quad-tree hierarchy of discrete tiles that osgEarth can load very quickly. Normally, if you load a GeoTIFF (for example), osgEarth has to create the tiles at runtime in order to build the globe; Doing this beforehand means less work for osgEarth when you run your application.

osgearth_package

osgearth_package is a utility that prepares source data for use in osgEarth. It is optional - you can run osgEarth against your raw source data and it will work fine - but you can use osgearth_packageto build optimized tile sets that will maximize performance in most cases. Usage:

osgearth_package file.earth --tms --out output_folder

This will load each of the data sources in the the earth file (file.earth in this case) and generate a TMS repository for each under the folder output_folder. You can also specify options:

--out path Root output folder of the TMS repo
--ext extension
  Output file extension
--max-level level
  Maximum level of detail

–bounds xmin ymin xmax ymax Bounds to package (in map coordinates; default=entire map) –out-earth Generate an output earth file referencing the new repo –overwrite Force overwriting of existing files –keep-empties Writes fully transparent image tiles (normally discarded) –db-options An optional OSG options string –verbose Displays progress of the operation

原文地址:https://www.cnblogs.com/lyggqm/p/6365709.html