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

maj README et config files

parent e539d7d8
No related branches found
No related tags found
No related merge requests found
# mongiris package
This package is an interface for querying INSEE IRIS stored as documents in MongoDB.
Requires loading the IRIS files into MongoDB prior to using this package.
This package is an interface for querying IRIS stored as documents in MongoDB.
[IRIS](https://www.insee.fr/fr/metadonnees/definition/c1523) are French administrative areas (similar to neighbordhoods). The ~50,000 IRIS for France are stored in the GeoJSON format.
## Pré-requis
- Python, version >=3
- [MongoDB](https://www.mongodb.com/), version >=4, in which it is necessary to import the IRIS database (see Installation).
## Installation
To install mongiris:
```
python3 -m pip install git+https://fduchate@gitlab.liris.cnrs.fr/fduchate/mongiris.git#egg=mongiris
```
Next, you need to load the IRIS data into MongoDB (using the `mongorestore` tool):
```
./mongorestore --archive=/path/to/dump-iris.bin
```
where `/path/to/` indicates the path to the dump IRIS database (provided with the source package mongiris in `mongiris/data/dump-iris.bin`)
......@@ -86,7 +86,7 @@ class Mongiris:
except Exception as e:
self.logger.error('Error with MongoDB connection: ' + str(e))
#TODO delete next line (which removes one IRIS in Gravelines). Its GeoJSON is valid, but it has 2 edges (very close)
#TODO that cross according to MOngoDB (and GDAL), which avoid the creation of an index. See file iris_errno.geojson
#TODO that cross according to MOngoDB (and GDAL), which prevents the creation of an index. See file iris_errno.geojson
#TODO CODE_IRIS = 592730103
self.iris_collection.delete_one({"properties.CODE_IRIS": 592730103}) # should not be found, but just in case
nb_docs = self.count_documents(self.iris_collection, {})
......
# mongiris setup.cfg
[metadata]
name = mongiris
......
# python3 -m setup bdist_wheel sdist
# python3 -m pip install -e ../mongiris/
# python3 -m pip install -e mongiris/
# python3 -m pip install git+https://fduchate@gitlab.liris.cnrs.fr/fduchate/mongiris.git#egg=mongiris
# collecte et installe le projet mongiris -> à mettre dans vizliris du coup !
#!/usr/bin/env python
# mongiris setup.py (uses setup.cfg)
......@@ -15,10 +13,15 @@ if sys.argv[-1] == "publish":
os.system("python setup.py bdist_wheel upload --sign")
sys.exit()
readme = open("README.md").read()
#history = open("HISTORY.rst").read().replace(".. :changelog:", "")
setup(long_description=readme) # + "\n\n" + history)
print("""Mongiris has been installed.
Do not forget to load the IRIS collection into MongoDB:
\t\tmongorestore --archive=/path/to/dump-iris.bin
""")
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