GNU General Public License v3.0

项目介绍

dragoa/2dMapImageGeneration 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 GNU General Public License v3.0 许可证,目前获得 2 个 Star、0 次 Fork。

仓库全名
dragoa/2dMapImageGeneration
开源许可证
GNU General Public License v3.0
Star 数
2

README 摘要

ImageGeneration ImageGeneration is a tool for retreiving layers present in a WASDI workspace in various different formats. With this tool you are able to stack one or more layer over the other and to set a background map layer from using different providers. As it is a WASDI processor it uses the WASDI library that can be found at REQUIREMENTS AND INSTALLATION ImageGeneration depends on several packages, which…

完整内容见 GitHub 原始 README 或本页 。

常见问题

2dMapImageGeneration 用什么语言开发?

主要使用 Python 编写,采用 GNU General Public License v3.0 许可证,目前有 2 个 Star。

2dMapImageGeneration 可以免费商用吗?

仓库标注的许可证为 GNU General Public License v3.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 2dMapImageGeneration 的源码?

可以直接克隆仓库:git clone https://github.com/dragoa/2dMapImageGeneration.git,默认分支为 main;安装与运行步骤见仓库 README。

2dMapImageGeneration 最近还在维护吗?

仓库最近一次更新为 2024年3月6日,当前没有未关闭的 Issue;Star 数为 2,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Creation of 2d Maps images in different formats. Deployed on the WASDI app store.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
3
价值分
1
活跃状态
活跃

语言占比

Python

README

ImageGeneration

ImageGeneration is a tool for retreiving layers present in a WASDI workspace in various different formats. With this tool you are able to stack one or more layer over the other and to set a background map layer from using different providers. As it is a WASDI processor it uses the WASDI library that can be found at https://github.com/fadeoutsoftware/WASDI

REQUIREMENTS AND INSTALLATION

ImageGeneration depends on several packages, which should be installed automatically. The packages required for the correct execution are the following:

  • wasdi
  • gdal
  • owslib
  • geotiler
  • uuid

All the above packages are available via pip or conda. To install any of them, run the command:

pip install <name of the package>

To run some examples, further packages may be required. If an example requires a specific package, it will be detailed in the example directory.

Documentation

The documentation related to the wasdi package can be found at https://wasdi.readthedocs.io/en/latest/index.html.

Supported Inputs

To utilize the Image Generation as a WASDI processor, it is essential to have a WASDI account, as the application requires authentication. To set up the application, you must complete the configuration in the “config.json” file by providing your corresponding account credentials and the name of the workspace you are working on.

{
  "USER": "YOUR USERNAME",
  "PASSWORD": "YOUR PASSWORD",
  "PARAMETERSFILEPATH": "./params.json",
  "WORKSPACE": "WORKSPACE NAME"
}

ImageGeneration as a WASDI processor requires a params.json file that contains all the parameters. There are many parameters supported:

  • A list of products which represent each layer present in a WASDI workspace.
  • Each layer has different options:
{
  "PRODUCT": "lulc_map.tif",
  "BAND": "band_1",
  "BBOX": "",
  "STYLE": "",
  "FILENAME": "",
  "GEOSERVER URL": "",
  "LAYER ID": "",
  "stack_order": 1
}
  • product: Identifier for a product inside the WASDI workspace
  • band: Identifier for the band of the product
  • bbox: Bbox options used for selecting an area in the world
  • style: Name of a sld style file present on a WASDI workspace
  • fileName: Name of the output image
  • geoserver url: Link for a custom geoserver url
  • layer id: Identifier of a layer in a Geoserver workspace
  • stack order: Order on which we want to stack layers
  • A series of options for retreiving images:
"CRS": "",
"WIDTH": "",
"HEIGHT": 700,
"outputFormat": "jpeg",
"backgroundService" : "osm",
"stackLayers": true,
"bboxOptions": 1
  • crs: Coordinate Reference System used. The list of crs options are the one supported by GeoServer
  • width: Width of the image
  • height: Height of the image
  • output format: Format for the output image
  • background service: Option for the tile provider
  • stack layers: Boolean for selecting if stacking layers (true by default)
  • bbox options: Integer for selecting the bbox options

File Format Options

The formats for the output images are the ones supported by GeoServer.

Format Syntax Notes
PNG format=image/png Default PNG format for images.
PNG8 format=image/png8 Same as PNG, but with an optimal 256-color (8-bit) palette for smaller image sizes.
JPEG format=image/jpeg JPEG image format.
JPEG-PNG format=image/vnd.jpeg-png A custom format that dynamically decides between JPEG and PNG compression based on image contents. Requires &transparent=TRUE parameter for meaningful use.
JPEG-PNG8 format=image/vnd.jpeg-png8 Similar to JPEG-PNG but generates a paletted output if PNG format is chosen.
GIF format=image/gif GIF image format.
TIFF format=image/tiff TIFF image format.
TIFF8 format=image/tiff8 Similar to TIFF, but with an optimal 256-color (8-bit) palette for smaller image sizes.
GeoTIFF format=image/geotiff Similar to TIFF, but includes extra GeoTIFF metadata.
GeoTIFF8 format=image/geotiff8 Similar to GeoTIFF but with an optimal 256-color (8-bit) palette for smaller image sizes and extra GeoTIFF metadata.
SVG format=image/svg SVG image format.
PDF format=application/pdf PDF document format.
GeoRSS format=rss GeoRSS format.
KML format=kml KML format, often used for geographic data in applications like Google Earth.
KMZ format=kmz KMZ format, a compressed version of KML.
OpenLayers format=application/openlayers Generates an OpenLayers HTML application, likely for displaying geospatial data.
UTFGrid format=application/json;type=utfgrid Generates an UTFGrid 1.3 JSON response, typically for vector data output.

For the bbox options you can choose between intersection, union, and then one of the bboxes of a specific product.

bboxOptions Notes
0 Using the intersection of BBoxes.
1 Using the union of BBoxes.
else Using the bbox of the base layer.

The parameter backgroundService is used to choose between the different tile providers supported by GeoTiler.

Provider Provider Id API Key Reference License
OpenStreetMap osm Open Data Commons Open Database License
Stamen Toner stamen-toner Creative Commons Attribution (CC BY 3.0) license
Stamen Toner Lite stamen-toner-lite as above
Stamen Terrain stamen-terrain as above
Stamen Terrain Background stamen-terrain-background as above
Stamen Terrain Lines stamen-terrain-lines as above
Stamen Water Color stamen-watercolor as above
Modest Maps Blue Marble bluemarble NASA guideline
OpenCycleMap thunderforest-cycle thunderforest Thunderforest Terms and Conditions

N.B. A map provider might require API key. To add an API key for a map provider, the $HOME/.config/geotiler/geotiler.ini file has to be created with API key reference pointing to an API key, for example:

[api-key]
thunderforest = <api-key>

where is usually a fixed size, alphanumeric hash value provided by map provider service.

For the full documentation of GeoTiler check https://wrobell.dcmod.org/geotiler/usage.html.

评论

暂无评论