Git Product home page Git Product logo

2dmapimagegeneration's Introduction

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.

2dmapimagegeneration's People

Contributors

dragoa avatar foysal440 avatar mnarizzano avatar

Stargazers

Marino Matteo avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.