[postgis-users] alpha GT2 Web Map Server with PostGIS support

Rueben Schulz r_j_schulz at yahoo.ca
Thu Nov 28 21:25:10 PST 2002


To James Macgill (and anyone else who is interested),

I have been testing the gt2wms with postGIS for the last few night but
have not had any success. I can get it to return an image, but no
features are displayed for postgis data sources (blank, white image
returned). I am running tomcat 4.1.12-LE-jdk14 with sdk1.4.0_01. Here is
a list of my questions/ observations. My html to call gt2wms is at the
end.

1)I needed to install the java advanced imaging api for gt2wms to run.
Is this included in the java sdk 1.4.1?
2)the example index.html using a shapefile works fine
3)I have needed to restart tomcat to get gt2wms to reload layers.xml. Is
there an easier way?
4)I notice that the example mentions that the SLD <FeatureTypeName> must
be 'feature' for shapefiles to work. Is this also true of postGIS data.
(note that values other than 'feature' cause a blank, white image to be
returned for shapefile data as well)
5)yes, the bounding boxes have been adjusted for my data
6)if some of the postgis data source parameters (database and table) in
layers.xml are left out, no errors are thrown by gt2wms. (error is
thrown if all are removed). Are there any additional parameters needed
to tell gt2wms the geometry column in the table?
7)where is the source code for gt2wms available?

Rueben Schulz


P.S. geotool2 is looking really great (especially SDL with filters). I
am hoping to have time to look at it more in the new year, though this
is a good introduction to geotools and sdl. (so many specifications to
read so little time...)

<html>
  <head>
    <title>gt2wms and postGIS</title>
  </head>
  <body>
    <h1>GeoTools 2 Web Map Server: PostGIS tests</h1>

USA test<br>
<img
src='servlet/gt2wms?request=getMap&layers=USA&bbox=-160,20,-60,60&width=400&height=200&srs=EPSG:-1&styles=green' width=400 height=200/>
<a
href="servlet/gt2wms?request=getMap&layers=USA&bbox=-160,20,-60,60&width=400&height=200&srs=EPSG:-1&styles=normal">Map URL</a><br>

poly test<br>
<img
src='servlet/gt2wms?request=getMap&layers=postgistest&bbox=-5,-5,3,3&width=400&height=200&srs=EPSG:-1&styles=green' width=400 height=200/>
<a
href="servlet/gt2wms?request=getMap&layers=postgistest&bbox=-0.5,-5,3,3&width=400&height=200&srs=EPSG:-1&styles=green"/>Map URL</a><br>

bc test<br>
<img
src='servlet/gt2wms?request=getMap&layers=postgistest2&bbox=-140,45,-120,60&width=400&height=200&srs=EPSG:-1&styles=green' width=400 height=200/>
<a
href="servlet/gt2wms?request=getMap&layers=postgistest2&bbox=-140,45,-120,60&width=400&height=200&srs=EPSG:-1&styles=normal"/>Map URL</a><br>

islanads test<br>
<img
src='servlet/gt2wms?request=getMap&layers=postgistest3&bbox=1175070,389420,1206600,425095&width=400&height=200&srs=EPSG:-1&styles=normal' width=400 height=200/>
<a
href="servlet/gt2wms?request=getMap&layers=postgistest3&bbox=1175070,389420,1206600,425095&width=400&height=200&srs=EPSG:-1&styles=normal"/>Map URL</a><br>

  </body>
</html>


On Fri, 2002-11-22 at 00:59, James Macgill wrote:
> Hi all
> 
> This is a quick shout for some testers with PostGIS experience, I have just 
> put a ready built copy of the GT2 wmsserver module onto the sourceforge 
> file section for download.
> 
> The download consists of a single war (web archive) that you should be able 
> to drop into your favorite servlet engine and start serving maps.
> 
> You can download it from:
> http://prdownloads.sourceforge.net/geotools/wmsserver.war?download
> 
> The current code supports Shapefile and PostGIS datasources, the others 
> (GML, MapInfo etc) should be easy to add so expect them soon.
> 
> Once you have the war file installed you should be able to open the index 
> page with something like: http://localhost:8080/wmsserver/
> And see a sample page with some maps in it and some instructions.
> 
> When unpacked you will find a number of files, the layers.xml is the main 
> config file whilst the styles and maps folders contain the sample data that 
> can be mapped out of the box.  You will find an example layer definition 
> for a PostGIS layer in the layers.xml file, you should just need to plug 
> values for your db into it.
> 
> The wmsserver module is experimental and will not remain within the GT2 
> codebase long term as it falls outside the remit of 'toolkit' though it may 
> become a project in its own right in the future.
> 
> Its a useful thing to put out however as, if you take a look at the source 
> code, you will see examples of how datasources, rendering, filtering and 
> styling work.  You can find the source code on CVS or on the 
> gt2-src-snapshot.tar.gz nightly archive if you look in 
> geotools2/geotools-src/wmsmodule/src
> 
> It would be great to hear from people who do manage install it and also any 
> problems from people who can't.  It's not been tested against very many 
> PostGIS databases yet so I'm particularly interested in feedback from 
> members of this list.
> 
> All the best
> 
> James
> 
> 
> -- 
> James Macgill
> Center for Computational Geography
> Spell Checker (c) Creative Spelling inc (aka my dyslexic brain)
> http://www.geotools.org  the open source java mapping toolkit.
> 
> 
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users







More information about the postgis-users mailing list