dev-master
9999999-dev https://github.com/Munso-Agency/iris-geocoder-bundleFrench IRIS INSSE code address Geocoder
MIT
The Requires
- php ^5.3 || ^7.0
- kriswallsmith/buzz ^0.15
- jsor/doctrine-postgis ~1
by Renaud Jacquot
geocoder iris insee
French IRIS INSSE code address Geocoder
Symfony bundle to reverse geocoding from address to French IRIS Areas ., (*1)
Based on : https://github.com/garaud/pyris writed in python., (*2)
You have to install postgreSQL and PostGIS. For Debian:, (*3)
sudo apt-get install postgresql postgis
You have to be a PostgreSQL superuser to create the postgis extension for your database. If it's not the case, you can do:, (*4)
su su - postgres psql DATABASENAME -c "CREATE EXTENSION postgis;"
Download the last available IRIS shape file at the URL : https://www.data.gouv.fr/fr/datasets/contour-des-iris-insee-tout-en-un/, (*5)
Create a database and add a new doctrine connection in app/config.yml Symfony Documentation, (*6)
doctrine: dbal: connections: #[...] psql: driver: pdo_pgsql host: "%psql_database_host%" port: "%psql_database_port%" dbname: "%psql_database_name%" user: "%psql_database_user%" password: "%psql_database_password%" charset: UTF8
Add 'geometry' mapping column type:, (*7)
doctrine: dbal: types: geometry: Jsor\Doctrine\PostGIS\Types\GeometryType
Add a new doctrine entity_manager for the connection recently added:, (*8)
orm: entity_managers: #[...] geocodage: connection: psql mappings: MunsoIRISGeocoderBundle: ~ dql: numeric_functions: ST_MakePoint: Jsor\Doctrine\PostGIS\Functions\ST_MakePoint ST_Contains: Jsor\Doctrine\PostGIS\Functions\ST_Contains ST_SetSRID: Jsor\Doctrine\PostGIS\Functions\ST_SetSRID
If you have already a postgresSQL connection configured on your project, you could edit entity_manager name used., (*9)
If the columns mapped in your *.shp file does not fit with IrisItem entity, you can create your own entity by editing munso.iris_geocoder.entity_name
parameter., (*10)
munso.iris_geocoder.entity_manager.name: 'geocodage' munso.iris_geocoder.entity_name: 'MunsoIRISGeocoderBundle:IrisItem'
Import your shape into postgresSQL database by running the command:, (*11)
php bin/console munso:iris:import-shape path/to/file.shp
The .shx and .dbf files must be in the same directory than the *.shp file.
The SQL table will be truncated unless you use --append
option., (*12)
## IRIS Code by address, (*13)
Use service munso.iris_geocoder
:, (*14)
$IrisItem = $this->get('munso.iris_geocoder')->getIRISByAddress('2b Allée Forain Francois verdier');
French IRIS INSSE code address Geocoder
MIT
geocoder iris insee