4

I'm trying to get a weather image to display on Google Maps, however in my comparisons to others it seems as if my image is slightly to small (Vertically). I'm wondering what I might have done wrong in the process.

I have my latitude / Longitude coordinates

$NWlat = '50.406626367301044';
$NWlng = '-127.620375523875420';
$SElat = '21.652538062803';
$SElng = '-66.517937876818';

And when converting them to pixels on Google maps (at zoom level 5) I get:

1191,2763 and 2582,3591 

Taking the differences between these I get:

1391 x 828 

I take my image which is currently sized at 3400x1600 and force it into that size above (doing this in Photoshop). I then use the Crazed Monkey tile cutter to cut the tiles and place them on the map. Things are slightly not vertical enough.

CMD:

googletilecutter.sh -z 5 -o 5 -t 4,10 -p 167,203

See to two images below, and how the graphics are slightly not as elongated from wrong to right. (take note of location of the blue around Kentucky and over by rhode island)

I would greatly appreciate any help with this as I've been struggling now for a bit.

Wrong:

alt text

Right:

alt text

GforGIS
  • 3,126
  • 3
  • 19
  • 38
Petrogad
  • 143
  • 5

3 Answers3

1

I can say that lat long would not produce an exact square except in certain projections (I think Molliewiede ?sp). Latitude will be shortened as you get closer to the poles.

Brad Nesom
  • 17,412
  • 2
  • 42
  • 68
  • ah, so my calculation of just doing a - off each point is not accurate. I need to do another calc to find the actual image size? – Petrogad Dec 21 '10 at 04:34
  • Google Maps Coordinates > http://code.google.com/apis/maps/documentation/javascript/v2/overlays.html all tiles need to be 256 x 256 pixels – Mapperz Dec 21 '10 at 14:54
  • not sure where your original is coming from or what reference points you have. take a look at this. http://gis.stackexchange.com/questions/4555/real-world-example-of-affine-transform/4565#4565 This one refers to correcting the projection in vector data but might help with crs theory. http://gis.stackexchange.com/questions/4544/projected-maps-dont-overlap/4547#4547 – Brad Nesom Dec 21 '10 at 14:58
  • @Mapperz: all tiles are in 256 X 256 images. – Petrogad Dec 21 '10 at 15:18
1

You could use something like http://www.maptiler.org/ instead which works very well.

Peter
  • 621
  • 3
  • 3
  • I've tried this a handful of times, however I'm given errors each time I try and open the particular image with it. – Petrogad Dec 27 '10 at 18:01
1

I think that you need to know which projection was used for your weather image. If it doesn't correspond to the projection used by google maps ("web mercator", EPSG:3857), the weather image needs to be reprojected.

I have never tried the Crazed Monkey tile cutter, but I assume that it can't reproject the image. My suggestion:

  1. Find out the projection used for your weather image
  2. Reproject it with the help of gdalwarp
  3. Split it with the help of Crazed Monkey tile cutter

If you can't find any information about the orignal projection of the weather image, you might try to split it using Map Cruncher. But only if you have just a few images because you will have to click manually a few corresponding points on the the weather map and on satellite images...

NB:

Glorfindel
  • 1,096
  • 2
  • 9
  • 14
Name
  • 890
  • 1
  • 6
  • 13
  • I ended up using Map Cruncher; and adding about 100 calculated points across the map. This gave the app more data in order to render the infromation correctly. – Petrogad Feb 15 '11 at 16:41