Hello,
I need to colorize the US zip codes based on sales reps assigned per zip code.
I have my sales reps table about 42 entries and I have the shapfile (ZIP5) from the US census.
The code I am using is provided.
My issue is that kind of process is slow very slow...... The ZIP shapfile is on a RAM drive.
My server is a physical one with 24 cores and 80GB of memory. I can see the process running and when I am computing
the zip unions the server is only busy at 3/4%...... I would like to see my server busy at 100%!
Do I have miss something?
thanks a lot.
InMemoryFeatureLayer inMemoryFeatureLayer_Zips_Colorization_union = new InMemoryFeatureLayer();
inMemoryFeatureLayer_Zips_Colorization_union.Name = "inMemoryFeatureLayer_Zips_Colorization";
inMemoryFeatureLayer_Zips_Colorization_union.IsVisible = true;
inMemoryFeatureLayer_Zips_Colorization.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyleRep);
inMemoryFeatureLayer_Zips_Colorization_union.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
foreach (DictionaryEntry s in _repNameList)
{
inMemoryFeatureLayer_Zips_Colorization.FeatureSource.Open();
Collection<Feature> selectedZipFeatures = inMemoryFeatureLayer_Zips_Colorization.FeatureSource.GetFeaturesByColumnValue(RequestedColumns_RepPerZip[0].ColumnName.ToString(), s.Value.ToString());
inMemoryFeatureLayer_Zips_Colorization.FeatureSource.Close();
Collection<AreaBaseShape> areaBaseShapes = new Collection<AreaBaseShape>();
foreach (Feature feature in selectedZipFeatures)
{
areaBaseShapes.Add((AreaBaseShape)feature.GetShape());
}
MultipolygonShape unionMultipolygonShape = MultipolygonShape.Union(areaBaseShapes);
inMemoryFeatureLayer_Zips_Colorization_union.InternalFeatures.Add(new Feature(unionMultipolygonShape));
}
geoTools.Serialize_InMemoryFeatureLayer(inMemoryFeatureLayer_Zips_Colorization_union, SERVER_RAM_DRIVE_CACHE_PATH + "inMemoryFeatureLayer_Zips_Colorization_union.bin");
}