The-Python-Graph-Gallery icon indicating copy to clipboard operation
The-Python-Graph-Gallery copied to clipboard

bug on #300

Open holtzy opened this issue 3 years ago • 0 comments

Reference: https://github.com/holtzy/The-Python-Graph-Gallery/blob/master/src/notebooks/300-draw-a-connection-line.ipynb

ERROR: GeodError: inv_intermediate: npts and del_s are mutually exclusive, only one of them must be != 0.

This is happening, because when compiling, there are equal points being compiled, and therefore there is no possibility of plotting the line that interconnects the points. As the image below: image.png

Solution suggestion.

Loop on every pair of cities to add the connection

for startIndex, startRow in df.iterrows(): for endIndex in range(startIndex, len(df.index)): endRow = df.iloc[endIndex] if startRow.city == endRow.city: pass else: m.drawgreatcircle(startRow.lon, startRow.lat, endRow.lon, endRow.lat, linewidth=1, color='#69b3a2');

Hope this helps.

holtzy avatar Feb 08 '22 00:02 holtzy