[Mapserver-dev] Fwd: MapServer testing results
Howard Butler
hobu at iastate.edu
Sat Sep 18 22:58:57 EDT 2004
Paul,
From the ArcSDE C API documentation:
>SE_layerinfo_get_envelope returns the user-defined envelope of a specific
>layer. This envelope is not necessarily the 'true' calculated envelope of
>the layer's features
My guess is that this is the extent of the layer that is given when the
layer is loaded. Some of the ArcSDE loading tools loop through each polygon
and calculate a full extent, but it varies by tool (cov2sde,shp2sde,
ArcCatalog, etc). This extent is put in a table and stuffed in the
SDE.LAYERS table as minx, miny, maxx, maxy. I believe these are the values
that are returned by SE_layeinfo_get_envelope.
You choose the indexing method when you specify a "keyword" in the
dbtune.sde file on the server. (everything is usually just loaded with the
DEFAULT keyword, depends on how SDE was setup and how the data were
loaded). You can adjust the index and update statistics using the sde
command-line tools, but as far as I know, it should be indexed in some
capacity when you load it.
So to answer your question, yes the call to SE_layerinfo_get_envelope is
cheap. It's just that its answer sometimes sucks.
The real work is done here though. The rectangle from
SE_layerinfo_get_envelope is then crossed against the given rectObj (in
most cases just the mapObj's extent). The resulting shape is then used to
filter the query results from SDE. This was what I was getting at with the
earlier message...
> // set spatial constraint search shape
> envelope.minx = MS_MAX(rect.minx, envelope.minx); // crop against SDE
> layer extent *argh*
> envelope.miny = MS_MAX(rect.miny, envelope.miny);
> envelope.maxx = MS_MIN(rect.maxx, envelope.maxx);
> envelope.maxy = MS_MIN(rect.maxy, envelope.maxy);
>
> status = SE_shape_generate_rectangle(&envelope, shape);
> if(status != SE_SUCCESS) {
> sde_error(status, "msSDELayerWhichShapes()",
> "SE_shape_generate_rectangle()");
> return(MS_FAILURE);
> }
> constraint.filter.shape = shape;
Howard
More information about the mapserver-dev
mailing list