The main objective for our project is to create a portal website in Drupal. On this website, people must be able to upload their geographical datasets (mostly shape files, but also xml files that include metadata).
This has to be made as easy to use as possible for the users of the website. Secondly, the data has to be shown on a map or different maps depending on the needs of the user. The metadata also needs to be shown appropriately according to which data is shown on the map. Lastly, people should be able to modify their data online. This would make it very advantageous to use, compared to what they are using right now, although it is not mandatory for our project.
Together with the website, there must be a centralized database with all the data that has been uploaded so far. This can be saved into the GeoServer, combined with a PostGIS database.
What we've been thinking about:
- Create bash scripts to make an automatic process (e.g. write data into database, create layers into GeoServer, ...)
- Create an own made Drupal module for uploading AND processing the uploaded data into our database. This way the data is automatically processed and shown directly onto the website. (Not sure if that would be possible...)
What would be the best solution or is there any other solution/system that we should use?
We've now started working on our Drupal module. Basically a new question that rises here is "Is it possible to create GeoServer stores/layers automatically based on PostGIS data in the database itself?" We're thinking about commands to accomplish this, but we're unsure about it.
This code we use to try to create our layer:
$createlayer=("curl -u admin:geoserver -v -XPOST -H 'Content-Type:text/xml' -d $(ls -t -r /var/www/cartaro/sites/default/files/uploads/*.shp | tail -n 1) http://localhost:8082/geoserver/rest/workspaces/cartaro/datastores/$storename/featuretypes");
exec($createlayer);
This is the result from the commandprompt:
* upload completely sent off: 66out of 66 bytes
< HTTP/1.1 500 Internal Server Error
< Transfer-Encoding: chunked
< Server: Jetty(6.1.8)
<
* Connection #0 to host localhost left intact
* Closing connection #0
: only whitespace content allowed before start tag and not / (position: START_DOCUMENT seen /... @1:1)
What are the possible solutions?