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

add vertices from line string geometries when convering GIS object to… #388

Merged
merged 3 commits into from Nov 2, 2023

Conversation

kbonney
Copy link
Collaborator

@kbonney kbonney commented Oct 30, 2023

Addresses #387

Summary

Created vertices from linestring geometries when convering GIS object to Model object.

Example

import wntr

wn_path = "io.inp"

wn = wntr.network.WaterNetworkModel(wn_path)
wn_gis = wn.to_gis()
wn_from_gis = wntr.network.io.from_gis(wn_gis)

# print vertices
for link_name in wn.link_name_list:
    link = wn.get_link(link_name)
    print(link.vertices)
# prints
# [(15.0, 5.0), (20.0, 5.0)]
# []
# []
# []
# []
# []

for link_name in wn_from_gis.link_name_list:
    link = wn_from_gis.get_link(link_name)
    print(link.vertices)
# now prints
# [(15.0, 5.0), (20.0, 5.0)]
# []
# []
# []
# []
# []

Tests and documentation

Added the above example as a test. No documentation needed.

Acknowledgement

By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.

@coveralls
Copy link

coveralls commented Oct 30, 2023

Coverage Status

coverage: 84.478% (+0.04%) from 84.437% when pulling bdea21e on kbonney:gis_vertices into fb3c07b on USEPA:main.

@kbonney
Copy link
Collaborator Author

kbonney commented Nov 2, 2023

@kaklise added a test.

@kaklise kaklise merged commit 6b63bae into USEPA:main Nov 2, 2023
40 checks passed
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.

None yet

3 participants