Discussion:
Exact GMT code for projection used in google maps ?
felix.schalck
2009-02-26 19:01:34 UTC
Permalink
Hi,

I'm wondering if it would be possible to rework tiles from google maps
with GMT. Of course, to do that, one must know the exact GMT code of the
projection used by google maps, including zoom factor. Wikipedia says
google uses a "spherical mercator" projection, from wich the code would
be -Jm, i guess. But since google maps are capped at 85.05 latitude, i
guess some correction factor (which i don't know about) might be
necessary. Concerning the actual scale of the different zoom levels of
google maps, i did not found any reliable source yet. I'm working at
zoom level 10 of google maps (local map), and estimations found online
range from 1:20000 to 1:35000 (meters).

So: am I missing something, or is it doable to reproduce a google maps
conform GMT map ?

Thanks for your help,

Felix

To unsubscribe, send the message "signoff gmt-help" to ***@hawaii.edu
Joaquim Luis
2009-02-26 22:33:04 UTC
Permalink
Post by felix.schalck
Hi,
I'm wondering if it would be possible to rework tiles from google maps
with GMT. Of course, to do that, one must know the exact GMT code of the
projection used by google maps, including zoom factor. Wikipedia says
google uses a "spherical mercator" projection, from wich the code would
be -Jm, i guess. But since google maps are capped at 85.05 latitude, i
guess some correction factor (which i don't know about) might be
necessary. Concerning the actual scale of the different zoom levels of
google maps, i did not found any reliable source yet. I'm working at
zoom level 10 of google maps (local map), and estimations found online
range from 1:20000 to 1:35000 (meters).
So: am I missing something, or is it doable to reproduce a google maps
conform GMT map ?
Hi,

I guess it is time for another Mirone commercial.

Google servers store the image tiles in the so called isometric latitude.
(hope not saying a nonsense here as I'm talking from memory)
In that latitude the geogaphic latitude +/-85.05112877980659 converts to +/- 180
So the domain of the google maps is 360 in E-W and also 360 in N-S (isometric lat).
In this projection the pixels are square (each image tile size is actually 512x512).
Furthermore, and that's the beauty of the thing, each tile has encoded the image
coordinates using a Quadtree encoding algorithm. Checking the tile names you'll notice
that they are composed by aparently random sequence of the q r s t letters.

I wont bother you more with this, interested readers can learn more at
http://intepid.com/2005-07-17/21.50/
and
http://intepid.com/2005-07-17/21.50/

Now the commercial. Sometime ago I wrote a (Matlab) code that permits downloading
and mosaicing the right tiles corresponding to a desired region. An interface to
that code is provided in Mirone ("Tools -> Tiling tool"). This tool could be better
as it becomes complicated to operate at higher zooming levels. Its advantage is that
it will present the user with a correctly referenced (in mercator meters) image.
Normally it should be possible to reprojected it right away into geogs for instance,
but there is a annoying bug somewhere. However, saving the image as geotiff and
importing it again will this time permit a correct reprojection (using GDAL).
At any point it is possible to save the image as 3 r,g,b GMT grids and therefore
entering the GMT world. This not at all practical to do directly with the image
tiles because they are in jpeg and the naming encoding needed to be solved.

A final note. Although the Goggle servers are open to anyone to download the image
tiles, they considers illegal to use them on other but their softwares (see terms
of use). So Mirone downloads the image tiles from Microsoft Virtual Earth servers
which behave exactly the same except (and are allowed to use) that MS uses 0 1 2 3
as the base name for the quadtree algorithm.
Actually the Mirone code is written to work also with other (than Ms VE) image servers,
as long as the users provides the right server names and quadtree base name alphabet
but that is not my responsibility.

Joaquim Luis

To unsubscribe, send the message "signoff gmt-help" to ***@hawaii.edu
felix.schalck
2009-02-26 23:01:16 UTC
Permalink
Post by Joaquim Luis
Post by felix.schalck
Hi,
I'm wondering if it would be possible to rework tiles from google
maps with GMT. Of course, to do that, one must know the exact GMT
code of the projection used by google maps, including zoom factor.
Wikipedia says google uses a "spherical mercator" projection, from
wich the code would be -Jm, i guess. But since google maps are capped
at 85.05 latitude, i guess some correction factor (which i don't
know about) might be necessary. Concerning the actual scale of the
different zoom levels of google maps, i did not found any reliable
source yet. I'm working at zoom level 10 of google maps (local map),
and estimations found online range from 1:20000 to 1:35000 (meters).
So: am I missing something, or is it doable to reproduce a google
maps conform GMT map ?
Hi,
I guess it is time for another Mirone commercial.
Google servers store the image tiles in the so called isometric latitude.
(hope not saying a nonsense here as I'm talking from memory)
In that latitude the geogaphic latitude +/-85.05112877980659 converts to +/- 180
So the domain of the google maps is 360 in E-W and also 360 in N-S (isometric lat).
In this projection the pixels are square (each image tile size is actually 512x512).
Furthermore, and that's the beauty of the thing, each tile has encoded the image
coordinates using a Quadtree encoding algorithm. Checking the tile names you'll notice
that they are composed by aparently random sequence of the q r s t letters.
I wont bother you more with this, interested readers can learn more at
http://intepid.com/2005-07-17/21.50/
and
http://intepid.com/2005-07-17/21.50/
Now the commercial. Sometime ago I wrote a (Matlab) code that permits downloading
and mosaicing the right tiles corresponding to a desired region. An interface to
that code is provided in Mirone ("Tools -> Tiling tool"). This tool could be better
as it becomes complicated to operate at higher zooming levels. Its advantage is that
it will present the user with a correctly referenced (in mercator meters) image.
Normally it should be possible to reprojected it right away into geogs for instance,
but there is a annoying bug somewhere. However, saving the image as geotiff and
importing it again will this time permit a correct reprojection (using GDAL).
At any point it is possible to save the image as 3 r,g,b GMT grids and therefore
entering the GMT world. This not at all practical to do directly with the image
tiles because they are in jpeg and the naming encoding needed to be solved.
A final note. Although the Goggle servers are open to anyone to download the image
tiles, they considers illegal to use them on other but their softwares (see terms
of use). So Mirone downloads the image tiles from Microsoft Virtual Earth servers
which behave exactly the same except (and are allowed to use) that MS uses 0 1 2 3
as the base name for the quadtree algorithm.
Actually the Mirone code is written to work also with other (than Ms VE) image servers,
as long as the users provides the right server names and quadtree base name alphabet
but that is not my responsibility.
Joaquim Luis
To unsubscribe, send the message "signoff gmt-help" to
If I understand you correctly, the right question would be to ask myself
if the whole thing does still make sense: your advice would be to
transform data from google maps tiles in GMT compatible grids and than
reproject it. At my zoom level, any sizeable map (I was planning whole
Europe in 1:20000) reprojection would take insane amount of computer
capacity which i don't have. The idea behind using google-map data, was
to overcome that hardware limitation: still working on my topographic
project (mentionned it a few months ago on this mailing list), I finally
discovered www.maps-for-free where the grdraster job is already done:
just download the tiles and paste them together. On top of it, it is
google map compatible data, but not owned by google, so there seem to be
no copyright problem. Unfortunately, the output is very basic, and some
nice additions through an new pscoast layer would have been nice. Well,
looks to me that either i didn't understand what you told to me, or i
will have to go with gimp retouching...

Mirone sounds very intersting to me: open source ? works on linux ?
Perhaps i should give it a try.

Thanks for your help,

Felix

To unsubscribe, send the message "signoff gmt-help" to ***@hawaii.edu
Joaquim Luis
2009-02-26 23:43:33 UTC
Permalink
Post by felix.schalck
If I understand you correctly, the right question would be to ask myself
Well, it is doable but not trivial.
Post by felix.schalck
your advice would be to transform data from google maps tiles in GMT compatible grids and than
reproject it.
Either that or to convert an already projected mosaic.
Post by felix.schalck
At my zoom level, any sizeable map (I was planning whole
Europe in 1:20000) reprojection would take insane amount of computer
capacity which i don't have. The idea behind using google-map data, was
to overcome that hardware limitation: still working on my topographic
project (mentionned it a few months ago on this mailing list),
You won't be able to escape to that (as I now recall you have been warned
the other time) if you pursue the idea of doing a Europe wide map at the
1:20000 scale.
Post by felix.schalck
I finally
just download the tiles and paste them together. On top of it, it is
google map compatible data, but not owned by google, so there seem to be
no copyright problem.
It depends on what you get from there. The "Relief" is SRTM and so is free,
the other are not.
Post by felix.schalck
Unfortunately, the output is very basic, and some
nice additions through an new pscoast layer would have been nice. Well,
looks to me that either i didn't understand what you told to me, or i
will have to go with gimp retouching...
At 1:20000 scale for the whole Europe? Why should it be much less computer intensive?

Joaquim

To unsubscribe, send the message "signoff gmt-help" to ***@hawaii.edu
Loading...