Download the PHP package jlchassaing/ezgeodatagouv without Composer
On this page you can find all versions of the php package jlchassaing/ezgeodatagouv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jlchassaing/ezgeodatagouv
More information about jlchassaing/ezgeodatagouv
Files in jlchassaing/ezgeodatagouv
Package ezgeodatagouv
Short Description EzGeoDataGouv bundle helps interact with datagouv to import location and search them using geo.data.gouv tool
License MIT
Informations about the package ezgeodatagouv
ezgeodatagouv
eZ Geo Data Gouv project
This bundle has two usecases :
- help import a csv location list and give geocoding functionnality based on geo.api.gouv.fr
- give a react search form with auto completion also based on geo data gouv
Contents will be imported in eZ Platform contents indexed by solr to help location proximiy search
installation
This release is ment to be installed on eZ Platform 2.5 and Symfony 3.4
This bundle uses eZ Platform and Code Rhapsodie eZ Dataflow Bundle
composer require jlchassaing/ezgeodatagouv
in AppKernel.php add
in routing.yml add the coderhapsody routing parameter
Create the new location content type
how to import data
Set a resource
Resouces are set in a config.yml file
The settings help set how the csv fields will be used. The ressoure name must be passed in option to the import script
The fields sections helps you add specific content_type fields. The key is the conten_type field identifier. the datatype is te content_type field datatype and value is the csv field name
running import
The import script alias is 'dtgi'
If you do not provide siteaccess parameter the default siteaccess will be used
The options to provide are :
- the parent_location_id where contents will be added
- the csv_source path where the csv source is can be online (for now the file must be semicolon field seperated and quotation marks)
- resource name
Proximity search
The eZ Rest api has been extended with a query that returns proximity points
there are 4 ways to call the perform the request :
- /ez_geo_data_gouv/search/{longitude}/{latitude}
- /ez_geo_data_gouv/search/{distance}/{longitude}/{latitude}
- /ez_geo_data_gouv/search/{contentType}/{longitude}/{latitude}
- /ez_geo_data_gouv/search/{contentType}/{distance}/{longitude}/{latitude}
The default contentType is "location" and the default distance is 5
Remember to use the ezpublish api request prefix Adding the Accept: application/vnd.ez.api.ContentList+json header to your request will return a json formated response.
The query will return a maximum of 5 answers
Extending to add a custom import manager
The DataGouvImportLocationsDataFlowType class can be extended
This could be necessary to execute some changes on the csv data before creating content.
Create a custom class that extends DataGouvImportLocationsDataFlowType and add methods :
Once the class is created declare it as a service and add tag coderhapsodie.dataflow.type
Todos
- [X] add csv config
- [ ] if no location parameters are given (longitude, latitude) the geocode before importing data
- [ ] set a mapping configuration interface and only pass a configuration id to import script
- [ ] add parameters to conactenate fields to build the adress field