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
3aad299f
Commit
3aad299f
authored
May 27, 2018
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try connect with front
parent
280581a2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
38 deletions
+51
-38
sentinel.py
catalog/apis/sentinel.py
+16
-6
base_top.html
catalog/templates/base_top.html
+17
-23
views.py
catalog/views.py
+18
-9
No files found.
catalog/apis/sentinel.py
View file @
3aad299f
import
imp
import
imp
class
APISentinel
():
class
APISentinel
():
def
getProducts
(
this
):
GeoSentinel_path
=
"/home/emmanuelhp/Documentos/GeoSentinel/geosentinel/APISentinel.py"
# area example:
# POLYGON((-89.62543487548828 21.068482340502072,-89.51351165771484 20.918472761430806,
# -89.72705841064453 20.9203969139719,-89.62543487548828 21.068482340502072))
# date example:
# ('20180101', '20180517')
# cloudPercentage axample:
# "[0 TO 10]"
# 95
def
getProducts
(
this
,
area
,
initDate
,
endDate
,
cloudPercentage
):
GeoSentinel_path
=
"/home/emmanuelhp/Documentos/geo/GeoSentinel/geosentinel/APISentinel.py"
api
=
imp
.
load_source
(
'geosentinel'
,
GeoSentinel_path
)
api
=
imp
.
load_source
(
'geosentinel'
,
GeoSentinel_path
)
sentinel
=
api
.
APISentinel
(
'emmhp'
,
'geoemm29'
)
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
:
products
=
sentinel
.
getProducts
(
area
,
(
initDate
,
endDate
),
print
products
[
p
][
"size"
]
{
"platformname"
:
"Sentinel-2"
,
"cloudcoverpercentage"
:
cloudPercentage
})
return
products
catalog/templates/base_top.html
View file @
3aad299f
...
@@ -104,40 +104,36 @@
...
@@ -104,40 +104,36 @@
<div
class=
"tab-content"
>
<div
class=
"tab-content"
>
<!-- Home tab content -->
<!-- Home tab content -->
<div
class=
"tab-pane"
id=
"control-sidebar-home-tab"
>
<div
class=
"tab-pane"
id=
"control-sidebar-home-tab"
>
<h3
class=
"control-sidebar-heading"
>
Recent Activity
</h3>
<h3
class=
"control-sidebar-heading"
>
Products
</h3>
<ul
class=
"control-sidebar-menu"
>
<ul
class=
"control-sidebar-menu"
>
<li>
<li>
{% if catalog %}
<p>
HI BUDDY
</p>
{% endif %}
<a
href=
"javascript:void(0)"
>
<a
href=
"javascript:void(0)"
>
<i
class=
"menu-icon fa fa-birthday-cake bg-red"
></i>
<i
class=
"menu-icon fa fa-birthday-cake bg-red"
></i>
<div
class=
"menu-info"
>
<div
class=
"menu-info"
>
<h4
class=
"control-sidebar-subheading"
>
Langdon's Birthday
</h4>
<h4
class=
"control-sidebar-subheading"
>
first image
</h4>
<p>
<p>
Will be 23 on April 24th
</p>
size: 700 mb
Date: April 11th
</p>
</div>
</div>
</a>
</a>
</li>
</ul>
<!-- /.control-sidebar-menu -->
<h3
class=
"control-sidebar-heading"
>
Tasks Progress
</h3>
<ul
class=
"control-sidebar-menu"
>
<li>
<a
href=
"javascript:void(0)"
>
<a
href=
"javascript:void(0)"
>
<
h4
class=
"control-sidebar-subheading"
>
<
i
class=
"menu-icon fa fa-birthday-cake bg-red"
></i
>
Custom Template Design
<div
class=
"menu-info"
>
<
span
class=
"label label-danger pull-right"
>
70%
</span
>
<
h4
class=
"control-sidebar-subheading"
>
second image
</h4
>
</h4
>
<p
>
size: 900 mb
<div
class=
"progress progress-xxs"
>
Date: April 19th
<
div
class=
"progress-bar progress-bar-danger"
style=
"width: 70%"
></div
>
<
/p
>
</div>
</div>
</a>
</a>
</li>
</li>
</ul>
</ul>
<!-- /.control-sidebar-menu -->
</div>
</div>
<!-- /.tab-pane -->
<!-- /.tab-pane -->
...
@@ -161,8 +157,6 @@
...
@@ -161,8 +157,6 @@
</div>
</div>
<!-- /.form-group -->
<!-- /.form-group -->
<h3
class=
"control-sidebar-heading"
>
Chat Settings
</h3>
<h3
class=
"control-sidebar-heading"
>
Chat Settings
</h3>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
...
...
catalog/views.py
View file @
3aad299f
...
@@ -37,18 +37,27 @@ def productList(request):
...
@@ -37,18 +37,27 @@ def productList(request):
"""
"""
View function for home page of site.
View function for home page of site.
"""
"""
s
=
APISentinel
()
queryDict
=
request
.
POST
s
.
getProducts
()
r2
=
dict
(
request
.
POST
)
polygon
=
queryDict
[
"polygon"
]
r2
.
pop
(
'csrfmiddlewaretoken'
,
None
)
process
=
queryDict
[
"platform"
]
url
=
'https://api.daac.asf.alaska.edu/services/search/param?'
+
urlencode
(
r2
,
'utf-8'
)
+
"&output=JSON"
endDate
=
queryDict
[
"end"
]
initDate
=
queryDict
[
"start"
]
cloudPercentage
=
queryDict
[
"cloudPercentage"
]
sentinel
=
APISentinel
()
products
=
sentinel
.
getProducts
(
polygon
,
initDate
,
endDate
,
cloudPercentage
)
# response = requests.get(url)
products_json
=
json
.
dumps
(
products
,
ensure_ascii
=
False
,
default
=
str
)
# json = response.json()
return
render
(
request
,
'productList.html'
,{})
#"catalog":json[0]})
# r2 = dict(request.POST)
# r2.pop('csrfmiddlewaretoken', None)
# url = 'https://api.daac.asf.alaska.edu/services/search/param?'+urlencode(r2, 'utf-8')+"&output=JSON"
# response = requests.get(url)
# json = response.json()
return
render
(
request
,
'base_top.html'
,
{
"catalog"
:
products_json
})
#"catalog":json[0]})
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
class
SearchSubmitView
(
View
):
class
SearchSubmitView
(
View
):
...
...
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