Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added perimeter method rmp #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

added perimeter method rmp #4

wants to merge 1 commit into from

Conversation

rpotok
Copy link

@rpotok rpotok commented Mar 18, 2016

added a perimeters method to vector.py. Can transform, then calculates perimeter by summing the distance between points of a polygon or a collection of polygons (multipolygon). Returns series (same methodology as areas method, but stays in GDAL for projections other than UTM (needs to convert to shapely then back to GDAL geometry to remain consistent with the areas methodology).

points.append((shp.GetX(p), shp.GetY(p)))
Nedges = len(points)-1
length = []
for i in xrange(Nedges):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to do this via pure numpy (diff, norm, sum).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants