Examples
List Available Classification Systems
This example shows the list of classification system in a service:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
#
"""LCCS Python Client examples."""
from lccs import LCCS
# Change to the LCCS-WS URL you want to use.
service = LCCS("https://data.inpe.br/bdc/lccs/v1/", access_token='change-me', language='en')
# Returns the list of classification system available on the service
print(service.classification_systems)
Information of Classification System
This example shows the metadata of a specific classification system:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
#
"""LCCS Python Client examples."""
from lccs import LCCS
# Change to the LCCS-WS URL you want to use.
service = LCCS("https://data.inpe.br/bdc/lccs/v1/", access_token='change-me', language='en')
# Return the metadata of a specific classification system
# Make sure the classification system is available in service
classification_system = service.classification_system('prodes-1.0')
# You can access specific attributes
print(classification_system.id)
print(classification_system.name)
print(classification_system.title)
print(classification_system.description)
print(classification_system.authority_name)
print(classification_system.version)
List Classes
This example shows the list of classes giving a specific classification system:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
#
"""LCCS Python Client examples."""
from lccs import LCCS
# Change to the LCCS-WS URL you want to use.
service = LCCS("https://data.inpe.br/bdc/lccs/v1/", 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')
prodes_desflorestamento = classification_system.classes('1')
print(prodes_desflorestamento.title)
Information of Class
This example shows the metadata of classes giving a specific classification system:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
#
"""LCCS Python Client examples."""
from lccs import LCCS
# Change to the LCCS-WS URL you want to use.
service = LCCS("https://data.inpe.br/bdc/lccs/v1/", 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')
# Return the metadata of a specific class
class_metadata = classification_system.classes('Desmatamento')
# You can access specific attributes
print(class_metadata.id)
print(class_metadata.name)
print(class_metadata.description)
print(class_metadata.code)
Mappings
This example shows the list of available mappings in service of a specific classification system:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
#
"""LCCS Python Client examples."""
from lccs import LCCS
# Change to the LCCS-WS URL you want to use.
service = LCCS("https://data.inpe.br/bdc/lccs/v1/", access_token='change-me', language='en')
# Return the list of available clasification system for mapping
available_mappings = service.available_mappings('prodes-1.0')
print(available_mappings)
This example shows the mapping between two classification systems.:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
#
"""LCCS Python Client examples."""
from lccs import LCCS
# Change to the LCCS-WS URL you want to use.
service = LCCS("https://data.inpe.br/bdc/lccs/v1/", access_token='change-me', language='en')
# Returns the mapping between two classification systems.
# Make sure the classification system is available in service
mapping = service.mappings(system_source='prodes-1.0', system_target='terraclass-amz-1.0')
print(mapping)
Styles
This example shows the list of available styles format in service of a specific classification system:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
#
"""LCCS Python Client examples."""
from lccs import LCCS
# Change to the LCCS-WS URL you want to use.
service = LCCS("https://data.inpe.br/bdc/lccs/v1/", access_token='change-me', language='en')
# Get all styles available for a specific classification system
style_formats = service.style_formats(system='prodes-1.0')
print(style_formats)
This example shows how save a style file:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
#
"""LCCS Python Client examples."""
from lccs import LCCS
# Change to the LCCS-WS URL you want to use.
service = LCCS("https://data.inpe.br/bdc/lccs/v1/", access_token='change-me', language='en')
# Save Style File
service.get_style(system='prodes-1.0', style_format='SLD-Feature-Polygon')
# Save Style File passing the path directory
service.get_style(system='prodes-1.0', style_format='SLD-Feature-Polygon', path='/home/user/Downloads/')