Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoSentinel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoSentinel
Commits
b8c6934d
Commit
b8c6934d
authored
May 09, 2018
by
Alfonso Ramire Pedraza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
dc24cac1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
APISentinel.py
geosentinel/APISentinel.py
+8
-10
No files found.
geosentinel/APISentinel.py
View file @
b8c6934d
...
@@ -17,7 +17,7 @@ class APISentinel(object):
...
@@ -17,7 +17,7 @@ class APISentinel(object):
""" Class for Sentinel satellites configuration
""" Class for Sentinel satellites configuration
Test Case
Test Case
>>> sentinel = APISentinel('asalazarg', 'geo135asg')
>>> sentinel = APISentinel('asalazarg', 'geo135asg')
>>> dir="
../../../Documentos/Image_Sentinel
"
>>> dir="
make
"
>>> products = sentinel.getProducts("POLYGON((-89.99450683593753 21.279137394108716,-89.13757324218751 21.2996106049456,-89.30236816406251 20.68418377935238,-90.0494384765625 20.715015145512098,-89.99450683593753 21.279137394108716))", ('20151219', date(2015,12,29)), {"platformname":"Sentinel-1"})
>>> products = sentinel.getProducts("POLYGON((-89.99450683593753 21.279137394108716,-89.13757324218751 21.2996106049456,-89.30236816406251 20.68418377935238,-90.0494384765625 20.715015145512098,-89.99450683593753 21.279137394108716))", ('20151219', date(2015,12,29)), {"platformname":"Sentinel-1"})
>>> print len(products)
>>> print len(products)
3
3
...
@@ -46,13 +46,14 @@ class APISentinel(object):
...
@@ -46,13 +46,14 @@ class APISentinel(object):
self
.
api
=
SentinelAPI
(
self
.
username
,
self
.
password
,
self
.
URL_Sentinel
)
self
.
api
=
SentinelAPI
(
self
.
username
,
self
.
password
,
self
.
URL_Sentinel
)
def
getProducts
(
self
,
area
,
date
,
searchParameters
):
def
getProducts
(
self
,
area
,
date
,
searchParameters
):
"""Gets
products list Sentinel
"""Gets
Sentinel products list that match the search parameters.
Args:
Args:
self (pointer): The object pointer.
self (pointer): The object pointer.
area (str):
Polygon WKT to find images
.
area (str):
area of interest using a Polygon in WKT format
.
Example:
Example:
args.footprint = geojson_to_wkt(read_geojson(path_json))
"POLYGON((-89.99 21.27,-89.13 21.29,-89.30 20.68,-90.04 20.71,-89.99 21.27))"
date (str): Initial date and end date.
date (str): Initial date and end date.
searchParameters (str): Type platform Sentinel-1 or Sentinel-2
searchParameters (str): Type platform Sentinel-1 or Sentinel-2
Other Parameters: Additional keywords can be used to specify other query parameters, e.g. relativeorbitnum-
Other Parameters: Additional keywords can be used to specify other query parameters, e.g. relativeorbitnum-
...
@@ -62,7 +63,7 @@ class APISentinel(object):
...
@@ -62,7 +63,7 @@ class APISentinel(object):
(that is:'beginposition', 'endposition',
(that is:'beginposition', 'endposition',
Returns:
Returns:
Order
dDict: Product list Sentinel
found.
Order
edDict: Sentinel Product list
found.
"""
"""
products_list
=
self
.
api
.
query
(
area
,
date
,
**
searchParameters
)
products_list
=
self
.
api
.
query
(
area
,
date
,
**
searchParameters
)
return
products_list
return
products_list
...
@@ -72,11 +73,8 @@ class APISentinel(object):
...
@@ -72,11 +73,8 @@ class APISentinel(object):
Args:
Args:
self (pointer): The object pointer.
self (pointer): The object pointer.
products (str): Product(s) list Sentinel found.
products (OrderedDict): Product(s) to download.
dir (str): Local path to save download files.
dir (str): destination directory.
Returns:
Save Sentinel files.
"""
"""
os
.
chdir
(
dir
)
os
.
chdir
(
dir
)
self
.
api
.
download_all
(
products
)
self
.
api
.
download_all
(
products
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment