I need to create a HTML page that allows for creating a new PostGIS table in a specific database, through the GeoServer API. So I'm specifically interested in the Creating a PostGIS table part of this tutorial
I'm trying to create a HTML form (post) for that PHP script but I don't know how to start... I already have my Apache, Geoserver+Tomcat, PHP running but I'm a bit lost for that... Does this PHP code in the link work with a HTML form, prompting for the user to fill a form with $table, $geometry?
http://cnokello.blogspot.com/2012/09/geoserver-rest-api-with-php.html
In particular, I don't know where to put the lines at the bottom and beginning of the explanation page. Should they be on a separate page?
define("GEOSERVER_REST_HOST", "http://localhost:8080/geoserver/rest/");
define("GEOSERVER_USER", "username:password");
and
$data = An array with the following elements, at a minimum:
$data['transactType'] = "CREATE_POSTGIS_TABLE"
$data['contentType'] = "Content-type: text/xml"
$data['store'] = $t, details of the store to be created, which can be as shown below:
and:
$t = "<featureType>";
$t .= "<name>".$table."</name>";
$t .= "<nativeName>".$table."</nativeName>";
$t .= "<title>".$table."</title>";
$t .= "<srs>EPSG:4326</srs>";
$t .= "<attributes>";
$t .= "<attribute>";
$t .= "<name>the_geom</name>";
$t .= "<binding>com.vividsolutions.jts.geom.".$geometry."</binding>";
$t .= "</attribute>";
$t .= "<attribute>";
$t .= "<name>description</name>";
$t .= "<binding>java.lang.String</binding>";
$t .= "</attribute>";
$t .= "<attribute>";
$t .= "<name>timestamp</name>";
$t .= "<binding>java.util.Date</binding>";
$t .= "</attribute>";
$t .= "</attributes>";
$t .= "</featureType>";