Creating a shape resource
As an example we are going to open up a shape file from dati.gov.it. First download the latest beta (tar.bz2 | zip) release of The DataTank and install it by following the installation instructions
Requirements
Enable the php-dbase extension.
Getting the shape source location:
- Browse to the dati.gov.it website and click ‘Cerco i dati’. (not sure what it means but hey it got me to the data sets)

- Click on the Shapefile format:

- Click on the first link ‘Biblioteche – Comune di Firenze’:

- Click on the link under ‘URL pagina dataset: ‘

- Download and unzip the shapefile in a folder:


Create the resource:
You can create new resources through our RESTful API, in this example we are going to use the REST Console extension in Google Chrome.
- Check the required parameters by checking http://hostname/TDTInfo/Admin, here you can see the SHP part:
[SHP] => stdClass Object ( [doc] => When your file is structured according to SHP, you can perform a PUT request and load this file in this DataTank [parameters] => Array ( [resource_type] => The type of the resource. [generic_type] => The type of the generic resource. [documentation] => Some descriptional documentation about the generic resource. [url] => The path to the shape file (can be a url). [columns] => The columns that are to be published. [PK] => The primary key for each row. ) [requiredparameters] => Array ( [0] => resource_type [1] => documentation [2] => generic_type [3] => url ) )
- Build the request uri, a valid uri is of the form: http://hostname/package/resource:

- As authorization we are going to use basic authorization, as credentials you need to use the username and password you configured in the $API_USER and $API_PASSWD parameters in Config.class.php:

- As request parameters you need to use the ones described in the first step of this list:

- Send the request
- Point your browser to the created resource:

- Check the Requesting a resource page for more information.



