Skip to content

Commit

Permalink
Merge pull request #37 from fabianazioti/master
Browse files Browse the repository at this point in the history
updating comments in examples code
  • Loading branch information
raphaelrpl authored Dec 15, 2020
2 parents fb399a9 + 164c464 commit b6d6d33
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
12 changes: 4 additions & 8 deletions docs/sphinx/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,29 @@ List Available Collections

This example shows the list of collections in a service:


.. literalinclude:: ../../examples/list_collection.py
:language: python
:lines: 11-
:lines: 12-

Describe Collections
------------------------


This example shows the metadata of a collection:


.. literalinclude:: ../../examples/describe_collection.py
:language: python
:lines: 11-
:lines: 12-

Trajectory
-----------


This example shows how to retrieve a trajectory:


.. literalinclude:: ../../examples/trajectory.py
:language: python
:lines: 11-
:lines: 12-


Text Representations
Expand All @@ -52,7 +49,6 @@ Text Representations

This example shows how the various text representation for services and coverages:


.. literalinclude:: ../../examples/text-repr.py
:language: python
:lines: 11-
:lines: 14-
4 changes: 2 additions & 2 deletions examples/describe_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

from wlts import WLTS

# Change to the WLTS URL you want to use.
# Specify the URL of the WLTS instance to be used
service = WLTS('http://brazildatacube.dpi.inpe.br/wlts/')

# Get collection metadata
print(service['prodes_amz_legal'])
print(service['prodes_amazonia_legal'])
11 changes: 8 additions & 3 deletions examples/ex-01.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

from wlts import WLTS

# Change to the WLTS URL you want to use.
# You should create a WLTS object attached to a given service
# (Specify the URL of the WLTS instance to be used ):
service = WLTS('http://brazildatacube.dpi.inpe.br/wlts/')

print(repr(service))
Expand All @@ -19,10 +20,14 @@
# Returns the list of collections available on the service
print(service.collections)

# Get Service metadata
# Return the metadata of a specific collection
# The collection name may not be same.
# Make sure the collection is available in service, using the previous operation (service.collection)
print(service['deter_amz_legal'])

# Example of trajectory operation
tj = service.tj(latitude=-12.0, longitude=-54.0, collections='mapbiomas_amz_4_1')
# The collection name may not be same.
# Make sure the collection is available in service, using the previous operation (service.collection)
tj = service.tj(latitude=-12.0, longitude=-54.0, collections='mapbiomas5_amazonia')

print(tj.trajectory)
3 changes: 2 additions & 1 deletion examples/list_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

from wlts import WLTS

# Change to the WLTS URL you want to use.
# You should create a wlts object attached to a given service
# Specify the URL of the WLTS instance to be used
service = WLTS('http://brazildatacube.dpi.inpe.br/wlts/')

# Returns the list of collections available on the service
Expand Down
12 changes: 9 additions & 3 deletions examples/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@

from wlts import WLTS

# Change to the WLTS URL you want to use.
# Specify the URL of the WLTS instance to be used
service = WLTS('http://brazildatacube.dpi.inpe.br/wlts/')

# Example of trajectory operation
tj = service.tj(latitude=-12.0, longitude=-54.0, collections='mapbiomas_amz_4_1')
tj = service.tj(latitude=-12.0, longitude=-54.0)

print(tj.trajectory)
print(tj.trajectory)

# The collection name may not be same.
# Make sure the collection is available in service
tj_two = service.tj(latitude=-12.0, longitude=-54.0, collections='mapbiomas5_amazonia')

print(tj_two.trajectory)

0 comments on commit b6d6d33

Please sign in to comment.