drawing the GPS data on the map

Jeff,
sorry I am bothering you with my postings :slight_smile:

Maybe I am missing something, but your way looks too complicated to
me....

below code works for me. BUT!!!: I just wonder, why meridians are not
plotted symmetrically to the vertical axis. Because of that it will be
a little bit more difficult to adjust (calibrate) my map (picture)
properly. Try to run the code without an image (as it is) and
you will see it.

Anyway, if you think the following code is fundamentally correct, I
can post my experiences how to scan the paper map and how to
"calibrate" scanned picture, so it can be shown with the Basemap
coordinates properly.

Petr

路路路

=======================================
from matplotlib.toolkits.basemap import Basemap
from pylab import *

m = Basemap(llcrnrlon=14.,llcrnrlat=50,urcrnrlon=16.,urcrnrlat=51.,\
聽聽聽聽聽聽聽聽聽聽聽聽resolution='c',area_thresh=10.,projection='tmerc',\
聽聽聽聽聽聽聽聽聽聽聽聽lat_0=50.,lon_0=15.)

##import Image
##ima=Image.open('/root/Desktop/native_nslu2/sejmout0006.jpg')
##ima1=ima.transform((1545,1730),Image.QUAD, (0,209,0,1940,1535,1938,1530,207))
##im = m.imshow(ima1)

# draw parallels
delat = 0.2
circles = arange(50.,51.,delat)
m.drawparallels(circles,labels=[1,0,0,0],fontsize=10)

# draw meridians
delon = 0.25
meridians = arange(14,16,delon)
m.drawmeridians(meridians,labels=[0,0,1,0],fontsize=10)
title('Transverse Mercator Projection')
# print 'plotting Transverse Mercator example, close plot window to proceed ...'
show()

Petr Jakes wrote:

below code works for me. BUT!!!: I just wonder, why meridians are not
plotted symmetrically to the vertical axis. Because of that it will be
a little bit more difficult to adjust (calibrate) my map (picture)
properly. Try to run the code without an image (as it is) and
you will see it.

Petr:

I don't see the problem. Do you expect the meridians to be vertical lines? They won't be for a transverse mercator projection - they would be for a regular mercator projection. What map projection does you scanned map use?

BTW: every time I reply to you your email bounces.

-Jeff

路路路

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Petr Jakes wrote:

below code works for me. BUT!!!: I just wonder, why meridians are not
plotted symmetrically to the vertical axis. Because of that it will be
a little bit more difficult to adjust (calibrate) my map (picture)
properly. Try to run the code without an image (as it is) and
you will see it.

Petr:

I don't see the problem. Do you expect the meridians to be vertical
lines? They won't be for a transverse mercator projection - they would
be for a regular mercator projection. What map projection does you
scanned map use?

BTW: every time I reply to you your email bounces.

-Jeff

Jeff,

IMHO 15th meridian has to be (according to the Basemap settings in the
code) parallel to the vertical sides of the picture (it is!) and the
direction to the left side and to the right side has to be the same
(it is not)!

So the picture is not! vertically symmetric (it is obvious if you
check the top right and the top left corner of the picture in the
attachment for example). There you can see the left most meridian (14)
starts in the bottom left corner and goes up (slightly right). So I
expect the right most meridian (16) to start in the bottom right
corner and go up (slightly left). But.... :slight_smile:

My map uses Transverse Mercator projection, the Lat. of origin is 50N
and the Long. of origin is 15E.

Petr

PS: this is the first time I have got reply from you directly to my mail box as
well. Nothing wrong with our mail server for a long time :slight_smile: Maybe some
Internet mystery :))))) Or just wrong 'reply to' address.....

image.png

Petr wrote:

Petr:

I don't see the problem. Do you expect the meridians to be vertical lines? They won't be for a transverse mercator projection - they would
be for a regular mercator projection. What map projection does you scanned map use?

BTW: every time I reply to you your email bounces.

-Jeff

Jeff,

IMHO 15th meridian has to be (according to the Basemap settings in the
code) parallel to the vertical sides of the picture (it is!)

OK, I follow you so far.

and the
direction to the left side and to the right side has to be the same
(it is not)!

now you lost me.

So the picture is not! vertically symmetric (it is obvious if you
check the top right and the top left corner of the picture in the
attachment for example). There you can see the left most meridian (14)
starts in the bottom left corner and goes up (slightly right). So I
expect the right most meridian (16) to start in the bottom right
corner and go up (slightly left). But.... :slight_smile:

The top right corner of the map is 16 degrees east - so the meridian starts there and then goes slightly east and off the map. That's why you don't see it. The 14 degree meridian starts at the lower left corner and bends slight east into the map region - so you can actually see it on the map. I see nothing wrong. You probably want the lower right corner to be at 16 degrees, not the upper right.

My map uses Transverse Mercator projection, the Lat. of origin is 50N
and the Long. of origin is 15E.

OK. You've defined the projection correctly then, but what do you want the lower left and upper right corners of the map to be?

-Jeff

路路路

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

---SNIP---

I see nothing wrong. You probably want the lower right
corner to be at 16 degrees, not the upper right.

Yes exactly, I would like to have the lower right corner to be at 16
degrees.

I can see the intersection points of parallel 50 with the meridians 14
and 16 and of the parallel 51 with the meridian 15 on the scanned
image of the map. Than I can (using some graphic editing software,
GIMP for example) find (determine) which pixels are representing these
int. points and cut the needed rectangle off the image (from the GIMP,
or directly in the code using the image "transform" method). This is
the way how to calibrate the picture (or how to set up the same
rectangle area on the picture and on the Basemap projection).

Petr

路路路

My map uses Transverse Mercator projection, the Lat. of origin is 50N
and the Long. of origin is 15E.

OK. You've defined the projection correctly then, but what do you want
the lower left and upper right corners of the map to be?

-Jeff