-
Notifications
You must be signed in to change notification settings - Fork 1
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
Review of the read_shapefile
and kl_divergence
notebooks
#1
Comments
read_shapefile
and kl_divergence` notebooksread_shapefile
and kl_divergence
notebooks
Please note - the |
Please note - today's (gitmoji-inspired) update raises an issue within read_shapefile.ipynb. The issue is within the final code block - In[16] - where the following line is returning an error: The crux of the error appears to be the following: Any help would be greatly appreciated - my searching seems to only identify this problem within other pieces of software, which make the solution hard to translate |
Odd! Is there a file existing there when you open it in Finder? If there are issues, it's OK to use a shape file for now. |
Hey Noah!
Could you try specifying an additional argument called 'layer'? For
example, try the following:
leicester_oa_eth_shp.to_file("../leicester/data/leicester_ethnicity.gpkg",
layer='OA', driver = "GPKG")
Link to geopandas reading and writing files
<https://geopandas.org/docs/user_guide/io.html#writing-spatial-data>
I'm guessing it needs you to create a table name before it can write the
file
…On Mon, Jul 19, 2021 at 9:24 AM Levi John Wolf ***@***.***> wrote:
Odd! Is there a file existing there when you open it in Finder?
If there are issues, it's OK to use a shape file for now.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPYN5RFJHRODO2ANEQZ24TTYQYSNANCNFSM5ALBSCQQ>
.
--
*Jeff Sauer* | Pronouns: he/him/his
PhD candidate in GIS & RS | University of Maryland College Park
Phone: +1 (612) 394 1115 | Email: ***@***.***
|
Hey! Unfortunately adding the layer argument still returns the same issue. There isn't a file in that location locally - I supposed that the Is it worth creating a GeoPackage to then update? If so, how's best to do that? |
Hmm, drat! Okay, let's try a simple test first -
Let's load some of the built-in geopandas data and try to write is as a
geopackage.
```
import geopandas as gpd
test = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
test.to_file("FULL/PATH/TO/DESKTOP/test.gpkg", driver = "GPKG")
```
Do the above three lines work?
…On Mon, Jul 19, 2021 at 9:39 AM Noah Bouchier ***@***.***> wrote:
Hey!
Unfortunately adding the layer argument still returns the same issue.
There isn't a file in that location locally - I supposed that the to.file
would create the file, as I've experienced previously with the shape files.
But that did cross my mind when reading the error.
Is it worth creating a GeoPackage to then update? If so, how's best to do
that?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPYN5QU6I5FNA5HHFNL3XDTYQ2IZANCNFSM5ALBSCQQ>
.
--
*Jeff Sauer* | Pronouns: he/him/his
PhD candidate in GIS & RS | University of Maryland College Park
Phone: +1 (612) 394 1115 | Email: ***@***.***
|
Yes - they create a 324KB file on my desktop that I've been able to successfully read back in under a different object name |
@noahbouchier worked through the notebook on my local machine. You need to specify the full path when using Remove the .. and use the full path. I got the same error as you when trying to save with '../'. Once I put in the full path I was able to save the GPKG. Example:
|
@jeffcsauer thanks so much for your help! Your solution helped me to identify the problem - stemming from my oversight. The file path Within the GitHub repository, the correct file path is:
When I use this, the GeoPackage file is created exactly as it should be, like a dream. Thanks for your help, and apologies for the error that created the problem |
no prob! the error raised when the path is wrong are not the most informative... glad you figured it out! |
As the first evidence of code that will help to form the output of my Google Summer of Code project - I'd be appreciative of any feedback on the
read_shapefile
andkl_divergence
notebooks.Some of the explanatory text is quite beefy, so feel free to skim that!
The text was updated successfully, but these errors were encountered: