Skip to content
Snippets Groups Projects
Commit ae562943 authored by Duchateau Fabien's avatar Duchateau Fabien
Browse files

version 0.12 - working

parent be8bf69d
No related branches found
No related tags found
No related merge requests found
......@@ -11,34 +11,13 @@ import os, json
from mapiris import model
app = Flask(__name__)
url = 'http://127.0.0.1:8080'
url = 'http://127.0.0.1:8081'
@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=8080) # debug = True
app.run(port=8081) # debug = True
......@@ -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
......
<header class="mb-3">
<h1><img src="{{url_for('static', filename='img/favicon.png')}}">&emsp;mapiris</h1>
<h1><a href="/"><img src="{{url_for('static', filename='img/favicon.png')}}"></a>&emsp;mapiris</h1>
<em>Un outil de visualisation des IRIS</em>
<hr>
</header>
\ No newline at end of file
[metadata]
name = mapiris
version = 0.1
version = 0.12
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 = vizliris/static/**
mapiris/templates = vizliris/templates/*
mapiris/data = vizliris/data/**
mapiris/static = mapiris/static/**
mapiris/templates = mapiris/templates/*
mapiris/data = mapiris/data/**
[bdist_wheel]
universal = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment