You can use either a Windows installer, a .zip file or the Maven dependency. For now, here is the Windows installer instructions:
Download the Windows installer from here. Follow the instructions; default values are fine.
Start the GeoServer: go to Start -> Programs -> GeoServer 1.x.x -> Start GeoServer
Confirm that the server is running by going to the following link:
Adding a DataStore from PostGIS
Go to http://localhost:8080/geoserver/ and click ‘Config’.
Enter the username/password of admin/geoserver
Click on ‘Config’ again once you are logged in.
Click on ‘Data’, then ‘DataStores’.
Click ‘New’, select PostGIS and give the dataStore a name. Click ‘New’.
Enter your PostgreSQL/PostGIS database information on the next page. You will need to know:
The rest of the values can be left defaulted at this time.
Click ‘Submit’, ‘Apply’, then ‘Save’. You are no ready to use this dataStore for defining FeatureTypes.
Adding a FeatureType
There are a couple of things that need to be set up within your PostgreSQL/PostGIS database prior to setting up a FeatureType.
- You can read directly from a table, provided that the table has a single geometry column in it that you are interested in. If the table has multiple geometry columns, create a view around that table.
- There must be an entry in the geometry_columns that defines the geometry column from which you are going to pull data. You need to have the table (or view), the column name, dimension, SRID and the geometry type (MULTIPOLYGON, POLYGON, POINT, etc.) Make certain that the SRID is set on all values for the geometry column in the table that you are are going to use.
Click on ‘Config’, ‘Data’, ‘FeatureTypes’ then ‘New’.
You will be presented with a drop-down that has a list of items in the following format:
Select the one that matches what you want, and click ‘New’.
You will want to do the following:
- change the ‘Style’ to ‘green’ if you are using POLYGON geometry objects
- change ‘SRS Handling’ to ‘Leave the native SRS unaltered’
- click on the ‘Generate’ button beside the ‘Bounding Box’ label
- change the ‘Schema Base’ to ‘gml:AbstractFeatureType’
- click on ‘Submit’
You can now view the shapes by going to Welcome -> Demo -> Map Preview and selecting the FeatureType you just created. You should now see a window that looks like the following: