lat_0, lon_0 ignored
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- data-visualization
Direzione di ricerca
Inizia con la configurazione della proiezione Basemap e con i punti di ingresso della conversione delle coordinate, quindi esegui l’esempio fornito di Cylindrical Equal Area con e senza lat_0 e lon_0. Verifica se m(0, 0, inverse=True) rispetta l’origine fornita invece di restituire i limiti inferiori sinistri della mappa; il lavoro è completato quando il comportamento corrisponde ai parametri documentati oppure la limitazione è chiaramente stabilita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am trying to set up Basemap to use a Cylindrical Equal Area projection and to place the origin at a specific lat/lon (this is to match some input x/y data that uses a false easting/northing), but it seems that setting the lat_0 and lon_0 parameters does nothing.
from mpl_toolkits.basemap import Basemap
# Oklahoma bounds
# ('o' = origin at corner of Kingfisher/Logan/Canadian/Oklahoma counties)
lats = {'n': 37.1, 's': 33.6, 'c': 35.5, 'o': 35.726}
lons = {'e': -94.4, 'w': -103.0, 'c': -97.5, 'o': -97.674}
buf = 0.05 # plot buffer size (in degrees)
res = 'c' # map shapes resolution
# projection parameters
proj = 'cea' # cylindrical equal area
lat_ts = lats['c'] # true scale at geographic center
lon_0 = lons['o'] # x=0 at counties corner
lat_0 = lats['o'] # y=0 at counties corner
m = Basemap(projection = proj, lat_ts = lat_ts, resolution = res,
lon_0 = lon_0, lat_0 = lat_0,
urcrnrlon = lons['e'] + buf, urcrnrlat = lats['n'] + buf,
llcrnrlon = lons['w'] - buf, llcrnrlat = lats['s'] - buf*4)
Then checking the origin gives:
In [15]: m(0, 0, inverse=True)
Out[15]: (-103.05000000000305, 33.399999999963455)
...which is the lower-left corner of the map bounds, not the coordinates I gave for lat_0 and lon_0. I get the same output if I leave out lat_0 and lon_0 entirely.
At first, I thought maybe the CEA projection doesn't support these parameters and that I should just shift my data manually, but the docs claim that lat_0 and lon_0 are used by all projections to set the origin.
As a workaround, I can set an offset to get the intended results:
offset = m(lon_0, lat_0)
df['x'], df['y'] = (df.x + offset[0], df.y + offset[1]) # where df is a Pandas dataframe with my data
Note: Originally posted to StackOverflow, where I was encouraged to move the issue here. http://stackoverflow.com/questions/31302427/lat-0-lon-0-ignored-by-basemap
- Lingua principale
- Python
- Stelle
- 817
- Fork
- 395
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di matplotlib/basemap
-
small bug in drawmapscale Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
matplotlib/basemap#368 ·
-
Python 3.14 wheels Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
matplotlib/basemap#652 · 2 commenti · 5 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
matplotlib/basemap#649 · 2 reazioni ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
matplotlib/basemap#646 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
matplotlib/basemap#645 · 2 commenti ·
Tutte le issue di matplotlib/basemap
Issue simili
-
essnmx good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
[Feature] 奇物选择添加优先级 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Giskard-AI/giskard-oss#2840 · 1 commento ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Apertaarea: repo bug perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yeti-platform/yeti#1380 ·