Hi Support,
I try to create a heat-map using attached shape file without projection, but it does not show anything.
The X/Y coordinates in the shape file are around -30000 / -14000.
Here is my code :
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));
Map1.MapUnit = GeographyUnit.Meter;
string strShapeFile = MapPath("~/SampleData/ShapeFiles/A1.shp");
ShapeFileFeatureSource.BuildIndexFile(strShapeFile, BuildIndexMode.DoNotRebuild);
ShapeFileFeatureSource featureSource = new ShapeFileFeatureSource(strShapeFile);
featureSource.Open();
Map1.CurrentExtent = featureSource.GetBoundingBox();
featureSource.Close();
HeatLayer heatLayer = new HeatLayer(featureSource);
heatLayer.HeatStyle = new HeatStyle(180, “IBIS-DB”, -50, 50);
LayerOverlay heatlayerOverlay = new LayerOverlay();
heatlayerOverlay.IsBaseOverlay = false;
heatlayerOverlay.Layers.Add(heatLayer);
Map1.CustomOverlays.Add(heatlayerOverlay);
Is it possible to show such a shape file without projection?
Kind regards
Helmut
001_ShapeFile.zip (197 KB)
Use shape file without projection
Hi Helmut,
Sorry for waiting. It’s okay to show a shapefile without projection. The code you attached here is okay, I did some tests based on it. The reason why it doesn’t show anything here is that in order to make the ‘HeatStyle’ show smoothly there is an interpolation algorithm. For your data it will take more time to interpolate value for the features.
Please try set the map’s extent to a bigger one for the test. The following screenshot is showing the extent of ‘Map1.CurrentExtent = new RectangleShape(-127799.18804751,
62371.048551248, 67879.114860874, -84387.67863004);’.
Also we can reduce the features for the ‘HeatStyle’.
Hope it’s helpful.
Regards,
Peter
Hi Peter,
thanks for the assistance and it basically works, but it is too slow.
As the shape file can contain 200000 points, I tried an other solution using ClassBreakStyle to color the point according to there value.
It is not that smooth but works and will be the way to go.
Best Regards
Helmut
Hi Helmut,
The reason is that PointRadius property of HeatStyle is too large. Please try the following code to change the default settings:
heatLayer.HeatStyle.PointRadius = 10;
heatLayer.HeatStyle.PointRadiusUnit=
DistanceUnit.Meter;
The following description shows some properties have effect on HeatStyle.
1. PointIntensity
Colors represent different intensity, as show below:
Color :
2. IntensityRangeStart and IntensityRangeEnd
These two properties are showing the range of valid value.
Example:
heatStyle.IntensityRangeStart =0;
heatStyle.IntensityRangeEnd = 10;
Then here is a point with 5 intensity, so we get green as the color of the circle center, as shown below:
3.
IntensityColumnName
It shows where
the intensity of point is stored. If the value is out of the intensity range,
it will be set to the minimum or maximum values depending on it is bigger or
smaller than range.
Currently we only
support positive numbers, in the future version we will optimize it to support
negative numbers.
4. PointRadiusUnit
and PointRadius
These
two properties are effect on the PointRadius.
5. Alpha
It describes transparency of the color.
The following screenshots shows the effects with different values:
heatStyle.Alpha = 50;
heatStyle.Alpha = 180;
Regards,
Peter
Hi Peter,
using ClassBreakStyle is OK. Every point gets a value dependent color. For grid data with 9000 points it would look like this:
Thanks for support.
Best regards
Helmut
Hi Helmut,
Very glad to hear it works for you.
Regards,
Peter