Having got my source data into postGRES I now need to configure GeoServer to deliver the data using
WFS.
I installed GeoServer 1.7.1.
First step was to create a namespace:
Config > Data > Namespace > New
Enter prefix:
GMClick
new.
Click
Submit then
SaveThe next step is to create the datastore:
Config > Data > DataStores > New
Feature data set description: Postgis
Feature Data Set ID: accidents
Click
New then:
Namespace:
GMDescription:
Road accidents in Greater Manchesterhost:
localhostport:
5432schema:
publicdatabase:
accidentsuser: ****
password: ****
(The username and password are those created when postgreSQL was set up.)
Click
Submit you are then prompted to create a
featureType:
click create SLD and create feature style settings, e.g. point size and colour
In SRS box enter
27700 click
Bounding box Generate button.
click
Submit.
Then
Apply then
SaveTo test WFS in
uDig go to the GeoServer welcome page and drag WFS Capabilities onto uDig window.
To test in a browser go to:
http://localhost:8080/geoserver/wfs?service=WFS&request=GetCapabilitiesThe accidents layer appears along with the sample datasets.
To extract a subset of the data using WFS:
http://localhost:8080/geoserver/wfs?service=WFS&request=Getfeature&typeName=GM:accident&CQL_FILTER=ward='CITY%20CENTRE'
This will list all accidents in the CITY CENTRE ward. This, however, does not work in Internet Explorer which returns an error:
The namespace prefix is not allowed to start with the reserved string "xml".See here for an explanation:
http://support.microsoft.com/kb/262585The problem seems to be with the xml keyword in:
xmlns:xml="http://www.w3.org/XML/1998/namespace"
I will need to investigate how to configure the namespaces in GeoServer (which seems to specify several of them for some reason).
Another problem is that geoServer loses my new featureType each time it is restarted. The namespace and datastore are saved properly but not the featureType which has to be recreated after each restart. The datastore details stored in:
C:\Program Files\GeoServer 1.7.1\data_dir\catalog.xml.
and there is an entry for my datastore.
All the sample featureTypes have folders in:
C:\Program Files\GeoServer 1.7.1\data_dir\ featureTypes\featureTypeName
but nothing is created in here when I create my featureType.
When I select GeoServer Demo > Map preview none of the options work for my data source but those for the demo sources do.
geoServer documentation
Next steps
These two problems (WFS not working in IE and more importantly the issue of not saving the featureType) will need further investigation. However, I am going to put them to one side. I can now extract some data from WFS (using Firefox) which I can save to a text file (GML format). I am now going to experiment with reading in the text file and processing the data using a VB.NET desktop application. My final implementation will involve developing a web application that reads in the data from GeoServer WFS and processing it. But I want to make a start on implementing an algorithm for searching for clusters in the data and I need to simplify the number of steps in the process to do that. If I do it properly the code I develop for the VB.NET desktop application will be easily ported to an ASP.NET application.
Why am I using .NET technologies? So far I have been using open source tools - postgreSQL/postGIS/geoServer and I would like to carry on with this but I don't have the skills for programming open source web applications so I'm going to use .NET.