Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Osmnx | 4,461 | 16 | 84 | 12 hours ago | 61 | November 30, 2023 | 2 | mit | Python | |
OSMnx is a Python package to easily download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap. | ||||||||||
Pytorch_geometric_temporal | 2,282 | 4 | a month ago | 46 | September 04, 2022 | 20 | mit | Python | ||
PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models (CIKM 2021) | ||||||||||
T Gcn | 1,011 | 5 months ago | 1 | Jupyter Notebook | ||||||
Temporal Graph Convolutional Network for Urban Traffic Flow Prediction Method | ||||||||||
Spatial Transformer Network | 661 | 1 | 6 years ago | 3 | June 02, 2018 | 17 | mit | Python | ||
A Tensorflow implementation of Spatial Transformer Networks. | ||||||||||
Tps_stn_pytorch | 510 | 6 years ago | 8 | Python | ||||||
PyTorch implementation of Spatial Transformer Network (STN) with Thin Plate Spline (TPS) | ||||||||||
Cspn | 367 | 3 years ago | 14 | Python | ||||||
Convolutional Spatial Propagation Network | ||||||||||
Stnbhwd | 348 | 5 years ago | 14 | mit | Lua | |||||
Modules for spatial transformer networks (BHWD layout) | ||||||||||
Sfnetworks | 297 | 2 | 8 months ago | 5 | December 17, 2021 | 30 | other | R | ||
Tidy Geospatial Networks in R | ||||||||||
Spatial Transformer Tensorflow | 251 | 4 years ago | 3 | mit | Python | |||||
🐝Tensorflow Implementation of Spatial Transformer Networks | ||||||||||
Spaghetti | 243 | 5 | 7 days ago | 42 | June 19, 2023 | 25 | bsd-3-clause | Python | ||
SPAtial GrapHs: nETworks, Topology, & Inference |
A Python package to create and analyze surface water networks.
Python 3.8+ is required.
geopandas >=0.9
- process spatial data similar to pandaspackaging
- used to check package versionspandas >=1.2
- tabular data analysispyproj >=2.2
- spatial projection supportrtree
- spatial index supportflopy
- read/write MODFLOW modelsnetCDF4
- used to read TopNet filesRun pytest -v
or python3 -m pytest -v
For faster multi-core pytest -v -n 2
(with pytest-xdist
)
To run doctests pytest -v swn --doctest-modules
import geopandas
import pandas as pd
import swn
Read from Shapefile:
shp_srs = 'tests/data/DN2_Coastal_strahler1z_stream_vf.shp'
lines = geopandas.read_file(shp_srs)
lines.set_index('nzsegment', inplace=True, verify_integrity=True) # optional
Or, read from PostGIS:
from sqlalchemy import create_engine, engine
con_url = engine.url.URL(drivername='postgresql', database='scigen')
con = create_engine(con_url)
sql = 'SELECT * FROM wrc.rec2_riverlines_coastal'
lines = geopandas.read_postgis(sql, con)
lines.set_index('nzsegment', inplace=True, verify_integrity=True) # optional
Initialise and create network:
n = swn.SurfaceWaterNetwork.from_lines(lines.geometry)
print(n)
# <SurfaceWaterNetwork: with Z coordinates
# 304 segments: [3046409, 3046455, ..., 3050338, 3050418]
# 154 headwater: [3046409, 3046542, ..., 3050338, 3050418]
# 3 outlets: [3046700, 3046737, 3046736]
# no diversions />
Plot the network, write a Shapefile, write and read a SurfaceWaterNetwork file:
n.plot()
swn.file.gdf_to_shapefile(n.segments, 'segments.shp')
n.to_pickle('network.pkl')
n = swn.SurfaceWaterNetwork.from_pickle('network.pkl')
Remove segments that meet a condition (stream order), or that are upstream/downstream from certain locations:
n.remove(
n.segments.stream_order == 1,
segnums=n.gather_segnums(upstream=3047927))
Read flow data from a TopNet netCDF file, convert from m3/s to m3/day:
nc_path = 'tests/data/streamq_20170115_20170128_topnet_03046727_strahler1.nc'
flow = swn.file.topnet2ts(nc_path, 'mod_flow', 86400)
# remove time and truncate to closest day
flow.index = flow.index.floor('d')
# 7-day mean
flow7d = flow.resample('7D').mean()
# full mean
flow_m = pd.DataFrame(flow.mean(0)).T
Process a MODFLOW/flopy model:
import flopy
m = flopy.modflow.Modflow.load('h.nam', model_ws='tests/data', check=False)
nm = swn.SwnModflow.from_swn_flopy(n, m)
nm.default_segment_data()
nm.set_segment_data_inflow(flow_m)
nm.plot()
nm.to_pickle('sfr_network.pkl')
nm = swn.SwnModflow.from_pickle('sfr_network.pkl', n, m)
nm.set_sfr_obj()
m.sfr.write_file('file.sfr')
nm.grid_cells.to_file('grid_cells.shp')
nm.reaches.to_file('reaches.shp')
Toews, M. W.; Hemmings, B. 2019. A surface water network method for generalising streams and rapid groundwater model development. In: New Zealand Hydrological Society Conference, Rotorua, 3-6 December, 2019. p. 166-169.