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
a4bb4357
Commit
a4bb4357
authored
May 25, 2018
by
Renán Sosa Guillen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.geoint.mx/mario.chirinos/GeoInt_SIDT
into dev
parents
c65082e0
a9333f8a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
openLayers4.js
catalog/static/js/openLayers4.js
+6
-5
sidtMap.js
catalog/static/js/sidtMap.js
+2
-2
views.py
catalog/views.py
+10
-2
No files found.
catalog/static/js/openLayers4.js
View file @
a4bb4357
...
...
@@ -99,7 +99,7 @@ OpenStreetMapsClass.prototype.addPolygon = function(coords)
this
.
vectorLayer
.
getSource
().
addFeature
(
feature
);
// show coords
document
.
getElementById
(
"id_polygon"
).
value
=
feature
.
getGeometry
().
clone
().
transform
(
'EPSG:3857'
,
'EPSG:4326'
).
getCoordinates
(
);
this
.
showCoords
(
feature
.
getGeometry
()
);
}
//------------------------------------------------------------------------------
/**
...
...
@@ -153,14 +153,15 @@ OpenStreetMapsClass.prototype.formatCoords = function(coords)
}
//------------------------------------------------------------------------------
/**
* s
et value in input
with wkt format
* s
how values of a polygon
with wkt format
* POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))
* MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),((20 35, 10 30, 10 10, 30 5, 45 20, 20 35),(30 20, 20 15, 20 25, 30 20)))
* @param
coords to draw
* @param
geometry the geometry to show e.g. a polygon
*/
OpenStreetMapsClass
.
prototype
.
s
etPolygonInputValue
=
function
(
coords
)
OpenStreetMapsClass
.
prototype
.
s
howCoords
=
function
(
geometry
)
{
// todo
var
wkt
=
new
ol
.
format
.
WKT
();
document
.
getElementById
(
"id_polygon"
).
value
=
wkt
.
writeGeometry
(
geometry
.
clone
().
transform
(
'EPSG:3857'
,
'EPSG:4326'
));
}
//------------------------------------------------------------------------------
/**
...
...
catalog/static/js/sidtMap.js
View file @
a4bb4357
...
...
@@ -118,11 +118,11 @@ sidtMap.prototype.addInteraction = function()
});
this
.
interaction
.
on
(
"drawend"
,
function
(
e
){
document
.
getElementById
(
"id_polygon"
).
value
=
e
.
feature
.
getGeometry
().
clone
().
transform
(
'EPSG:3857'
,
'EPSG:4326'
).
getCoordinates
();
self
.
showCoords
(
e
.
feature
.
getGeometry
());
});
this
.
interaction
.
on
(
"drawstart"
,
function
(
e
){
self
.
vectorLayer
.
getSource
().
clear
();
self
.
removePolygon
();
});
this
.
map
.
addInteraction
(
this
.
interaction
);
...
...
catalog/views.py
View file @
a4bb4357
...
...
@@ -10,7 +10,7 @@ from django.views.generic.base import View
from
django.template
import
loader
from
urllib
import
urlencode
import
requests
,
json
,
unicodedata
import
imp
# Create your views here.
#-------------------------------------------------------------------------------
...
...
@@ -37,10 +37,18 @@ def productList(request):
"""
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
)
print
r2
r2
.
pop
(
'csrfmiddlewaretoken'
,
None
)
url
=
'https://api.daac.asf.alaska.edu/services/search/param?'
+
urlencode
(
r2
,
'utf-8'
)
+
"&output=JSON"
# print 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