This is a basic walk-through using to use GeoMOOSE with GeoServer and PostGIS. This is not meant to be comprehensive and the reader should have some knowledge of GeoServer and PostGIS. GeoMOOSE comes configured with a WFS-T example, using the U.S. Census Bureau’s Places layer.
The best documentation on setting up GeoServer comes from GeoServer itself.
And here is the GeoServer Documentation.
Install and startup a fresh GeoServer instance.
Download the file here. This is the “place” file for the state of Minnesota. “Places” are a Census terminology for incorporated cities, townships, and equivalents.
There are a few good methods for doing this, ogr2ogr and shp2pgsql. Whichever method is used, the layer should be named census_cities for the purposes of this exmaple.
A typical ogr2ogr string will look similar to this:
ogr2ogr -f PostgreSQL 'PG:dbname=gis2 user=gis password=super_gis' tl_2010_27_place10.shp tl_2010_27_place10 -nln census_cities -nlt GEOMETRY -lco DIM=2
- Workspace: GeoMOOSE_Testing
- Data Source Name: census_data
- Description: Census Cities for Testing
- Enabled: Should be checked to indicate “true”.
- The rest of the settings are for PostgreSQL, please fill them out to match the information you used to load the shapefile. If they do not match the next step will end in a miserable disaster.
This is probably the largest amount of witchcraft and wizardry required to complete a WFS-T server. Because the WFS-T server requires AJAX it is critical that the WFS-T server is on the exact same domain as the GeoMOOSE application. By default GeoServer will attach to port 8080, while Apache attached to port 80. This is normal and really does not need to be changed for testing purposes. The GeoMOOSE demo assumes that GeoServer is being proxied by Apache using the following configuration:
ProxyPass /geoserver http://localhost:8080/geoserver
ProxyPassReverse /geoserver http://localhost:8080/geoserver
There are other methods for doing this using Nginx or IIS but that is out of the scope of this document. The author offers the Apache configuration as a sample and only out of kindness since he is using the aforementioned configuration.
The Mapbook currently features a fragment which supports the above configuration of GeoServer. Here is that fragement:
<map-source name="census_cities" type="wfs" status="on">
<style type="stylemap"><![CDATA[
{
"strokeColor" : "#00ff00",
"label" : "${namelsad}"
}
]]></style>
<url>/geoserver/GeoMOOSE_Testing/ows</url>
<attribute name="geoid10" type="text" label="ID:" default-value="27999"/>
<attribute name="namelsad10" type="text" label="Name:"/>
<feature-namespace>geomoose</feature-namespace>
<feature-type>census_cities</feature-type>
<geometry-name>wkb_geometry</geometry-name>
<schema><![CDATA[http://localhost:8080/geoserver/GeoMOOSE_Testing/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=GeoMOOSE_Testing:census_cities]]></schema>
</map-source>