Giter Site home page Giter Site logo

brazil-data-cube / lccs.py Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 3.0 201 KB

Python Client Library for Land Cover Classification System Web Service

License: GNU General Public License v3.0

Python 95.38% Shell 1.40% HTML 3.22%
geospatial gis earth-science land-cover land-use python

lccs.py's Introduction

Python Client Library for Land Cover Classification System Web Service

Software License

Documentation Status

Software Life Cycle

Release

Join us at Discord

About

Currently, there are several data sets on regional, national and global scales with information on land use and land cover that aim to support a large number of applications, including the management of natural resources, climate change and its impacts, and biodiversity conservation. These data products are generated using different approaches and methodologies, which present information about different classes of the earth's surface, such as forests, agricultural plantations, among others. Initiatives that generate land use and land cover maps normally develop their own classification system, with different nomenclatures and meanings of the classes used.

In this context, the LCCS-WS (Land Cover Classification System Web Service) aims to provide a simple interface to access the various classification systems in use and their respective classes. Therefore, this service proposes a representation for the classification systems and provides an API to access the classes and their symbolizations. It is also possible to stablish mappings between classes of different systems.

If you want to know more about LCCS service, please, take a look at its specification.

Installation

See INSTALL.rst.

Developer Documentation

See https://lccs.readthedocs.io/en/latest/.

License

Copyright (C) 2023 INPE.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

lccs.py's People

Contributors

betonr avatar dependabot[bot] avatar fabianazioti avatar gqueiroz avatar raphaelrpl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lccs.py's Issues

Release version 0.8.0

Tasks:

  • Inform the right version in: lccs/version.py
  • Run all the tests.
  • Create a branch named: b-0.8.
  • From the branch b-0.8, create a tag named: v-0.8.0.
  • In the master branch increase version in lccs/version.py to 1.0.0
  • Notify users that a new version is released.

Release version 0.2.0

Tasks:

  • Inform the right version in: lccs/version.py
  • Run all the tests.
  • Create a branch named: b-0.2.
  • From the branch b-0.2, create a tag named: v-0.2.0.
  • In the master branch increase version in lccs/version.py to 0.4.0
  • Notify users that a new version is released.

Release version 0.4.0

Tasks:

  • Inform the right version in: lccs/version.py
  • Run all the tests.
  • Create a branch named: b-0.4.
  • From the branch b-0.4, create a tag named: v-0.4.0.
  • In the master branch increase version in lccs/version.py to 0.6.0
  • Notify users that a new version is released.

Release version 0.6.0

Tasks:

  • Inform the right version in: lccs/version.py
  • Run all the tests.
  • Create a branch named: b-0.6.
  • From the branch b-0.6, create a tag named: v-0.6.0.
  • In the master branch increase version in lccs/version.py to 0.8.0
  • Notify users that a new version is released.

Bug in client when no access token is provided

There is a bug in lccs.py when a request is made to LCCS Server without property access_token.

curl https://path/to/lccs/classification_systems?access_token=token_e
    return self.svc.lccs_ws.get_system_classification()
  File "/terra_collect/terra_collect/services/lccs_ws.py", line 51, in get_system_classification
    systems = lccs_service.classification_systems
  File "/usr/local/lib/python3.7/site-packages/lccs/lccs.py", line 90, in classification_systems
    return self._get_classification_systems()
  File "/usr/local/lib/python3.7/site-packages/lccs/lccs.py", line 61, in _get_classification_systems
    data = Utils._get(url)
  File "/usr/local/lib/python3.7/site-packages/lccs/utils.py", line 40, in _get
    response.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: NOT FOUND for url: http://dev-lccs-ws:5000/classification_systems&language=pt-br

The error occurs due wrong usage of URI and parameters in request session.

For example:

self._access_token = f'?access_token={access_token}' if access_token else ''

and here

url = f'{self._url}/classification_systems{self._access_token}{self._language}'

You should use something like this

params = {"language": "pt-br"}
if self.access_token:
    params["access_token"] = self.access_token

session.get(SERVICE_RESOURCE_URL, params=params)

DO NOT manually concat these parameters in URL

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.