-
Notifications
You must be signed in to change notification settings - Fork 365
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
clarify how to make code that uses cartopy run in an offline environment #2329
Comments
You can just paste source code in triple back ticks like this:
|
I've tried to reproduce this in both a Python 3.11 and a Python 3.9 venv. mpl_toolkits is not on pip. Hopefully it will install after the other deps with:
|
The above did install mpl_toolkits. This allowed me to rule out Cartopy auto-magically downloading the Shapefile from OWS or some other online GIS service. Please can you attach the shapefile you used Phillip?
|
Never mind. I can't reproduce the issue Phillip. The code in the zip file runs for me. Are you using the Fiona back end instead of the PyShp one? Something required
I got the shapefile from here: https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip To make a test env:
|
Hello James. Your output looks correct. I get the same thing on an Internet-connected computer. Have you tried on a computer without an Internet connection? If that works for you, then cartopy must be caching the files somewhere. With no cached files and no Internet connection, the code should fail. |
Yes - this was with the connection turned off. If you look closely, the 404 to this very page is visible behind the matplotlib window. If this issue really is important, please provide a minimal reproducible example, and full details of your Python environment, including whether you're using Fiona or PyShp (e.g. from |
There is also a script provided to download offline data as well. This could probably be an additional section in the docs to explain how to do it. PRs to help with the docs are very welcome. |
This is very helpful. Thanks!
…On Tue, Feb 20, 2024 at 6:14 PM Greg Lucas ***@***.***> wrote:
cfeature.STATES and cfeature.BORDERS are not included with Cartopy, so it
is likely those two lines.
You can download data and supply it via the cartopy.config dictionary:
https://scitools.org.uk/cartopy/docs/latest/reference/config.html
There is also a script provided to download offline data as well.
https://github.com/SciTools/cartopy/blob/main/lib/cartopy/feature/download/__main__.py
This could probably be an additional section in the docs to explain how to
do it. PRs to help with the docs are very welcome.
—
Reply to this email directly, view it on GitHub
<#2329 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIEDRDFELPSGFBV3QF4L2DYUVKAHAVCNFSM6AAAAABDRX4O66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJVG42DIMRQGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The attached code works on computers with an Internet connection, but fails on a computer with no Internet connection when attempting to download files. It is unclear what in the code is triggering the downloads, and it is also unclear how to force the code to load files from a local repository. This seems like a poor design.
cartopy_wheat.zip
The text was updated successfully, but these errors were encountered: