Are there any simple tools to get an extent (rectangle) of x feet around a given lat/long point without having to go to all kinds of math?
Thanx,
Rob
Are there any simple tools to get an extent (rectangle) of x feet around a given lat/long point without having to go to all kinds of math?
Thanx,
Rob
Robert,
Yes. Actually we have a namespace DecimalDegreesHelper with various static functions to do calculation when dealing with longitude and latitude (decimal degrees) so that you don't have to do the math yourself. So, let's take the example that you have to points that could be representing some extent, see the code below:
PointShape pointShape1 = new PointShape(-98.56, 45);
PointShape pointShape2 = new PointShape(-98.55, 45);
double distanceInFeet = DecimalDegreesHelper.GetDistanceFromDecimalDegrees(pointShape1, pointShape2, DistanceUnit.Feet);
Val,
That’s not quite what I was looking for, but you led me down the right path. Here is what I came up with:
latitudeDifference = DecimalDegreesHelper.GetLatitudeDifferenceFromDistance(500, DistanceUnit.Feet, p_longitude)
longitudeDifference = DecimalDegreesHelper.GetLongitudeDifferenceFromDistance(500, DistanceUnit.Feet, p_latitude)
tempExtent = New RectangleShape(p_longitude - longitudeDifference, p_latitude + latitudeDifference, p_longitude + longitudeDifference, p_latitude - latitudeDifference)
Thanx,
Rob
Robert,
Thanks for your mention, we are glad you found the solution.
Free fell to let us know if you have more questions.
Thanks,
James