google maps projection

Ken Lord kenlord at GMAIL.COM
Thu Oct 13 14:43:45 EDT 2005


Of course MapServer works well as a WMS source for Google Earth ...

Place the code below into a xxx.kml file.

To modify it for your own datasets:

--Change the link the in the <href> tag to a known working WMS source,
such as your own MapServer setup set to output in the projection that
Google Earth uses.

--Make sure your .map file has useful extents set, and a good map
size, this will control what part of the world is shown in Google
Earth and at what resolution.

--Change the <LookAt> so that when you load the layer in Google Earth,
it will automatically pan to the right view (or dont, and just pan to
the right spot manually)

--Set the coordinates below <Latlongbox  > to match the extents of the
image used in your .map file

**** Very Important --> The URL used in the <href> tag ... all &
symbols must be changed to &amp;  as they have been in my example.

In my example, google earth pulls data from my mapserver WMS.  My
mapserver WMS is retrieving data from the Terra weather satellite WMS
(updates daily) and the Modis forest fire WMS (updates twice a day),
combining them into one image, then sending it back to Google Earth. I
made it to watch the recent hurricanes.

It is not dynamic, it loads once and doesnt refresh unless you remove
the layer and add it again or restart Google Earth ... but there are
ways of making that happen.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<GroundOverlay>
  <description>BGC MapServer Test</description>
  <name>Large-scale overlay on terrain</name>
  <LookAt>
    <longitude>-86</longitude>
    <latitude>25</latitude>
    <range>3000000</range>
    <tilt>15</tilt>
    <heading>0</heading>
  </LookAt>
  <visibility>1</visibility>
  <Icon>
<href>http://www.bgcengineering.info/MapTest/Scripts/mapserv.exe?map_web_template=JAVA_template.html&amp;mode=map&amp;imgext=-101+20+-71+35&amp;map=c%3A%2FProjects%2FDemos%2FMapTest%2Fweb%2FMapServer%2FMapTest.map&amp;program=..%2FScripts%2Fmapserv.exe&amp;map_web_imagepath=c%3A%2FProjects%2FDemos%2FMapTest%2Fweb%2Ftemp%2F&amp;map_web_imageurl=%2FDemos%2FMapTest%2Fweb%2Ftemp%2F&amp;mapext=-101+20+-71+35&amp;layer=Terra_WeatherSat_WMS&amp;layer=Forest_Fires_Live</href>
  <refreshInverval>300</refreshInverval>
  </Icon>
  <LatLonBox id="khLatLonBox751">
    <north>35</north>
    <south>20</south>
    <east>-71</east>
    <west>-101</west>
    <rotation>0</rotation>
  </LatLonBox>
</GroundOverlay>
</kml>

Cheers,
Ken Lord
Vancouver BC


On 10/12/05, Allan Doyle <adoyle at eogeo.org> wrote:
> Some info about Google and WMS:
>
> http://radar.oreilly.com/archives/2005/07/where_20_first.html
>
> http://www.directionsmag.com/press.releases/index.php?
> duty=Show&id=12107&trv=1&PRSID=3c94e78bac0131f7633e8e42344f3adc
>
> There is a chance that using Google maps as a true WMS layer violates
> the terms of service of the Google maps license key. c.f. http://
> gmerge.2ni.net/
>
> Google for google wms...
>
>     Allan
>
> On Oct 12, 2005, at 16:28, Chip Taylor wrote:
>
> > Ok, you have piqued my interest!  Had to go out and look at
> > Google's map
> > API.  Way cool stuff.  Anyway, how do you overlay a Mapserver map
> > on top of
> > a Google map?
> >
> >
> >> -----Original Message-----
> >> From: UMN MapServer Users List [mailto:MAPSERVER-
> >> USERS at LISTS.UMN.EDU] On
> >> Behalf Of John Hagstrand
> >> Sent: Wednesday, October 12, 2005 11:25 AM
> >> To: MAPSERVER-USERS at LISTS.UMN.EDU
> >> Subject: [UMN_MAPSERVER-USERS] google maps projection
> >>
> >> Hello,
> >>
> >> I am using MapServer to generate maps that I then overlay on top
> >> of Google
> >> Maps.  To get them to match up, I need to get the projections to
> >> match.
> >>
> >> I've been told the following:
> >> Google Maps uses the Mercator projection and the WGS 84 geodetic
> >> datum.
> >> The
> >> projection standard latitude is 0, and the projection standard
> >> longitude
> >> is
> >> -90.
> >>
> >> How can I translate that to a MapServer Projection block?
> >>
> >> Thanks
> >> John
> >>
> >> ___________________
> >> John Hagstrand
> >> www.MapTeam.com
> >> 847 838 5371
> >>
> >
> >
>
> --
> Allan Doyle
> +1.781.433.2695
> adoyle at eogeo.org
>



More information about the mapserver-users mailing list