Projection issues on WFS-Server

Stephan Holl holl at GDF-HANNOVER.DE
Thu Mar 9 06:23:45 PST 2006


Hello Frank,

On Thu, 09 Mar 2006 09:04:13 -0500 Frank Warmerdam
<warmerdam at pobox.com> wrote:

> Stephan Holl wrote:
> > I cannot reproducing from shapefile. I exported into shape using
> > ogr2ogr and added this layer into the mapfile.
> > The Bounding-box is shown correct now for the shapefile and still
> > wrong for the layer in postGIS.
> ...
> > Well, as noone had this problem before, it seems that I am the only
> > one...
> 
> Stephan,
> 
> Well, this is certainly useful information, and would seem to support
> the idea that the problem is to some extent related to the PostGIS
> connector in MapServer.
> 
> When I look in mappostgis.c I see this implementation for the
> getextent function:
> 
> int msPOSTGISLayerGetExtent(layerObj *layer, rectObj *extent)
> {
>      if(layer->debug) {
>          msDebug("msPOSTGISLayerGetExtent called\n");
>      }
> 
>      extent->minx = extent->miny = -1.0 * FLT_MAX ;
>      extent->maxx = extent->maxy = FLT_MAX;
> 
>      return MS_SUCCESS;
> 
> ... followed by a big chunk of commented out code that presumably
> actually computes the extents.  The code is introduced with this
> comment:
> 
>          /* this should get the real extents,but it requires a table
> read */ /* unforunately, there is no way to call this function from 
> mapscript, so its */
>          /* pretty useless.  Untested since you cannot actually call
> it. */
> 
> It would seem you get bad extents because the PostGIS connector
> deliberately does not attempt to produce the extents.
> 
> Likely your best bet is to manually set the extent using the
> wfs_extent or ows_extent metadata on the layer in your mapfile.  As
> long as things are reasonable static this should be straight forward.

Thank you for clearing this! Now I have set my extent staticly I will
get the set extent, which is exactly what I want. 

> Alternatively this function could be implemented, but even if it was,
> I imagine it would be expensive to evaluate for large layers.

Doesnt this apply for large shapefiles as well? there the extent is
calculated as well?

Thank you guys for clearing this.

Best
	Stephan

-- 
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office      -     Mengendamm 16d      -     D-30177 Hannover
Internet: www.gdf-hannover.de      -      Email: holl at gdf-hannover.de
Phone : ++49-(0)511.39088507       -        Fax: ++49-(0)511.39088508



More information about the MapServer-users mailing list