Locally stored and internet maps in Google Earth
Napísal PaloTT   
Nedeľa, 12 December 2010 19:48

Locally stored and internet maps in Google Earth

Locally stored and internet maps in Google Earth

Google Earth provides possibility to display external geographic data, coming from internet or local sources. Network link feature can be used to display raster maps in Google Earth 3D view. We created generic network link processor to display raster map in Google Earth from sources you define.

Note: Local maps or internet map sources have to be stored in Google Maps tiling scheme.

The network link processor usage is simply:

  1. Download this KML file, or copy XML code from example listed below and paste it to local file with .kml extension.

  2. The following XML code in KML format contains example to display Openstreetmap in Google Earth. You can customize it for your needs (e.g. to define different data source) by modifying the colored text.

    <?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://www.opengis.net/kml/2.2">
    <Folder>
    <name>Openstreetmap</name>
    <visibility>1</visibility>
    <open>1</open>
    <description>OSM Mapnik</description>
    <NetworkLink>
    <name>Tiles zoom 13</name>
    <visibility>1</visibility>
    <open>0</open>
    <refreshVisibility>0</refreshVisibility>
    <flyToView>0</flyToView>
    <Link>
    <href>http://www.gpsteam.eu/KML/NetworkLink.php</href>
    <httpQuery>lo=1&amp;zoom=13&amp;tiles=http://(a|b|c).tile.openstreetmap.org/(Z)/(X)/(Y).png</httpQuery>
    <viewRefreshMode>onStop</viewRefreshMode>
    <viewRefreshTime>0</viewRefreshTime>
    </Link>
    </NetworkLink>
    </Folder>
    </kml>

    The fields you can edit:

    • Openstreetmap - layer name in Google Earth

    • OSM Mapnik - layer description in Google Earth

    • 1 - lo (LayerOrder): Layer stacking order. If multiple layers are displayed in Google Earth simultaneously (from one or more KML files), define an unique number for each layer. Layer with higher number is located over a layer with smaller number. Set higher number for transparent layer than for nontransparent one.

    • 13 - zoom: Map zoom level (number 0 - 21 as defined in Google Maps tiling schema). Google Earth will read and display tiles only of this zoom level.

    • http://(a|b|c).tile.openstreetmap.org/(Z)/(X)/(Y).png - tiles: This most important setting defines URL path to internet map source or absolute local path to directory structure with locally stored map tiles. Map tiles have to be organized in Google Maps tile schema standard. Tile coordinates are defined using (Z) , (X) , (Y). Use uppercase letters. If tiles are stored on multiple servers (because of server load balancing), you can use (servername1|servername2|...|servernameX) in the front of URL link just after http://.
      Local path example: D:\mapy\APPS\SAS.Planet100707\cache_gmt\cyclemap\z(Z)\(Y)\(X).png

    KML reference: find it here

  3. Open KML file using Google Earth menu File -> Open... .

  4. To display map from defined source, zoom map to the defined level.
    E.g. if zoom level is set to 13, overlay (tiles from map source) will appear when eye alt is approx. 25km over terrain. For zoom level 15 it is approx. 7km over terrain.

Technical note: When displaying maps from internet, server gpsteam.eu is used only to obtain position data about map tiles of the current Google Earth view (geographic coordinates and tile coordinates X,Y,Z). No other data is sent from gpsteam.eu as answer to Google Earth html requests. Subsequently, Google Earth reads map tiles directly from map source, as is defined in KML file. When displaying locally stored maps, communication with gpsteam.eu is still necessary to obtain geographic and tile coordinates for the current Google Earth view.
Google Earth is sending user-agent information (string "GoogleEarth/version number ..... ") and empty referrer in html requests.
Hint for experts: You can modify Google Earth html requests by configuring web-filtering proxyserver Proxomitron . Google Earth is using proxy settings from Internet Explorer.

Screenshot from Google Earth - OpenPiste map and land shading
OpenPiste map and land shading in Google Earth


Another KML files examples:

example2.kml

Transparent layer with land contours (covering Slovak republic only). KML elements <LookAt> and <flyToView> are used to zoom the view to Snilske sedlo in Mala Fatra. Note: For transparent layers, set appropriate zoom manually to display the layer.

example3.kml

Transparent layer with marked hiking paths from osm.lonvia.de. Empty tiles (covering areas without hiking paths) are not stored on the server. They are missing and Google Earth is displaying red X icon instead. That makes map layer unusable.

example4.kml

Ski map from openpistemap.org with transparent land shading layer.

example5.kml

Cycle map from opencyclemap.org with marked hiking paths transparent layer from wanderreitkarte.de. Transparent layer is generated from two zoom levels (8 a 13) of original map source. According to eye alt activate only one of them.



 

Partnerské fórum

Reklamný prúžok

Poskytovateľ mapových podkladov

Reklamný prúžok