[Geoserver-users] non-spatial indexing of shapefiles

I am trying to render a road network with many members in it. In my SLD I am doing a filter on one of the metadata fields (ie. CFCC2) and performance is quite slow. I assume it is because it must check every record to see if the CFCC2 value matches the filter test.

The shapefiles are spatially indexed, but is there a way to index metadata fields in the dataset config for shapefiles?

If I use PostGIS will it take advantage of an index on the CFCC2 field (assuming the index is there)?

Anything else that I should check for speed considerations?

Thanks,
-Al

Hi Al,

No... geotools shapefile support does not support any indexing of the dbf / attributes. Like you suggest most people just use Postgis if they want attribute indexing.

I am actually not 100% sure about if the index will be used. It depends on if the renderer applies the filter from the SLD before or after the query to the datasource is made. I will have to check into it.. or hopefully someone more knowledgeable with the rendering system can answer.

-Justin

Al Byers wrote:

I am trying to render a road network with many members in it. In my SLD I am doing a filter on one of the metadata fields (ie. CFCC2) and performance is quite slow. I assume it is because it must check every record to see if the CFCC2 value matches the filter test.

The shapefiles are spatially indexed, but is there a way to index metadata fields in the dataset config for shapefiles?

If I use PostGIS will it take advantage of an index on the CFCC2 field (assuming the index is there)?

Anything else that I should check for speed considerations?

Thanks,
-Al
!DSPAM:4007,46b223df162091961014482!

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

!DSPAM:4007,46b223df162091961014482!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,46b223df162091961014482!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Hey using GeoServer is it possible to dynamically create an SLD file and implement it? I know we can easily write into catalog.xml and create a .sld but it seems that the changes aren't noticed unless you go into the server and click the Load button.

Right now our aim is to have different styles for different indicator columns which will be added dynamically. We're using a SQL Database backend.

Justin Deoliveira ha scritto:

Hi Al,

No... geotools shapefile support does not support any indexing of the dbf / attributes. Like you suggest most people just use Postgis if they want attribute indexing.

I am actually not 100% sure about if the index will be used. It depends on if the renderer applies the filter from the SLD before or after the query to the datasource is made. I will have to check into it.. or hopefully someone more knowledgeable with the rendering system can answer.

The renderer applies filters right away as they are specified, just adds
a bbox filter to load only the features in the current view area.
So yeah, indexing will help provided the database decides to use
the index. The latter depends on the statistics, be sure to run a
"vacuum analyze" after loading the data into postgis.

Cheers
Andera

Ali Khan ha scritto:

Hey using GeoServer is it possible to dynamically create an SLD file and implement it? I know we can easily write into catalog.xml and create a .sld but it seems that the changes aren't noticed unless you go into the server and click the Load button.

Right now our aim is to have different styles for different indicator columns which will be added dynamically. We're using a SQL Database backend.

Well, you can force Geoserver to reload its configuration from file
doing the same post call a user would do interactively.
Here are some pointers:
http://docs.codehaus.org/display/GEOSDOC/Alternative+for+reloading+the+Geoserver+catalog

Anyways, there is an alternative: have the files be served over http
and use the parameter sld=http://myserver/mySld.sld as the request parameter in GetMap instead of using styles. The drawback of doing so
is that your sld will have to style all the layers afaik (not sure, I know it's there but I never tried it out).

Hope this helps
Cheers
Andrea