Hi
I want to show some weather data on my map and the GeographicScatterAreaSeries seems to be the way to go.
I have a dataset simular to this:
Lat Lon Wind
53,90899 2,135807 6
53,93641 2,125473 5,9
53,8842 2,112338 6,1
... and so on
Can you point me in the right direction on how to use the GeographicScatterAreaSeries for this?
I already tried to create a test class:
public class TestClass{ public Point P { get; set; } public double Wind { get; set; }}
And then setting the datasource:
scatterSeries.ItemsSource = enumrableOfTestClass;scatterSeries.ColorMemberPath = "Wind";scatterSeries.LongitudeMemberPath = "P.X";scatterSeries.LongitudeMemberPath = "P.Y";
But nothing shows on the map.
Do I need to use some TriangleSource? As far as I could read in the documentation this should not be nessesary?
Do you have any helper functions/hints to create a TriangleSource from this dataset described above?
Hello logimatic,
Thank you for your post.
I have been investigating into this issue you are seeing, and you are correct that it is not necessary to use a TriangleSource in the XamGeographicMap when implementing the GeographicScatterAreaSeries. I believe the issue here is that it doesn't appear that you are using a ColorScale for your GeographicScatterAreaSeries. I would recommend that you add a CustomPaletteColorScale object with the MinimumValue, MaximumValue, InterpolationMode, and Palette properties set, as seen in the code in the documentation article, here: http://help.infragistics.com/Help/Doc/WPF/2012.2/CLR4.0/html/xamGeographicMap_Using_Geographic_Scatter_Area_Series.html.
Regarding the usage of TriangleSource, I would recommend that you take a look at this article in our online documentation about Triangulating Geographic Data: http://help.infragistics.com/Help/Doc/WPF/2012.2/CLR4.0/html/xamGeographicMap_Triangulating_Geographic_Data.html.
There is also a possibility here that your data set is very large, in which the auto-triangulation in the XamGeographicMap has the ability to take a longer time to calculate. From the code you have provided me, it does appear that you are missing the ColorScale, though. If this is not the case, and you data set is indeed rather large, please let me know.
I have attached a sample project to demonstrate the proper usage of a GeographicScatterAreaSeries. You will need to zoom in a little bit to be able to see the data plot, but currently this data is plotted in a triangular shape around the European cities of Paris, Berlin, and Amsterdam. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks for the reply.
Now I can see data and it performs fine.
However the triangulation is a bit wrong. The wind should only be shown above water, but with several point close to the coast som areas of the land is colered. However I think is another issue and I will look into how I can create my own source.
I believe that it may be possible that the triangulation issues that you are currently seeing could be a result of the way that your CustomPaletteColorScale is set up. Specifically, the way that the MinimumValue and MaximumValue properties are set up. By default, the closer that a point is to the MinimumValue of your color scale, the less opaque it will be, until it becomes fully transparent. You may want to try setting the Opacity property on the GeographicScatterAreaSeries to see if you see a difference in the way your data is triangulated. If you set it to 1.0, you should see all of your data.
Hi Andrew
My ColorScale should be like this:
Min: 0.5, Max: 10
< 0.5: Green
0,5 - 1: Light Green
1 - 1.5: YellowGreen
1.5 - 2: Light Blue
2 - 3: Blue
3 - 4: Dark blue
4 - 6: Red
6 - 10: DarkRed
> 10: Black
I dont think this is possible? The span between the colors is not the same.
If I am wrong I would like to see an example.
I have been investigating into this issue, and currently the GeographicScatterAreaSeries creates the gradient in a constant way based on the Palette of the color scale that is applied to it, and so a direct setting of which number corresponds to which color is currently not supported by this series. If you would like to see this feature included in a future version, I would recommend suggesting a new product idea for it at http://ideas.infragistics.com. The product ideas site will allow you to create your own ideas or vote on existing ones, which will place you in direct communication with our product management teams who plan and prioritize new features and products based on community feedback.
As a possible workaround, you might be able to "fake" the behavior you are looking for by creating your CustomPaletteColorScale in code. Suppose you had a minimum and a maximum of 1 and 4 respectively, and you wanted 4 to be Red, and 1, 2, and 3 to be Blue. You could add multiples of the colors that you need for longer scales. For example if you created your Palette like so:
scale.Palette = new System.Collections.ObjectModel.ObservableCollection<Color>() { Colors.Blue, Colors.Blue, Colors.Blue, Colors.Red };
The above would skew the gradient to use much more blue than red, but there is no guarantee that this would respect the scale you are looking for. Albeit, it would be closer to what you were looking for. The product idea may still be a better option here though, especially if you are looking for a very exact data sampling.