Skip to content

Commit 54000c1

Browse files
authoredFeb 7, 2022
Merge pull request #51 from brazil-data-cube/master
Update branch b-0.8 with 0.8.1
2 parents d404e0e + 287cea0 commit 54000c1

25 files changed

+517
-658
lines changed
 

‎CHANGES.rst

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
Changes
1111
=======
1212

13+
Version 0.8.1 (2022-02-07)
14+
--------------------------
15+
16+
- Create a dynamic enum based on supported languages enhancement (`#41 <https://github.com/brazil-data-cube/lccs.py/issues/41>`_).
17+
- Adding allowed language of service (`#48 <https://github.com/brazil-data-cube/lccs.py/issues/48>`_).
18+
- Add fully support with LCCS-WS 0.8.0 (`#47 <https://github.com/brazil-data-cube/lccs.py/issues/47>`_).
19+
20+
1321
Version 0.8.0 (2021-08-11)
1422
--------------------------
1523

‎docs/jsons_example/mapbiomas5_classes.json

-183
This file was deleted.

‎docs/jsons_example/prodes_terraclass_mapping_ex.json

-22
This file was deleted.

‎docs/sphinx/class_system.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Classification System
99
---------------------
1010

1111

12-
.. autoclass:: lccs.class_system::ClassificationSystem
12+
.. autoclass:: lccs.classification_system::ClassificationSystem
1313
:members:
1414
:special-members: __init__
1515
:member-order: bysource

‎docs/sphinx/cli.rst

+33-28
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,56 @@ If you want to know the LCCS version, use the option ``--version`` as in::
1515

1616
Output::
1717

18-
lccs, version 0.6.0
18+
lccs, version 0.9.0
1919

2020

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

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

2525

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

28-
BDC
29-
IBGE
30-
PRODES
31-
MapBiomas5
28+
prodes-1.0
29+
terraclass-amz-1.0
30+
deter-amz-1.0
3231

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

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

3736
Output::
3837

39-
- authority_name: Projeto de Mapeamento Anual da Cobertura e Uso do Solo no Brasil (MapBiomas)
40-
- 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.
41-
- id: 32
38+
- authority_name: INPE
39+
- description: Annual Deforestation Classification System
40+
- id: 1
41+
- identifier: prodes-1.0
4242
- links: [{'href': 'https://brazildatacube.dpi.inpe.br/dev/lccs/classification_system', 'rel': 'parent', 'title': 'Link to this document', 'type': 'application/json'}, ..]
43-
- name: Mapbiomas5
44-
- version: 5
43+
- name: prodes
44+
- title: PRODES
45+
- version: 1.0
46+
- version_predecessor: None
47+
- version_successor: None
48+
4549

4650

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

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

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

53-
Desmatamento
54-
Floresta
55-
Hidrografia
56-
Não Floresta
57-
Nuvem
58-
Resíduo
57+
desflorestamento
58+
floresta
59+
hidrografia
60+
nao-floresta
61+
nuvem
62+
residuo
63+
5964

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

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

6469
The above command will return a::
6570

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

7379

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

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

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

80-
PRODES
86+
Classification System [1:prodes - Version 2]
8187

8288

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

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

8793

8894
Output::
8995

90-
Classification Source: TerraClass_AMZ
91-
Classification Target: PRODES
92-
{'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}
93-
{'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}
96+
Agricultura Anual -> Desmatamento - Degree_of_similarity 0.0
97+
Área Não Observada -> Nuvem - Degree_of_similarity 0.0
9498

9599
.. note::
96100

97101
For more information, type in the command line::
98102

99103
lccs --help
104+

‎examples/available_mappings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from lccs import LCCS
1111

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

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

1818
print(available_mappings)

‎examples/class_metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from lccs import LCCS
1111

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

1515
# Get a specific classification system
1616
# Make sure the classification system is available in service

‎examples/classes.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010
from lccs import LCCS
1111

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

1515
# Get a specific classification system
1616
# Make sure the classification system is available in service
17-
classification_system = service.classification_system('PRODES-1.0')
18-
19-
# Returns all classes belonging to a specific classification system.
20-
classes = classification_system.classes()
21-
print(classes)
17+
classification_system = service.classification_system('prodes-1.0')
2218

19+
prodes_desflorestamento = classification_system.classes('1')
20+
print(prodes_desflorestamento.title)

0 commit comments

Comments
 (0)
Please sign in to comment.