-
Notifications
You must be signed in to change notification settings - Fork 50
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
drop down to sqlite3 for gpkg read to avoid gdal dependencies #604
Comments
Tested this by using the old function and the new function to read a geopackage for the 03w VPU:
Then compare the outputs: d = read_geopkg("03w/nextgen_03W.gpkg")
d2 = read_geopkg_sqlite3("03w/nextgen_03W.gpkg")
d.drop(["geometry"],axis=1) == d2.drop(["geom", "fid_x", "fid_y"],axis=1)
## Returns all True The only difference is the geometry. Useful comments on datacarpentry.org here. |
ping @ZacharyWills |
Your sql statement is a special case that has its own convenience function, pd.read_sql_table('flowpaths', con, index_col='id') |
Python 3.10+ |
t-route/src/troute-network/troute/HYFeaturesNetwork.py
Lines 16 to 20 in 01c713a
In most cases (in every case?) for t-route, we are discarding the geometry data and only use the geo-enabled packages for convenience in reading the files where the network connectivity information is stored.
To avoid unnecessary (see note) dependencies, we could update this function to look something like the following:
Note: More accurately, "troublesome" dependencies. Gdal has been causing some trouble on the arm64 builds and if we can circumvent those issues, we gain (potentially) quite a bit of performance.
Note2: The geopandas read is (I believe) lazy, so this direct sql read with the connection closing will carry a performance hit, potentially, especially for very large flowpath tables.
The text was updated successfully, but these errors were encountered: