How to install - neayi/soil_and_culture_gps GitHub Wiki

Downloads

In order to install this project on your computer, you need to download the following PHP files : config.php, install.php and query.php You will also need to download OSGeo4W64 from the Internet. It is free and necessary to load external data to our database.

Configure config.php

To begin with, please configure the parameters in config.php : you will need to name the database you want to create, and give the host, username and password needed for the connection to this database (variables $database, $dbHost, $dbUser, $dbPassword).

To be able to use the service giving agricultural information about a location from a given IP address, you will need to get a token key on https://ipinfo.io/ (global variable : 'TOKEN_IP').

Finally, once OSGeo4W64 is downloaded, please write the path to the folder containing ogr2ogr.exe in global variable 'ogr2ogrpass'.

Create a database

Open your DB host, make sure you are connected and the servers started. You can now run install.php and follow the output comments to know when to unzip some files.

You might have HTTP requests problems when downloading the files from https://data.inra.fr/dataset.xhtml?persistentId=doi:10.15454/BPN57S. If so, please go directly on this website and download 30169_L93.zip and the following files as .tab : smu.tab, stu.tab, stuorg.tab.

When install.php has finished running, refresh your database host and you will see the newly created database with all the data needed.

Getting started

You are now ready to play with the project by running query.php with parameters :

  • for a query with the postal code : query.php CP 06400
  • for a query with an IP address : query.php IP 100.124.108.120
  • for a query with GPS coordinates (longitude, latitude) : query.php GPS 0.4 49.0