Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update branch b-0.8 with 0.8.1 #51

Merged
merged 13 commits into from
Feb 7, 2022
Merged
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
Changes
=======

Version 0.8.1 (2022-02-07)
--------------------------

- Create a dynamic enum based on supported languages enhancement (`#41 <https://github.com/brazil-data-cube/lccs.py/issues/41>`_).
- Adding allowed language of service (`#48 <https://github.com/brazil-data-cube/lccs.py/issues/48>`_).
- Add fully support with LCCS-WS 0.8.0 (`#47 <https://github.com/brazil-data-cube/lccs.py/issues/47>`_).


Version 0.8.0 (2021-08-11)
--------------------------

Expand Down
183 changes: 0 additions & 183 deletions docs/jsons_example/mapbiomas5_classes.json

This file was deleted.

22 changes: 0 additions & 22 deletions docs/jsons_example/prodes_terraclass_mapping_ex.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/sphinx/class_system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Classification System
---------------------


.. autoclass:: lccs.class_system::ClassificationSystem
.. autoclass:: lccs.classification_system::ClassificationSystem
:members:
:special-members: __init__
:member-order: bysource
61 changes: 33 additions & 28 deletions docs/sphinx/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,56 @@ If you want to know the LCCS version, use the option ``--version`` as in::

Output::

lccs, version 0.6.0
lccs, version 0.9.0


To list the available classification systems in a service, use the ``classification-systems`` command and provides a URL to the ``--url`` option::

lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' classification-systems
lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' --access-token 'change-me' classification-systems


The above command will return a list of classification system names as::

BDC
IBGE
PRODES
MapBiomas5
prodes-1.0
terraclass-amz-1.0
deter-amz-1.0

To get more information about a specific classification system, use the ``classification-systems-describe`` command::

lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' classification-systems-description --system_name 'PRODES-1.0'
lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' --access-token 'change-me' classification-system-description --system 'prodes-1.0'

Output::

- authority_name: Projeto de Mapeamento Anual da Cobertura e Uso do Solo no Brasil (MapBiomas)
- description: O Projeto de Mapeamento Anual da Cobertura e Uso do Solo do Brasil é uma iniciativa que envolve uma rede colaborativa com especialistas nos biomas, usos da terra, sensoriamento remoto, SIG e ciência da computação que utiliza processamento em nuvem e classificadores automatizados desenvolvidos e operados a partir da plataforma Google Earth Engine para gerar uma série histórica de mapas anuais de cobertura e uso da terra do Brasil.
- id: 32
- authority_name: INPE
- description: Annual Deforestation Classification System
- id: 1
- identifier: prodes-1.0
- links: [{'href': 'https://brazildatacube.dpi.inpe.br/dev/lccs/classification_system', 'rel': 'parent', 'title': 'Link to this document', 'type': 'application/json'}, ..]
- name: Mapbiomas5
- version: 5
- name: prodes
- title: PRODES
- version: 1.0
- version_predecessor: None
- version_successor: None



List the available classes of a classification system, use the ``classes`` command::

lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' classes --system_name 'PRODES-1.0'
lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' --access-token 'change-me' classes --system 'prodes-1.0'

The above command will return a list of classes of PRODES as::

Desmatamento
Floresta
Hidrografia
Não Floresta
Nuvem
Resíduo
desflorestamento
floresta
hidrografia
nao-floresta
nuvem
residuo


To get more information about a specific class, use the ``class-describe`` command::

lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' class-describe --system_name 'PRODES-1.0' --class_name 'Desflorestamento'
lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' --access-token 'change-me' class-describe --system 'prodes-1.0' --system_class 'desflorestamento'

The above command will return a::

Expand All @@ -68,32 +73,32 @@ The above command will return a::
- description:
- id: 1
- links: [[{'href': 'https://brazildatacube.dpi.inpe.br/dev/lccs/classification_system/1/classes/1', 'rel': 'self', 'title': 'Link to this document', 'type': 'application/json'},...]
- name: Desflorestamento
- name: desflorestamento
- title: Deforestation


Retrieve all available classification system mappings, use the ``available-mappings`` command::

lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' available-mappings --system_name_source 'TerraClass_AMZ'
lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' --access-token 'change-me' available-mappings --system 'terraclass-amz-1.0'

The above command will return a list of classification systems as::

PRODES
Classification System [1:prodes - Version 2]


To get a mapping between classification systems, use the ``mappings`` command::

lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' mappings --system_id_source 'TerraClass_AMZ' --system_id_target 'PRODES'
lccs --url 'https://brazildatacube.dpi.inpe.br/dev/lccs/' mappings --system_id_source 'terraclass-amz-1.0' --system_id_target 'prodes-1.0'


Output::

Classification Source: TerraClass_AMZ
Classification Target: PRODES
{'degree_of_similarity': 1.0, 'description': '', 'links': [{'href': 'https://brazildatacube.dpi.inpe.br/dev/lccs/classification_system/TerraClass_AMZ/classes/Agricultura Anual', 'rel': 'item', 'title': 'Link to the source class', 'type': 'application/json'}, {'href': 'https://brazildatacube.dpi.inpe.br/dev/lccs/classification_system/TerraClass_AMZ/classes/Desmatamento', 'rel': 'item', 'title': 'Link to target class', 'type': 'application/json'}], 'source': 'Agricultura Anual', 'source_id': 85, 'target': 'Desmatamento', 'target_id': 175}
{'degree_of_similarity': 1.0, 'description': '', 'links': [{'href': 'https://brazildatacube.dpi.inpe.br/dev/lccs/classification_system/TerraClass_AMZ/classes/Área Não Observada', 'rel': 'item', 'title': 'Link to the source class', 'type': 'application/json'}, {'href': 'https://brazildatacube.dpi.inpe.br/dev/lccs/classification_system/TerraClass_AMZ/classes/Nuvem', 'rel': 'item', 'title': 'Link to target class', 'type': 'application/json'}], 'source': 'Área Não Observada', 'source_id': 86, 'target': 'Nuvem', 'target_id': 179}
Agricultura Anual -> Desmatamento - Degree_of_similarity 0.0
Área Não Observada -> Nuvem - Degree_of_similarity 0.0

.. note::

For more information, type in the command line::

lccs --help

4 changes: 2 additions & 2 deletions examples/available_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from lccs import LCCS

# Change to the LCCS-WS URL you want to use.
service = LCCS("https://brazildatacube.dpi.inpe.br/lccs/")
service = LCCS("https://brazildatacube.dpi.inpe.br/lccs/", access_token='change-me', language='en')

# Return the list of available clasification system for mapping
available_mappings = service.available_mappings('PRODES-1.0')
available_mappings = service.available_mappings('prodes-1.0')

print(available_mappings)
2 changes: 1 addition & 1 deletion examples/class_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from lccs import LCCS

# Change to the LCCS-WS URL you want to use.
service = LCCS("http://brazildatacube.dpi.inpe.br/dev/lccs/")
service = LCCS("http://brazildatacube.dpi.inpe.br/dev/lccs/", access_token='change-me', language='en')

# Get a specific classification system
# Make sure the classification system is available in service
Expand Down
10 changes: 4 additions & 6 deletions examples/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
from lccs import LCCS

# Change to the LCCS-WS URL you want to use.
service = LCCS("https://brazildatacube.dpi.inpe.br/lccs/")
service = LCCS("https://brazildatacube.dpi.inpe.br/lccs/", access_token='change-me', language='en')

# Get a specific classification system
# Make sure the classification system is available in service
classification_system = service.classification_system('PRODES-1.0')

# Returns all classes belonging to a specific classification system.
classes = classification_system.classes()
print(classes)
classification_system = service.classification_system('prodes-1.0')

prodes_desflorestamento = classification_system.classes('1')
print(prodes_desflorestamento.title)
Loading