Skip to content

Added create ortho lines algorithms#30

Open
leonli809 wants to merge 1 commit intoGeosyntec:masterfrom
leonli809:Create_ortho_lines
Open

Added create ortho lines algorithms#30
leonli809 wants to merge 1 commit intoGeosyntec:masterfrom
leonli809:Create_ortho_lines

Conversation

@leonli809
Copy link
Copy Markdown

No description provided.

@phobson phobson self-assigned this Nov 14, 2017
Copy link
Copy Markdown
Contributor

@phobson phobson left a comment

Choose a reason for hiding this comment

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

here are some more comments besides the PEP8 formatting stuff.

bank = geometry.Polygon([(-2,0),(0,3),(6,6),(11,16),(13,16),(13,3),(4,1),(-1,-1),(-2,0)])
ortho_ln_set = vector.create_ortho_grid(line, bank, step = 0.01, grid_dist = 1, buffer_dist = 1, max_dist = 10)
gdf_ortho_ln = geopandas.GeoDataFrame(geometry=ortho_ln_set)
print(gdf_ortho_ln)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't include print statements in library code

def line_to_point(line_geom,interval_dist):
"""
Create a series of points x distance apart along a line geometry
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return points

def compute_ortho_bearing(bearings):
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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


def draw_ortho_line_to_bank(ct_pt_geom, bank_geom, ortho_bearing, step, buffer_dist, max_dist):
"""
Search for intersects between the orthogonal lines and the river banks until max_dist is reached.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return ortho_ln_set

def create_ortho_grid(ct_ln_geom, bank_geom, step, grid_dist, buffer_dist, max_dist):
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is close to the numpydoc format but not quite there. see the other functions for examples.

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