Skip to content

Commit 9c95b79

Browse files
authored
Merge pull request #32 from fabianazioti/r040
moving cli.rst to docs and close #7
2 parents 5f4ac17 + 675790e commit 9c95b79

20 files changed

+691
-162
lines changed

CHANGES.rst

+22-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,25 @@
1010
Changes
1111
=======
1212

13-
**Under Development!**
13+
Version 0.4.0-0 (2021-01-07)
14+
----------------------------
15+
16+
- Command Line Interface (CLI).
17+
18+
- Support for the `LCCS-WS specification version 0.4.0-0 <https://github.com/brazil-data-cube/lccs-ws-spec>`_.
19+
20+
- Documentation system based on Sphinx.
21+
22+
- Documentation integrated to ``Read the Docs``.
23+
24+
- Installation and build instructions.
25+
26+
- Package support through Setuptools.
27+
28+
- Installation and usage instructions.
29+
30+
- Travis CI support.
31+
32+
- Source code versioning based on `Semantic Versioning 2.0.0 <https://semver.org/>`_.
33+
34+
- License: `MIT <https://github.com/gqueiroz/wtss.py/blob/master/LICENSE>`_.

CLI.rst

-140
This file was deleted.

INSTALL.rst

+27-1
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@ Production installation
1919
Development Installation - GitHub
2020
---------------------------------
2121

22+
Clone the Software Repository
23+
+++++++++++++++++++++++++++++
2224

23-
Clone the software repository:
25+
Use ``git`` to clone the software repository:
2426

2527
.. code-block:: shell
2628
2729
$ git clone https://github.com/brazil-data-cube/lccs.py.git
2830
31+
Install lccs.py in Development Mode
32+
+++++++++++++++++++++++++++++++++++
33+
2934
Go to the source code folder:
3035

3136
.. code-block:: shell
@@ -38,6 +43,27 @@ Install in development mode:
3843
3944
$ pip3 install -e .[all]
4045
46+
.. note::
47+
48+
If you want to create a new *Python Virtual Environment*, please, follow this instruction:
49+
50+
*1.* Create a new virtual environment linked to Python 3.7::
51+
52+
python3.7 -m venv venv
53+
54+
55+
**2.** Activate the new environment::
56+
57+
source venv/bin/activate
58+
59+
60+
**3.** Update pip and setuptools::
61+
62+
pip3 install --upgrade pip
63+
64+
pip3 install --upgrade setuptools
65+
66+
4167
Run the Tests
4268
+++++++++++++
4369

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ recursive-include docs *.py
1919
recursive-include docs *.rst
2020
recursive-include docs *.ico
2121
recursive-include docs *.png
22+
recursive-include docs *.json
23+
recursive-include docs *.qml
2224
recursive-include docs Makefile
2325
recursive-include tests *.py
2426
recursive-include tests *.json

README.rst

-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ Installation
5454
See `INSTALL.rst <./INSTALL.rst>`_.
5555

5656

57-
Using LCCS in the Command Line
58-
==============================
59-
60-
See `CLI.rst <./CLI.rst>`_.
61-
6257
Developer Documentation
6358
=======================
6459

docs/sphinx/cli.rst

+94-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,97 @@
55
Python Client Library for the LCCS Web Service is free software; you can redistribute it and/or modify it
66
under the terms of the MIT License; see LICENSE file for more details.
77

8-
.. include:: ../../CLI.rst
8+
Running LCCS Client in the Command Line
9+
=======================================
10+
11+
If you want to know the LCCS version, use the option ``--version`` as in::
12+
13+
lccs --version
14+
15+
16+
Output::
17+
18+
lccs, version 0.4.0.post0
19+
20+
21+
To list the available classification systems in a service, use the ``classification-systems`` command and provides a URL to the ``--url`` option::
22+
23+
lccs --url 'http://brazildatacube.dpi.inpe.br/dev/lccs/' classification-systems
24+
25+
26+
The above command will return a list of classification system names as::
27+
28+
BDC
29+
IBGE
30+
PRODES
31+
MapBiomas5
32+
33+
To get more information about a specific classification system, use the ``classification-systems-describe`` command::
34+
35+
lccs --url 'http://brazildatacube.dpi.inpe.br/dev/lccs/' classification-systems-describe --system_id 'PRODES'
36+
37+
Output::
38+
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
42+
- links: [{'href': 'http://brazildatacube.dpi.inpe.br/dev/lccs/classification_system', 'rel': 'parent', 'title': 'Link to this document', 'type': 'application/json'}, ..]
43+
- name: Mapbiomas5
44+
- version: 5
45+
46+
47+
List the available classes of a classification system, use the ``classes`` command::
48+
49+
lccs --url 'http://brazildatacube.dpi.inpe.br/dev/lccs/' classes --system_id 'PRODES'
50+
51+
The above command will return a list of classes of PRODES as::
52+
53+
Desmatamento
54+
Floresta
55+
Hidrografia
56+
Não Floresta
57+
Nuvem
58+
Resíduo
59+
60+
To get more information about a specific class, use the ``class-describe`` command::
61+
62+
lccs --url 'http://brazildatacube.dpi.inpe.br/dev/lccs/' class-describe --system_id 'PRODES' --class_id 'Desmatamento'
63+
64+
The above command will return a::
65+
66+
- class_parent: None
67+
- classification_system_id: 4
68+
- classification_system_name: PRODES
69+
- code: DESMATAMENTO
70+
- description:
71+
- id: 1
72+
- links: [[{'href': 'http://brazildatacube.dpi.inpe.br/dev/lccs/classification_system/PRODES/classes/Desmatamento', 'rel': 'self', 'title': 'Link to this document', 'type': 'application/json'},...]
73+
- name: Desmatamento
74+
75+
76+
Retrieve all available classification system mappings, use the ``available-mappings`` command::
77+
78+
lccs --url 'http://brazildatacube.dpi.inpe.br/dev/lccs/' available-mappings --system_id_source 'TerraClass_AMZ'
79+
80+
The above command will return a list of classification systems as::
81+
82+
PRODES
83+
84+
85+
To get a mapping between classification systems, use the ``mappings`` command::
86+
87+
lccs --url 'http://brazildatacube.dpi.inpe.br/dev/lccs/' mappings --system_id_source 'TerraClass_AMZ' --system_id_target 'PRODES'
88+
89+
90+
Output::
91+
92+
Classification Source: TerraClass_AMZ
93+
Classification Target: PRODES
94+
{'degree_of_similarity': 1.0, 'description': '', 'links': [{'href': 'http://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': 'http://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}
95+
{'degree_of_similarity': 1.0, 'description': '', 'links': [{'href': 'http://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': 'http://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+
97+
.. note::
98+
99+
For more information, type in the command line::
100+
101+
lccs --help

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://0.0.0.0:5000/")
13+
service = LCCS("http://brazildatacube.dpi.inpe.br/dev/lccs/")
1414

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

examples/classes.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://0.0.0.0:5000/")
13+
service = LCCS("http://brazildatacube.dpi.inpe.br/dev/lccs/")
1414

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

examples/classification_system_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://0.0.0.0:5000/")
13+
service = LCCS("http://brazildatacube.dpi.inpe.br/dev/lccs/")
1414

1515
# Return the metadata of a specific classification system
1616
# Make sure the classification system is available in service

examples/classification_systems.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://0.0.0.0:5000/")
13+
service = LCCS("http://brazildatacube.dpi.inpe.br/dev/lccs/")
1414

1515
# Returns the list of classification system available on the service
1616
print(service.classification_systems)

0 commit comments

Comments
 (0)