You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been following the "plot over Google map" tutorial in an attempt to plot some data points over a satellite image. However, the Map function fails every time. My code will run until Map is called, hangs for 30-45 seconds, then I get a pop up window that says "Python has stopped working. A problem has caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." I'm running Python 3.7.3 on Windows 10 64 bit. Based on how easy is is to reproduce the error, where it occurs in the code, and the error itself I believe it is an issues with Salem on Windows/Python 3.7 rather than a flaw in my code.
This is the function I am trying to run:
import matplotlib.pyplot as plt
import pandas as pd
import salem
from salem import get_demo_file, DataLevels, GoogleVisibleMap, Grid, Map
from pyproj import Proj
def showImage():
g = GoogleVisibleMap(x=[X1, X2], y=[Y1, Y2], #Censored lat/long since it is where I live
scale=2,
maptype='satellite')
grid = g.grid
print(grid)
salem.Map(grid, factor=1, countries=False)
This example is the simplest version I have been able to reproduce the issue with. g was taken from the example given in salem.Grid documentation:
import salem
from salem import Map, Grid
from pyproj import Proj
g = Grid(nxny=(3, 2), dxdy=(1, 1), x0y0=(0, 0), proj="wgs84")
Map(g)
I believe it is an issues with Salem on Windows/Python 3.7 rather than a flaw in my code
Although it's not unlikely that the problem is in Salem, I would rather bet on upstream packages like GDAL or PyProj, which have a long history of not working properly on windows. For example, if I take your code an run it on a relatively recent environment (MyBinder link), I have no issue.
No problem- I figure the more information I provide up front the less time we both have to waste getting up to speed.
The problem could definitely be with one of the downstream packages. I looked into PyProj and GDAL on Windows and see what you mean about a long history of issues. I'd say there's a decent chance your assessment is correct and the issue is with one of them. I can test it in a Linux environment later today, but I'm locked into Windows on the computer I've been working on recently. The binder you linked to isn't loading for me, but I'll try that again later too.
I ran the corrected snippet and had the same error.
I installed all my packages with pip. GDAL was installed from a wheel, but the rest were automatically downloaded from PyPI.
I was able to find a workaround using img = g.get_vardata() and plotting with matplotlib (plt.img_show(img,origin = 'upper', extent = [lat, lat, long, long])). This works well enough for what I am doing but isn't a perfect solution.
I've been following the "plot over Google map" tutorial in an attempt to plot some data points over a satellite image. However, the Map function fails every time. My code will run until Map is called, hangs for 30-45 seconds, then I get a pop up window that says "Python has stopped working. A problem has caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." I'm running Python 3.7.3 on Windows 10 64 bit. Based on how easy is is to reproduce the error, where it occurs in the code, and the error itself I believe it is an issues with Salem on Windows/Python 3.7 rather than a flaw in my code.
This is the function I am trying to run:
This example is the simplest version I have been able to reproduce the issue with. g was taken from the example given in salem.Grid documentation:
Here's a list of all my installed packages:
The text was updated successfully, but these errors were encountered: