This project has moved. For the latest updates, please go here.

Performance in PostGIS layers

Topics: Data Access
Nov 3, 2009 at 8:41 PM

Hi, i am working with PostGIS layers in my server-client sharpmap application,  i want to increase the performance of the display of the PostGIS layers. is there a way to put in temporal memory the PostGIS layers?, to avoid in every refresh of the map call to the server all the PostGIS layer in display.  example: Yust to call one time the PostGIS layer and then when remove, free memory.

i have tried this code with low Performance and i can't use the CustomTheme in the layer because of this error "Attribute data is not supported by the GeometryProvider"

SharpMap.Data.Providers.PostGIS filtroColPostgis = new SharpMap.Data.Providers.PostGIS(ConnStr, "lotes_colonias", "the_geom", "20226");
filtroColPostgis.DefinitionQuery = "clv_col = '" + CLV_COL + "'";
layer.DataSource = filtroColPostgis;

SharpMap.Data.FeatureDataSet cacheTable = new SharpMap.Data.FeatureDataSet();
layer.DataSource.ExecuteIntersectionQuery(layer.DataSource.GetExtents(), cacheTable);
SharpMap.Data.FeatureDataTable tabla = new SharpMap.Data.FeatureDataTable();
 tabla = cacheTable.Tables[0];

layer.DataSource = new SharpMap.Data.Providers.GeometryProvider(tabla);


Nov 4, 2009 at 9:46 AM
Edited Nov 4, 2009 at 9:47 AM

Hi betoens, use a GeometryFeatureProvider if you need themeing or labelling hth jd