Yes, you can estimate land area using TaroWorks, but before diving into the solution, let's look at two main sources of error so you can determine whether this solution is suitable for your scenario.

Sources of Error

- The
**Number and location of coordinates**can impact the accuracy of your area measurements. In the diagram below, the light green represents the land we'd like to calculate the area for, the red X's represent the gps coordinates recorded by the mobile user, and the dark green represents the area that the solution in this article would calculate. This solution will calculate the area of the shape that results from connecting consecutive coordinates with a straight line. In the first example, only 3 points are record and much of the land area is not accounted for. In the second, another point is added, so the estimated area is closer to the actual area. However, the position of the points matters as well. In the last example the 4 GPS coordinates are recorded at the furthest points from the center and would result in a highly accurate area calculation. **Concave shapes**are another source of area. Take the example below. The light green shape is the land for which we'd like to estimate the area. The red X's are the coordinates we have to estimate from. The method with which area is calculated with this solution is the sum of the areas of each of the triangles formed by a single point and two other consecutive points. For the shape below, the total area that would be calculated with this method is A1+A2+A3+A4. The estimated area will be greater than the actual area of this land due to the concave nature of shape.

If the areas you'll be calculating will be close to convex polygons, then that will significantly decrease your variance. Also the more points you can take that are furthest from the center of the shape being measured, the more accurate the resulting area calculation. For example, if I was trying to measure the area of the turquoise oval below, I could increase the accuracy of the area calculated by having the mobile user record more GPS coordinates along the perimeter of the land. Finally, the calculated area can only be as accurate as the coordinates provided, so it's also recommended that you use GPS only if possible (and don't allow the phone to use wireless or mobile data to triangulate a location).

Solution

The following steps will show you how to produce a calculated area of the polygon enclosed by 3-10 GPS coordinates using Heron's formula. It will also show you how to display a map of that polygon on satellite imagery using the google maps API. Please be aware that Google does have a cap on complimentary queries via its maps api.

- Create at least three decimal geolocation fields. For this example, we are going to create 10 geocoordinates: PP1 - PP10.
- Let Np = the maximum number of perimeter points you're going to allow the mobile users to capture. Create (Np-2) number formula fields. They don't need to be displayed in the page layout, but are rather used for the calculation in the background. Each formula field represents the area of a triangle contained by the polygon created by the geolocations captured. For our example (3-10 GPS coordinates), we'll need 8 formula fields, A1 - A8. The perimeter points for each formula field will consist of the first point, and two consecutive points. A1 will be calculated using the triangle defined by PP1, PP2 and PP3. If more than 3 geolocations were captured, A2 would be calculated using the triangle defined by PP1, PP3, PP4. The following formulas return the area of each triangle in hectares. To have the result calculated in miles, replace 'km' with 'mi' and remove the *100 from the end of the formula.
A1

IF(ISNULL(PP1__c),0,1/4* SQRT(4*(DISTANCE( PP1__c , PP2__c, 'km')^2)*((DISTANCE( PP2__c , PP3__c, 'km')^2))-((DISTANCE( PP1__c , PP2__c, 'km')^2)+(DISTANCE( PP2__c , PP3__c, 'km')^2)-(DISTANCE( PP3__c , PP1__c, 'km')^2))^2))*100 A2 IF(ISNULL(PP4__c),0,1/4* SQRT(4*(DISTANCE( PP1__c , PP3__c, 'km')^2)*((DISTANCE( PP3__c , PP4__c, 'km')^2))-((DISTANCE( PP1__c , PP3__c, 'km')^2)+(DISTANCE( PP3__c , PP4__c, 'km')^2)-(DISTANCE( PP4__c , PP1__c, 'km')^2))^2))*100 A3 IF(OR(ISNULL(PP4__c),ISNULL(PP5__c)),0,1/4* SQRT(4*(DISTANCE( PP1__c , PP4__c, 'km')^2)*((DISTANCE( PP4__c , PP5__c, 'km')^2))-((DISTANCE( PP1__c , PP4__c, 'km')^2)+(DISTANCE( PP4__c , PP5__c, 'km')^2)-(DISTANCE( PP5__c , PP1__c, 'km')^2))^2))*100 A4 IF(OR(ISNULL(PP5__c),ISNULL(PP6__c)),0,1/4* SQRT(4*(DISTANCE( PP1__c , PP5__c, 'km')^2)*((DISTANCE( PP5__c , PP6__c, 'km')^2))-((DISTANCE( PP1__c , PP5__c, 'km')^2)+(DISTANCE( PP5__c , PP6__c, 'km')^2)-(DISTANCE( PP6__c , PP1__c, 'km')^2))^2))*100 A5 IF(OR(ISNULL(PP6__c),ISNULL(PP7__c)),0,1/4* SQRT(4*(DISTANCE( PP1__c , PP6__c, 'km')^2)*((DISTANCE( PP6__c , PP7__c, 'km')^2))-((DISTANCE( PP1__c , PP6__c, 'km')^2)+(DISTANCE( PP6__c , PP7__c, 'km')^2)-(DISTANCE( PP7__c , PP1__c, 'km')^2))^2))*100 A6 IF(OR(ISNULL(PP7__c),ISNULL(PP8__c)),0,1/4* SQRT(4*(DISTANCE( PP1__c , PP7__c, 'km')^2)*((DISTANCE( PP7__c , PP8__c, 'km')^2))-((DISTANCE( PP1__c , PP7__c, 'km')^2)+(DISTANCE( PP7__c , PP8__c, 'km')^2)-(DISTANCE( PP8__c , PP1__c, 'km')^2))^2))*100 A7 IF(OR(ISNULL(PP8__c),ISNULL(PP9__c)),0,1/4* SQRT(4*(DISTANCE( PP1__c , PP8__c, 'km')^2)*((DISTANCE( PP8__c , PP9__c, 'km')^2))-((DISTANCE( PP1__c , PP8__c, 'km')^2)+(DISTANCE( PP8__c , PP9__c, 'km')^2)-(DISTANCE( PP9__c , PP1__c, 'km')^2))^2))*100 A8 IF(OR(ISNULL(PP9__c),ISNULL(PP10__c)),0,1/4* SQRT(4*(DISTANCE( PP1__c , PP9__c, 'km')^2)*((DISTANCE( PP8__c , PP10__c, 'km')^2))-((DISTANCE( PP1__c , PP9__c, 'km')^2)+(DISTANCE( PP9__c , PP10__c, 'km')^2)-(DISTANCE( PP10__c , PP1__c, 'km')^2))^2))*100 - Due to the limitation on the length of compiled formula fields, we'll need to create a workflow to sum the area of all of the triangles. First, create a number field to store the sum in.
- Then create a workflow that will run when any updates to this record that will sum the area fields. The formula value is: A1__c + A2__c + A3__c + A4__c + A5__c + A6__c + A7__c + A8__c
- Create a Form that populates the geolocation fields, and ensure that the first three locations are required.
- To view the coordinates that are stored in the object on a map with satellite imagery you'll need to create two text formula fields. Create the first called, "Map Link" using the following formula. If your maximum number of points is less than 10, you can delete the lines referencing those points. For example, if I only created 3 geolocation fields, I would omit all the lines not in bold. If I created 4 geolocation fields, I would omit all the lines that are not in bold except the line referencing the 4th field, "& IF(ISNULL(PP4__c),"","%7C"&TEXT(PP4__Latitude__s)&","&TEXT(PP4__Longitude__s))". You can customize the zoom and size to your liking.
**"http://maps.google.com/maps/api/staticmap?size=400x400&zoom=17&maptype=satellite&sensor=true&path=color:0x0000ff80%7C"&TEXT(PP1__Latitude__s)&","&TEXT(PP1__Longitude__s)&"%7C"&TEXT(PP2__Latitude__s)&","&TEXT(PP2__Longitude__s)&"%7C"&TEXT(PP3__Latitude__s)&","&TEXT(PP3__Longitude__s)**& IF(ISNULL(PP4__c),"","%7C"&TEXT(PP4__Latitude__s)&","&TEXT(PP4__Longitude__s))

& IF(ISNULL(PP5__c),"","%7C"&TEXT(PP5__Latitude__s)&","&TEXT(PP5__Longitude__s))

& IF(ISNULL(PP6__c),"","%7C"&TEXT(PP6__Latitude__s)&","&TEXT(PP6__Longitude__s))

& IF(ISNULL(PP7__c),"","%7C"&TEXT(PP7__Latitude__s)&","&TEXT(PP7__Longitude__s))

& IF(ISNULL(PP8__c),"","%7C"&TEXT(PP8__Latitude__s)&","&TEXT(PP8__Longitude__s))

& IF(ISNULL(PP9__c),"","%7C"&TEXT(PP9__Latitude__s)&","&TEXT(PP9__Longitude__s))

& IF(ISNULL(PP10__c),"","%7C"&TEXT(PP10__Latitude__s)&","&TEXT(PP10__Longitude__s))

**& "%7C"&TEXT(PP1__Latitude__s)&","&TEXT(PP1__Longitude__s)** - The second text formula field can be called "Map Display" and will reference the first. You can use the following formula for this field:

IF( OR( ISBLANK( PP1__Latitude__s ) , ISBLANK( PP1__Longitude__s ) ) , "Missing Coordinates", IMAGE( Map_Link__c , "", 300,300)) - The result is a visual representation and calculation in hectares of the area contained by the coordinates captured. In the example below, 10 coordinates were captured around the Apple Bowl in Kelowna, and the resulting area is accurate within a one hundredth of a hectare.

## Comments

0 comments

Please sign in to leave a comment.