Skip to main content

A small library to work with OGC legends

Project description

Version Build Status

A small library to work with OGC legends.

import ogc_legends

url = "https://demo.mapserver.org/cgi-bin/wms?"
legends = ogc_legends.get_legends(url, "./images")

for k, v in legends.items():
    print(k, v)

The dictionary structure returned by the get_legends function is as follows:

{
    "cities": [
        {
            "file": "./images\\cities_default.png",
            "style": "default"
        }
    ],
    "continents": [
        {
            "file": "./images\\continents_default.png",
            "style": "default"
        }
    ],
    "country_bounds": [
        {
            "file": "./images\\country_bounds_default.png",
            "style": "default"
        }
    ]
}
https://raw.githubusercontent.com/geographika/ogc-legends/master/images/continents_default.png

From the command line:

ogc_legends "https://demo.mapserver.org/cgi-bin/wms?"

To save to a different folder:

ogc_legends "https://demo.mapserver.org/cgi-bin/wms?" "./images"

Other options - don’t override if file already exists, and use WMS version 1.1.1:

ogc_legends "https://demo.mapserver.org/cgi-bin/wms?" "./images" False "1.1.1"

Requirements

  • Python 3.6+

Installation

Note installing the ogc-legends plugin will automatically install the required dependency owslib.

pip install ogc-legends

Releases

0.1 (17/03/2020)

  • Initial release

Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ogc-legends, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size ogc_legends-0.1.4-py2.py3-none-any.whl (4.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size ogc_legends-0.1.4-py3.6.egg (4.9 kB) File type Egg Python version 3.6 Upload date Hashes View
Filename, size ogc_legends-0.1.4-py3.7.egg (4.9 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size ogc_legends-0.1.4-py3.8.egg (4.9 kB) File type Egg Python version 3.8 Upload date Hashes View
Filename, size ogc-legends-0.1.4.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page