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
4b7e7f9e
Commit
4b7e7f9e
authored
Mar 29, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.geoint.mx/mario.chirinos/GeoInt_SIDT
into modificaciones
parents
11c41191
ad365745
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
views.py
catalog/views.py
+13
-11
sclData.html
reports/templates/sclData.html
+1
-1
views.py
reports/views.py
+4
-3
No files found.
catalog/views.py
View file @
4b7e7f9e
...
@@ -525,8 +525,8 @@ def Pay(request):
...
@@ -525,8 +525,8 @@ def Pay(request):
user
=
User
.
objects
.
get
(
id
=
request
.
user
.
id
)
user
=
User
.
objects
.
get
(
id
=
request
.
user
.
id
)
product_list
=
[]
product_list
=
[]
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'search__area'
,
'user'
,
'user__username'
,
'user__email'
,
'search_id'
,
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'search__area'
,
'user'
,
'user__username'
,
'user__email'
,
'search_id'
,
'search__clouds'
,
'search__startDate'
,
'search__endDate'
,
'search__search_name'
,
'search__description'
)
.
filter
(
user
=
user
,
'search__clouds'
,
'search__startDate'
,
'search__endDate'
,
'search__process_id__name'
,
purchased
=
0
)
'search__process_id__productLevel'
,
'search__process_id__platform__name'
)
.
filter
(
user
=
user
,
purchased
=
0
)
for
product
in
product_list
:
for
product
in
product_list
:
...
@@ -537,7 +537,10 @@ def Pay(request):
...
@@ -537,7 +537,10 @@ def Pay(request):
# print(str(product['search__endDate'].date()).replace("-", ""))
# print(str(product['search__endDate'].date()).replace("-", ""))
# print(product['search__clouds'])
# print(product['search__clouds'])
# print(product['search__area'])
# print(product['search__area'])
print
(
product
[
'id'
])
#print(product['search__process_id__name']) # Classification scene L1C o Classification scene L2A
#print(product['search__process_id__productLevel']) #L1C o L2A
#print(product['search__process_id__platform__name']) #Sentinel1 o Sentinel2
#print(product['id'])
username
=
product
[
'user__username'
]
username
=
product
[
'user__username'
]
useremail
=
product
[
'user__email'
]
useremail
=
product
[
'user__email'
]
...
@@ -551,19 +554,19 @@ def Pay(request):
...
@@ -551,19 +554,19 @@ def Pay(request):
if
not
os
.
path
.
exists
(
purchase_dir
):
if
not
os
.
path
.
exists
(
purchase_dir
):
os
.
makedirs
(
purchase_dir
)
os
.
makedirs
(
purchase_dir
)
products_dir
=
NAS_PATH
+
"sentinelImages/
L2A/
"
products_dir
=
NAS_PATH
+
"sentinelImages/"
linksDir
=
purchase_dir
+
"/L2A
/"
projectDir
=
purchase_dir
+
"
/"
# obtiene los datos para el json
# obtiene los datos para el json
data
=
{}
data
=
{}
data
[
'wkt'
]
=
product
[
'search__area'
]
data
[
'wkt'
]
=
product
[
'search__area'
]
data
[
'platform'
]
=
'Sentinel-2'
data
[
'platform'
]
=
product
[
'search__process_id__platform__name'
]
#
'Sentinel-2'
data
[
'productLevel'
]
=
'L2A'
data
[
'productLevel'
]
=
product
[
'search__process_id__productLevel'
]
#
'L2A'
data
[
'startDate'
]
=
str
(
product
[
'search__startDate'
]
.
date
())
.
replace
(
"-"
,
""
)
# quita los guiones de la fecha
data
[
'startDate'
]
=
str
(
product
[
'search__startDate'
]
.
date
())
.
replace
(
"-"
,
""
)
# quita los guiones de la fecha
data
[
'endDate'
]
=
str
(
product
[
'search__endDate'
]
.
date
())
.
replace
(
"-"
,
""
)
# quita los guiones de la fecha
data
[
'endDate'
]
=
str
(
product
[
'search__endDate'
]
.
date
())
.
replace
(
"-"
,
""
)
# quita los guiones de la fecha
data
[
'clouds'
]
=
product
[
'search__clouds'
]
data
[
'clouds'
]
=
product
[
'search__clouds'
]
data
[
'productsDir'
]
=
products_dir
data
[
'productsDir'
]
=
products_dir
data
[
'
linksDir'
]
=
links
Dir
data
[
'
projectDir'
]
=
project
Dir
data
[
'username'
]
=
API_SENTINEL_USER
data
[
'username'
]
=
API_SENTINEL_USER
data
[
'password'
]
=
API_SENTINEL_PASS
data
[
'password'
]
=
API_SENTINEL_PASS
...
@@ -576,8 +579,7 @@ def Pay(request):
...
@@ -576,8 +579,7 @@ def Pay(request):
fidProductsFile
.
write
(
json_data
)
fidProductsFile
.
write
(
json_data
)
fidProductsFile
.
close
()
fidProductsFile
.
close
()
os
.
system
(
os
.
system
(
SENTINEL_PATH
+
"/tools/L2ASCL_AreaProcessing.sh "
+
purchase_dir
+
"/ 1 > "
+
purchase_dir
+
"/L2ASCL_AreaProcessing.log"
)
###ejecuta el proceso
SENTINEL_PATH
+
"/tools/L2ASCL_AreaProcessing.sh "
+
purchase_dir
+
"/ 1 > "
+
purchase_dir
+
"/L2ASCL_AreaProcessing.log"
)
###ejecuta el proceso
...
@@ -600,7 +602,7 @@ def Pay(request):
...
@@ -600,7 +602,7 @@ def Pay(request):
# -------------------------------------
# -------------------------------------
Purchase
.
objects
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
0
,
pk
=
product
[
'id'
])
.
update
(
purchased
=
True
,
description
=
product
[
'search__description'
],
name
=
product
[
'search__search_name'
]
)
Purchase
.
objects
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
0
)
.
update
(
purchased
=
True
)
return
redirect
(
'../../reports'
)
return
redirect
(
'../../reports'
)
...
...
reports/templates/sclData.html
View file @
4b7e7f9e
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
<div
class=
"row col-lg-11 title"
>
<div
class=
"row col-lg-11 title"
>
<div
class=
"box box-success box-solid info"
>
<div
class=
"box box-success box-solid info"
>
<div
class=
"box-header with-border"
>
<div
class=
"box-header with-border"
>
<h3>
{{ searchInfo.title }} {{ searchInfo.startDate }} to {{ searchInfo.endDate}}
</h3>
<h3>
{{ searchInfo.title }}
,
{{ searchInfo.startDate }} to {{ searchInfo.endDate}}
</h3>
<h6>
{{ searchInfo.report_name }}
</h6>
<h6>
{{ searchInfo.report_name }}
</h6>
<!-- /.box-tools -->
<!-- /.box-tools -->
</div>
</div>
...
...
reports/views.py
View file @
4b7e7f9e
...
@@ -46,7 +46,7 @@ def report_L2ASCL(request, purchase_id):
...
@@ -46,7 +46,7 @@ def report_L2ASCL(request, purchase_id):
template
=
"sclData.html"
template
=
"sclData.html"
reporteDir
=
'mask'
reporteDir
=
'mask'
folders
=
""
folders
=
""
purchase
=
Purchase
.
objects
.
values
(
'user__email'
,
'is_public'
,
'search__search_name'
,
purchase
=
Purchase
.
objects
.
values
(
'user__email'
,
'is_public'
,
'
name'
,
'
search__search_name'
,
'search__process_id__name'
)
.
get
(
pk
=
purchase_id
)
'search__process_id__name'
)
.
get
(
pk
=
purchase_id
)
email
=
purchase
[
'user__email'
]
email
=
purchase
[
'user__email'
]
path
=
USERS_PATH
+
email
+
'/'
+
purchase_id
+
'/'
path
=
USERS_PATH
+
email
+
'/'
+
purchase_id
+
'/'
...
@@ -70,7 +70,8 @@ def report_L2ASCL(request, purchase_id):
...
@@ -70,7 +70,8 @@ def report_L2ASCL(request, purchase_id):
PDFGenerator
(
request
,
path
,
reporteDir
,
datasets
)
PDFGenerator
(
request
,
path
,
reporteDir
,
datasets
)
searchInfo
=
{
searchInfo
=
{
"title"
:
purchase
[
'search__search_name'
],
"title"
:
purchase
[
'name'
],
#"title": purchase['search__search_name'],
"process"
:
purchase
[
'search__process_id__name'
],
"process"
:
purchase
[
'search__process_id__name'
],
"startDate"
:
startDate
,
"startDate"
:
startDate
,
"endDate"
:
endDate
,
"endDate"
:
endDate
,
...
@@ -596,4 +597,4 @@ def wsEditTitle(request):
...
@@ -596,4 +597,4 @@ def wsEditTitle(request):
print
(
"hola"
)
print
(
"hola"
)
return
HttpResponse
(
"hola"
)
return
HttpResponse
(
"hola"
)
else
:
else
:
raise
Http404
raise
Http404
\ No newline at end of file
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