matplotlib / matplotlib/basemap

Basemap does not respects False Easting or False Northing

Aperta
#288 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
817
Fork
395
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

While creating a basemap from an EPSG code with the x_0 or y_0 (False Easting and False Northing), the Basemap instance does not respect those values. I tried with 'tmerc' projections only because it's of my interest. I leave an example:

Suppose I want to use this EPSG basemap:

# POSGAR 94 / Argentina 1
<22181> +proj=tmerc +lat_0=-90 +lon_0=-72 +k=1 +x_0=1500000 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs  <>

It can be found in "basemap/data/epsg" file.

Then I create the basemap and print its parameters:

from mpl_toolkits.basemap import Basemap

lon_min, lat_min = -75, -45
lon_max, lat_max = -70, -40
bm = Basemap(epsg=22181,
             llcrnrlon=lon_min, llcrnrlat=lat_min,
             urcrnrlon=lon_max, urcrnrlat=lat_max)

print bm.proj4string

I get the following output:
+a=6378137.0 +b=6356752.31425 +k_0=1.0 +y_0=-5012640.49452 +lon_0=-72.0 +proj=tmerc +x_0=236540.642361 +units=m +lat_0=-90.0

As we can see, the Basemap overrides the false easting and false northing information:
+x_0=236540.642361 +y_0=-5012640.49452

It would be great that the Basemap respect those values and even better if they can be passed as arguments while initializing it in the usual way (without using EPSG codes), for example:

bm = Basemap(projection='tmerc',
             lon_0=lon_0, lat_0=lat_0,
             x_0=x_0, y_0=y_0
             llcrnrlon=lon_min, llcrnrlat=lat_min,
             urcrnrlon=lon_max, urcrnrlat=lat_max)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal costruttore Basemap e dalla ricerca EPSG usando la voce per 22181 in basemap/data/epsg; riproduci l’esempio tmerc e verifica come i parametri di proiezione diventano proj4string. Conferma che x_0 e y_0 forniti da EPSG vengano mantenuti e determina come debbano essere gestiti gli argomenti equivalenti del costruttore. Il lavoro è completato quando l’esempio conserva entrambi gli offset falsi e la copertura di regressione li verifica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.