question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ortho projection w/ limits crashes

See original GitHub issue

Basemap documentation states that ortho projection can take ll/ur crnr limits. The following code seems like it should work (mpl 1.4.0), but does not:

from mpl_toolkits.basemap import Basemap
m = Basemap(projection='ortho',lon_0=0,lat_0=0,llcrnrlat=-10,llcrnrlon=-10,urcrnrlat=10,urcrnrlon=10)

Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-98fbf042abb9> in <module>()
----> 1 m = Basemap(projection='ortho',lon_0=0,lat_0=0,llcrnrlat=-10,llcrnrlon=-10,urcrnrlat=10,urcrnrlon=10)

/Users/mankoff/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.pyc in __init__(self, llcrnrlon, llcrnrlat, urcrnrlon, urcrnrlat, llcrnrx, llcrnry, urcrnrx, urcrnry, width, height, projection, resolution, area_thresh, rsphere, ellps, lat_ts, lat_1, lat_2, lat_0, lon_0, lon_1, lon_2, o_lon_p, o_lat_p, k_0, no_rot, suppress_ticks, satellite_height, boundinglat, fix_aspect, anchor, celestial, round, epsg, ax)
   1032         self.area_thresh = area_thresh
   1033         # define map boundary polygon (in lat/lon coordinates)
-> 1034         blons, blats, self._boundarypolyll, self._boundarypolyxy = self._getmapboundary()
   1035         self.boundarylats = blats
   1036         self.boundarylons = blons

/Users/mankoff/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.pyc in _getmapboundary(self)
   1464             # circular region.
   1465             thetas = np.linspace(0.,2.*np.pi,2*nx*ny)[:-1]
-> 1466             rminor = self._height
   1467             rmajor = self._width
   1468             x = rmajor*np.cos(thetas) + rmajor

AttributeError: 'Basemap' object has no attribute '_height'
> /Users/mankoff/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py(1466)_getmapboundary()
   1465             thetas = np.linspace(0.,2.*np.pi,2*nx*ny)[:-1]
-> 1466             rminor = self._height
   1467             rmajor = self._width

ipdb>

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ImportanceOfBeingErnestcommented, Nov 13, 2017

Can someone please comment on how to obtain lcrnrx,llcrnry,urcrnrx,urcrnry given that I have llcrnrlat=-10,llcrnrlon=-10,urcrnrlat=10,urcrnrlon=10? Usually you may get x,y as x,y = m(lon,lat); however, if you need to know these already when instantiating the Basemap, you cannot use the Basemap to calculate the values to input in its initialisation method.

0reactions
WeatherGodcommented, May 5, 2016

I would like to clean up any documentation bugs soon. Could someone please suggest a revised line? Even better, could someone put together a PR with the documentation correction?

Also, ideally, I would want to produce a better error message in this case, so a suggested error message would be useful, too.

full discloser, I don’t work in ortho projections, so I have no clue what is/isn’t allowed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AutoCAD Plant 3D crashes when creating orthographic views
AutoCAD Plant 3D crashes with a fatal error when creating an orthographic view.
Read more >
Collision Diagrams
Show the path of each vehicle involved in the accident with adequate room for information. ... Reduce speed limit if justified by spot...
Read more >
Orthogonal projection of points in CAD/CAM applications
This paper aims to review methods for computing orthogonal projection of points onto curves and surfaces, which are given in implicit or parametric...
Read more >
Intersection Crashes Among Drivers in Their 60s, 70s, and 80s
roadway/environmental characteristics associated with older drivers' crashes at intersections. For subsets of the two-vehicle crash data within each ...
Read more >
ACCIDENT REGISTER
ACCIDENT REGISTER. FROM. , 20____ TO. , 20____. Date & Hour of Accident. Location of Accident. No. of. Deaths. No. of. Non-Fatal. Injuries....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found