convert points to polyline to polygon to calculate area

2601
3
Jump to solution
09-08-2015 09:15 AM
PeterBennett1
New Contributor

Hello All, good morning!

I have a set of points (lat and lon) that shows a vehicle route/path, I want to get the area covered by that vehicle.

What would be the best approach to get this done?

Cycle through each point to build a polygon, joining first and last point?

How do I build a polygon that has all points as a perimeter?

Thank you in advance

Best Regards

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

@Dan not if you use the geodesic area calculations provided by the geometry engine 😉 In that case it's actually better - I'm a big believer in never doing area calculations in a projection but keeping it all in spherical coordinates and using ellipsoidal calculations.

But to answer the question: You can create a polygon from a set of points, and you can get that set of points from the polyline path. Ex:

    var myPolygon = new Polygon(myPolyline.Parts[0], myPolyline.SpatialReference);

Alternatively use the PolygonBuilder to add vertices one by one in a loop, and call ToGeometry() when you're done.

View solution in original post

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

don't forget that you will also have to project your data to something other than a geographic coordinate system or your areas will be meaningless.

0 Kudos
dotMorten_esri
Esri Notable Contributor

@Dan not if you use the geodesic area calculations provided by the geometry engine 😉 In that case it's actually better - I'm a big believer in never doing area calculations in a projection but keeping it all in spherical coordinates and using ellipsoidal calculations.

But to answer the question: You can create a polygon from a set of points, and you can get that set of points from the polyline path. Ex:

    var myPolygon = new Polygon(myPolyline.Parts[0], myPolyline.SpatialReference);

Alternatively use the PolygonBuilder to add vertices one by one in a loop, and call ToGeometry() when you're done.

0 Kudos
DanPatterson_Retired
MVP Emeritus

I know...just trying to head off the..."my areas are wrong" comments...geodesic, I can guarantee you, is not widely understood by a significant number of people using GIS...some are just now getting comfortable with projection...although Define Projection and Project and ArcMap Project do present some conceptual difficulties given the overuse of the term...but that is for another project

0 Kudos