google tiles and kml

redbeardredbeard Global Mapper UserPosts: 279Trusted User
edited October 2009 in Technical Support
I have a question for some web developer inclined people...

I have a directory of (google) tiles I generated from global mapper. Is there a way I can create a network link from the html..ie have Google Earth read and display the tiles on the web server. That way you could be looking at the same data in a map or Google Earth.

If so, I think that might be a nice feature request, that is when you make the tiles and it creates a html file that you edit, have an option to create a kml file that you would then edit in a similar way.

Thanks!

-Mike

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2009
    Mike,

    There is not currently a way to do this, but I can add it to the todo list. You can of course just do a separate KML super-overlay export if you want, although it would duplicate the space.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited October 2009
    Yeah, I was looking for a way to give users (of a webmap site) multiple ways of viewing the data. I just wondered to myself if it was possible to create a kml file that would then allow google earth to access the same tiles as what would be displayed on a web site. I just thought it would be nice to let someone see the site and have a choice to view either in the browser or in google earth (or event the google earth plugin I guess).

    I was looking at not duplicating the data...that is access the same tiles and not just another set of tiles for the same area. Is this doable? (I don't know kml well enough).
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2009
    This is certainly doable. You would just have a KML file with a <GroundOverlay> element for each Google Maps tile that lists the lat/lon bounds of each tile. It wouldn't be particularly accurate at very low zoom levels because the Google Maps tiles are projected using the Mercator projection but the KML files specify only lat/lon boundaries, but when zoomed in beyond the outermost several zoom levels the innaccuracy caused by this should be minimal.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • redbeardredbeard Global Mapper User Posts: 279Trusted User
    edited October 2009
    Yeah, the accuracy thing is somewhat a concern for the zoomed in layers. How zoomed in are we talking, like the last 5 levels or so? For the bigger stuff, it shouldn't matter.

    I know there is some js code for projections, http://proj4js.org/

    It does seem that they have been able to get it to work for rasters, as mentioned http://openlayers.org/blog/2009/10/26/openlayers-at-the-foss4g-code-sprint/

    So it seems maybe create the kmz layer, then for a website, use the google earth plugin, or rename the kmz as a zip and expand the contents, and use this directory, and use the proj4js and have it reproject the rasters for the website on the fly.

    But I can't comment on how quickly that would work.

    ideas, ideas, ideas....hmmm.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2009
    I would say the last 10 or so zoom levels would be ok as the individual tiles are relatively small and the top and bottom of the image would be perfect. The horizontal strip at the middle of a tile would be the source of maximum error. The problem would be much more pronounced near the poles for tiles covering a large area of the earth. The closer you are to the equator the less of an issue the projection difference would cause.

    If you have something to add Google Maps tiles to a KML file, it would be very easy to create a KML file that referenced all of the Google Maps tiles and provided the lat/lon corners for them.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.