[mapserver-dev] Re: [mapserver-users] testing mapserver large files rendering improvements

Dave Fuhry dfuhry at gmail.com
Thu May 15 16:24:35 EDT 2008


Daniel:  PostGIS doesn't autocreate indexes when you create a geometry
column.  If you're bulk-loading a table, it's faster to load without
the index then build the index after the load is complete.

I'm against having mapserver try to autocreate .qix files.  They would
be unnecessary overhead if an entire shapefile is always in view.  Or
if its is small and dynamic.  Both rare but possible situations.

Since the concern is performance, I suggest having mapserver
msError("Error: layer X does not have a spatial index [suggestions]")
if a shapefile's .qix doesn't exist (or if the .qix is inconsistent:
the .shp's modification time is newer, or the # of .qix leaf nodes
differs from the .shp's non-null feature count, assuming that's cheap
to test).

A layer-level attribute could bypass the error condition.  Something
along the lines of "REQUIREINDEX FALSE".  The map administrator could
add that attribute to the LAYER in the unusual cases I mentioned
above.

Since it is not cheap to test for, say, a PostGIS spatial index,
REQUIREINDEX should by default be off (or irrelevant, or erroneous)
for non-shapefile layers.

Thanks,

Dave

On Thu, May 15, 2008 at 3:42 PM, Paul Ramsey <pramsey at cleverelephant.ca> wrote:
> Why so few shapes per node? I was thinking about this walking downtown
> and my internal guess was 128 would be a good number.  How did you
> come to 8?
>
> P
>
> On Thu, May 15, 2008 at 10:43 AM, Frank Warmerdam <warmerdam at pobox.com> wrote:
>> Paul Ramsey wrote:
>>>
>>> Frank,
>>>
>>> For a point-based tree, does every point end up in a node at max depth?
>>
>> Paul,
>>
>> Yes. And the maximum depth is a heuristic as follows if not given
>> explicitly as an argument to shptree:
>>
>>  /* -------------------------------------------------------------------- */
>>  /*      If no max depth was defined, try to select a reasonable one     */
>>  /*      that implies approximately 8 shapes per node.                   */
>>  /* -------------------------------------------------------------------- */
>>  if( tree->maxdepth == 0 ) {
>>    int numnodes = 1;
>>
>>    while(numnodes*4 < shapefile->numshapes) {
>>      tree->maxdepth += 1;
>>      numnodes = numnodes * 2;
>>    }
>>  }
>>
>> No long ago the default maxdepth was 16 and .qix files for small .shp files
>> were awfully large (deep).
>>
>> Best regards,
>> --
>> ---------------------------------------+--------------------------------------
>> I set the clouds in motion - turn up   | Frank Warmerdam,
>> warmerdam at pobox.com
>> light and sound - activate the windows | http://pobox.com/~warmerdam
>> and watch the world go round - Rush    | President OSGeo, http://osgeo.org
>>
>>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>


More information about the mapserver-dev mailing list