Replies: 2 comments 1 reply
-
@everettsp, I think it would fit with SWMMIO the best. Have a look at the viz library in there. My suggestion is to make it fairly modular since we might move all viz out of that tool later |
Beta Was this translation helpful? Give feedback.
-
@everettsp, I like this idea too. Keep in mind though that there already is similar functionality provided in the import swmmio
# create a swmmio Model object with a coordinate reference system
model = swmmio.Model('path.inp', crs='EPSG:4326')
# create an image of the model
swmmio.draw_model(model)
# visualize the model in an interactive map
swmmio.create_map(model, filename="my-cool-model-map.html") That said, the We can also access the wealth of Geopandas / matplotlib plotting utilities by tapping into the # grab an example model
from swmmio.examples import jersey
# do some matplotlib via geopandas
ax = jersey.links.geodataframe.plot(linewidth=jersey.links.dataframe['Geom1']*3, capstyle='round')
jersey.nodes.geodataframe.plot('MaxDepth', ax=ax, markersize='InvertElev', zorder=2)
jersey.subcatchments.geodataframe.plot('PercImperv', ax=ax, alpha=0.5, zorder=1) Similarly, we can export model elements as GeoJSON from this API: jersey.nodes.geodataframe.to_json()
Having said that, I still feel like it would be nice to make it easier to quickly visualize SWMM models, as you suggest. I like the idea of adding a What do you think of that? Overall, I definitely support you submitting a PR that helps move swmmio in this direction! |
Beta Was this translation helpful? Give feedback.
-
Would this type of plotting function be a useful addition to swmmio? If so, I can polish it up and submit a PR. Would also make it easy to export to GeoJSON, which I see hasn't been implemented yet.
Beta Was this translation helpful? Give feedback.
All reactions