Skip to content

Commit

Permalink
deactivate postgis getextent function (#4039)
Browse files Browse the repository at this point in the history
return an error instead of invalid extents to avoid peculiar behavior in
proj when reprojecting invalid values. this will also trigger a warning
in capabilities documents.

closes #4039
  • Loading branch information
tbonfort committed Sep 5, 2012
1 parent 9184876 commit 5e9c8a1
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions mappostgis.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@
#include "maptime.h"
#include "mappostgis.h"

#ifndef FLT_MAX
#define FLT_MAX 25000000.0
#endif

#define FP_EPSILON 1e-12
#define FP_EQ(a, b) (fabs((a)-(b)) < FP_EPSILON)
#define FP_LEFT -1
Expand Down Expand Up @@ -2998,27 +2994,6 @@ int msPostGISLayerGetItems(layerObj *layer)
#endif
}

/*
** msPostGISLayerGetExtent()
**
** Registered vtable->LayerGetExtent function.
**
** TODO: Update to use proper PostGIS functions to pull
** extent quickly and accurately when available.
*/
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;

}

/*
* make sure that the timestring is complete and acceptable
* to the date_trunc function :
Expand Down Expand Up @@ -3373,7 +3348,7 @@ int msPostGISLayerInitializeVirtualTable(layerObj *layer)
layer->vtable->LayerGetShape = msPostGISLayerGetShape;
layer->vtable->LayerClose = msPostGISLayerClose;
layer->vtable->LayerGetItems = msPostGISLayerGetItems;
layer->vtable->LayerGetExtent = msPostGISLayerGetExtent;
/* layer->vtable->LayerGetExtent = msPostGISLayerGetExtent; */
layer->vtable->LayerApplyFilterToLayer = msLayerApplyCondSQLFilterToLayer;
/* layer->vtable->LayerGetAutoStyle, not supported for this layer */
layer->vtable->LayerCloseConnection = msPostGISLayerClose;
Expand Down

0 comments on commit 5e9c8a1

Please sign in to comment.