Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mapiris
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Duchateau Fabien
mapiris
Commits
ae562943
Commit
ae562943
authored
6 years ago
by
Duchateau Fabien
Browse files
Options
Downloads
Patches
Plain Diff
version 0.12 - working
parent
be8bf69d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
mapiris/main.py
+2
-23
2 additions, 23 deletions
mapiris/main.py
mapiris/model.py
+7
-4
7 additions, 4 deletions
mapiris/model.py
mapiris/templates/header.html
+1
-1
1 addition, 1 deletion
mapiris/templates/header.html
setup.cfg
+6
-6
6 additions, 6 deletions
setup.cfg
with
16 additions
and
34 deletions
mapiris/main.py
+
2
−
23
View file @
ae562943
...
...
@@ -11,34 +11,13 @@ import os, json
from
mapiris
import
model
app
=
Flask
(
__name__
)
url
=
'
http://127.0.0.1:808
0
'
url
=
'
http://127.0.0.1:808
1
'
@app.route
(
'
/
'
,
defaults
=
{
'
page
'
:
None
})
#@app.route('/<page>', methods=["GET", "POST"])
def
index
(
page
):
print
(
page
)
return
render_template
(
'
index.html
'
)
"""
if page is not None:
return render_template(page)
else:
return render_template(
'
index.html
'
)
"""
"""
if request.method ==
"
POST
"
:
if page is None:
return render_template(
'
index.html
'
)
# TODO remove the next lines
elif page.find(
'
recommendation.html
'
) > -1: # there is an argument POST
return render_template(
'
recommendation.html
'
)
elif page.find(
'
clustering.html
'
) > -1: # there is an argument POST
return render_template(
'
clustering.html
'
)
else:
return render_template(page)
else: # to avoid : Method Not Allowed The method is not allowed for the requested URL.
return render_template(
'
index.html
'
)
"""
@app.route
(
'
/details-iris.html
'
,
methods
=
[
"
GET
"
])
...
...
@@ -107,5 +86,5 @@ if __name__ == '__main__':
webbrowser
.
open_new
(
url
)
app
.
config
[
'
SEND_FILE_MAX_AGE_DEFAULT
'
]
=
0
# do not cache files, especially static files such as JS
app
.
secret_key
=
'
s3k_5Et#fL45k_#ranD0m-(StuF7)
'
app
.
run
(
port
=
808
0
)
# debug = True
app
.
run
(
port
=
808
1
)
# debug = True
This diff is collapsed.
Click to expand it.
mapiris/model.py
+
7
−
4
View file @
ae562943
...
...
@@ -4,17 +4,20 @@
# model.py: methods for getting data from MongoDB (using mongiris) and transforming it
# =============================================================================
from
mongiris
import
Mongiris
import
re
,
json
from
mongiris.main
import
Mongiris
import
re
import
json
# connection to the IRIS collection in MongoDB
db
=
Mongiris
()
iris_collection
=
db
.
iris_
collection
iris_collection
=
db
.
collection
_iris
db
.
init_connection
()
json_iris_indicator_code_to_label
=
'
static/data/dictionnaire-indicateurs.json
'
def
get_iris_for_polygon
(
lat1
,
lng1
,
lat2
,
lng2
):
polygon
=
db
.
convert_geojson_box_to_polygon
(
lng1
,
lat1
,
lng2
,
lat2
)
#polygon = db.convert_geojson_box_to_polygon(lng1, lat1, lng2, lat2)
polygon
=
Mongiris
.
convert_geojson_box_to_polygon
(
lng1
,
lat1
,
lng2
,
lat2
)
#iris = db.geo_within(iris_collection, polygon)
iris
=
db
.
intersect
(
iris_collection
,
polygon
)
return
iris
...
...
This diff is collapsed.
Click to expand it.
mapiris/templates/header.html
+
1
−
1
View file @
ae562943
<header
class=
"mb-3"
>
<h1><img
src=
"{{url_for('static', filename='img/favicon.png')}}"
>
 
mapiris
</h1>
<h1><
a
href=
"/"
><
img
src=
"{{url_for('static', filename='img/favicon.png')}}"
>
</a>
 
mapiris
</h1>
<em>
Un outil de visualisation des IRIS
</em>
<hr>
</header>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
setup.cfg
+
6
−
6
View file @
ae562943
[metadata]
name
= mapiris
version
= 0.1
version
= 0.1
2
description
= This package aims at searching and printing IRIS on a map.
author
= Fabien Duchateau
author_email
= fabien.duchateau@univ-lyon1.fr
...
...
@@ -15,9 +15,9 @@ include_package_data = True
zip_safe
= False
install_requires
=
flask
>= 1.0.2
mongiris
>= 0.
21
mongiris
>= 0.
3
dependency_links
=
git+https://fduchate@gitlab.liris.cnrs.fr/fduchate/mongiris.git#egg=mongiris-0.
21
git+https://fduchate@gitlab.liris.cnrs.fr/fduchate/mongiris.git#egg=mongiris-0.
3
#[options.packages.find]
#exclude
=
...
...
@@ -27,9 +27,9 @@ dependency_links =
[options.package_data]
# package_data
is ignored when a MANIFEST.in is provided
. =
README.md,
mapiris/static
=
vizl
iris/static/
**
mapiris/templates
=
vizl
iris/templates/
*
mapiris/data
=
vizl
iris/data/
**
mapiris/static
=
map
iris/static/
**
mapiris/templates
=
map
iris/templates/
*
mapiris/data
=
map
iris/data/
**
[bdist_wheel]
universal
= 1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment