Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
a9333f8a
Commit
a9333f8a
authored
May 25, 2018
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import sentinel api
parent
7ed2e9af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
views.py
catalog/views.py
+11
-4
No files found.
catalog/views.py
View file @
a9333f8a
...
@@ -10,14 +10,14 @@ from django.views.generic.base import View
...
@@ -10,14 +10,14 @@ from django.views.generic.base import View
from
django.template
import
loader
from
django.template
import
loader
from
urllib
import
urlencode
from
urllib
import
urlencode
import
requests
,
json
,
unicodedata
import
requests
,
json
,
unicodedata
import
imp
# Create your views here.
# Create your views here.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
def
login
(
request
):
def
login
(
request
):
"""
"""
View function for home page of site.
View function for home page of site.
"""
"""
# Render the HTML template index.html with the data in the context variable
# Render the HTML template index.html with the data in the context variable
...
@@ -37,11 +37,18 @@ def productList(request):
...
@@ -37,11 +37,18 @@ def productList(request):
"""
"""
View function for home page of site.
View function for home page of site.
"""
"""
GeoSentinel_path
=
"/home/emmanuelhp/Documentos/GeoSentinel/geosentinel/APISentinel.py"
api
=
imp
.
load_source
(
'geosentinel'
,
GeoSentinel_path
)
sentinel
=
api
.
APISentinel
(
'emmhp'
,
'geoemm29'
)
area
=
"POLYGON((-89.62543487548828 21.068482340502072,-89.51351165771484 20.918472761430806,-89.72705841064453 20.9203969139719,-89.62543487548828 21.068482340502072))"
products
=
sentinel
.
getProducts
(
area
,
(
'20180101'
,
'20180517'
),
{
"platformname"
:
"Sentinel-2"
,
"cloudcoverpercentage"
:
"[0 TO 10]"
})
for
p
in
products
:
print
products
[
p
][
"size"
]
r2
=
dict
(
request
.
POST
)
r2
=
dict
(
request
.
POST
)
r2
.
pop
(
'csrfmiddlewaretoken'
,
None
)
r2
.
pop
(
'csrfmiddlewaretoken'
,
None
)
url
=
'https://api.daac.asf.alaska.edu/services/search/param?'
+
urlencode
(
r2
,
'utf-8'
)
+
"&output=JSON"
url
=
'https://api.daac.asf.alaska.edu/services/search/param?'
+
urlencode
(
r2
,
'utf-8'
)
+
"&output=JSON"
print
url
# response = requests.get(url)
# response = requests.get(url)
...
...
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