Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
Unable to accurately display geofence radius in meters on XamGeographicMap using GeographicProportionalSymbolSeries
posted

I am trying to relate a physical distance to a XamGeographicMap using the GeographicProportionalSymbolSeries series. I want the radius size of my geofence radii on the map to match the distance in meters I have set for the geofence in my application. I have bound my Geocode information and have supplied the "RadiusMemberPath" for Approaching, Departed, and Arrived geofence radii. Each radius is laid on top of the location, is colour coded, and is displayed on the map. 

The issue is when using the RadiusMemberPath on its own without using a SizeScale, the radius size of the geofence doesn't increase when passing in a larger value for the RadiusMemberPath. Changing the RadiusMemberPath values that are passed in only changes the percentage area that a single geofence takes up as the circle area size is always the same. 

If I provide a SizeScale to the series, I can change the radius size of the geofence so that it takes up a larger area. The issue I've had using SizeScale, is the units are relative to the MinimumValue and MaximumValue and I can't relate those units to physical distance on the map. I have tried using a linear and a logarithmic scale and I'm unable to accurately translate meters in my data to a geofence radius on the map.

Is there any way I can display a Geofence on the map with a circular radius that accurately matches a distance in meters?

<!--<ig:GeographicProportionalSymbolSeries.RadiusScale>
<ig:SizeScale MinimumValue="1" MaximumValue="100" IsLogarithmic="False" />
</ig:GeographicProportionalSymbolSeries.RadiusScale>-->

<ig:GeographicProportionalSymbolSeries x:Name="LocationGeofenceRadiusSeries"
ItemsSource="{Binding Path=Geocoordinates}"
LatitudeMemberPath="Geocode.Latitude"
LongitudeMemberPath="Geocode.Longitude"
RadiusMemberPath="RadiusSize"
FillMemberPath="RadiusColor"
FillScale="{StaticResource CustomPaletteBrushScale}"
MarkerType="Circle"
Opacity="0.50"
MarkerOutline="Black">
</ig:GeographicProportionalSymbolSeries>

Parents
No Data
Reply
  • 34690
    Verified Answer
    Offline posted

    Hello Dave,

    I have been investigating into the behavior you are looking to achieve, and there is no SizeScale setting that will automatically get you sizes in meters. The GeographicProportionalSymbolSeries’ SizeScale sizes to pixels and is directly proportional to the RadiusMemberPath that you provide to it. That is, if you were to have ten points in your data that had radii of 1 through 10 and you assigned a MinimumValue and MaximumValue of 1 and 10 to the SizeScale, then the point with radius 1 would be drawn as an ellipse that is 1 pixel in diameter and the point with radius 10 would be drawn 10 pixels in diameter.

    Knowing this, something you may be able to do in this case is utilize the XamGeographicMap.GetPixelPoint method, which takes a geographic lat/long coordinate and converts it to pixel-space in the map. This would essentially net you a scaling factor between geographic coordinates and device pixels. If you did this with two lat/long coordinates and had a mapping between latitude, longitude and distance, you could theoretically find how large in pixels you would need your points to be.

    If you would like to see a built-in way of scaling to distances, I would recommend suggesting a new product idea for this at our WPF Ideas Site, here. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.

    Please let me know if you have any other questions or concerns on this matter.

Children