Showing posts with label google earth. Show all posts
Showing posts with label google earth. Show all posts

Tuesday, September 12, 2006

Conector universal de Google Earth a ArcIMS / Universal connector from Google Earth to ArcIMS

Tengo algo que ofreceros gratuitamente: el conector universal de Google Earth a ArcIMS. Es un script al que llamas desde Google Earth con unos determinados parámetros, como el servidor ArcIMS, el servicio de mapa, y las capas que debe mostrar (además de la extensión geográfica, pero de eso se encarga Google Earth), y él se conecta a ArcIMS, pide el mapa, y se lo sirve a Google Earth. ¿Ciencia a ficción? No, pura realidad, y en muy poco código.

Me he basado en los ejemplos que he encontrado por Internet, donde a un script como éste se le llama reflector.

Más en detalle:

Lo primero que debemos investigar es el objeto NetworkLink de la especificación KML. Este objeto permite llamar a un objeto situado en Internet (en mi caso, una página ASP), a la que le pasará un parámetro BBOX, con las coordenadas WGS84 que definen la extensión de mapa que muestra en pantalla.

Así que la estrategia para hacer un script reflector es hacer un script que recoja las coordenadas, y haga una petición a un servidor de mapas concreto. Los ejemplos de Internet se han quedado ahí. Yo me preguntaba, ¿y si en la propia llamada al script del objeto NetworkLink incluyo el servidor y el servicio de mapas como parámetros? Y así lo hice.

A partir de este momento, tengo un conector universal. Puede ser invocado para traducir peticiones de Google Earth a cualquier servidor ArcIMS del mundo.

En el diagrama anterior se muestra la arquitectura de este conector universal; lo que ofrezco es el script reflector, que está ubicado en http://www12.asphost4free.com/ogomez2/GE/arcims_reflector.asp

Este script no funciona así directamente, debe ser invocado desde un objeto NetworkLink dentro de Google Earth.

Para probar cómo funciona, he creado una aplicación que, dada la ruta a un servidor ArcIMS, consulta los servicios de mapa disponibles, y te permite seleccionar las capas que quieres mostrar. Finalmente genera un fichero que deberéis salvar como .KML para poder abrirlo con Google Earth posteriormente. Esta aplicación está disponible en:

http://www12.asphost4free.com/ogomez2/GE/arcims2ge.asp

Este servidor me proporciona alojamiento gratuito junto con soporte a páginas ASP, pero no es muy estable. Si falla, paciencia, volverá a funcionar en un rato.

I have something to offer for free: the Universal connector from Google Earth to ArcIMS. It's a script that can invoked from Google Earth specifying certain parameters, such as the ArcIMS server, the map service, and the layers to show (in addition to the extent of the map, but that's the job of Google Earth); the script connect to the specified ArcIMS server, asks for the map, and makes it available to Google Earth. Science fiction? No, just the reality, and with a few coding in fact.

I based on the examples that can be found over the Internet, where a script like this is called a reflector script. More in detail:

The first thing we should investigate is the NetworkLink object in the KML specification. This object allows remote calls to an object placed over the Internet (in my case, an ASP page); Google Earth will invoke this object specifying the BBOX parameter, what means the extent of the map in WGS84 coordinates.

The main strategy for building a reflector script is collecting these coordinates, and building a map request for the specific map server using those coordinates. The examples over the Internet stopped there, but I wondered, what if I include in the call to the script the map server and the map service as parameters as well? And I made that.

Since that moment, I built an universal connector for adding ArcIMS map services into Google Earth. It can be invoked for translating Google Earth requests to any online ArcIMS server in the world.

The above diagram shows the architecture of this universal connector; what I am offering as the universal connector is the reflector script, located in http://www12.asphost4free.com/ogomez2/GE/arcims_reflector.asp

This script does not work directly, it must be invoked from a NetworkLink object inside Google Earth.

For trying it, I have created an application that allows querying an ArcIMS server, and build a KML file from the selected layers in one service. It will create a file that you should download and rename as .KML, for Google Earth to open it. This application is available under:
http://www12.asphost4free.com/ogomez2/GE/arcims2ge.asp

This server provides me with free hosting and ASP pages support, but it's not very stable. If it fails, please be patient, it will work again in a few minutes time.

Publicar datos SIG en Google Earth / Publishing GIS data in Google Earth

Un tema recurrente en las administraciones públicas a todos los niveles (local, regional, nacional y europea) es cómo publicar datos en Google Earth.

Lo primero que se te ocurre es: "claro, contacto con Google, y les digo que alojen y sirvan mis datos"; desconozco si Google tiene la capacidad y el interés en hacer esto, pero se me antoja un poco excesivo si tenemos en cuenta el número de distintas administraciones públicas que existen y de datos dispares. En cualquier caso, añadir tantas fuentes de información harán que el usuario nunca encuentre la nuestra ;-)

Por tanto, tal vez la mejor opción sea poner en nuestra página web algo que permita visualizar los datos geográficos en Google Earth. Según esta estrategia, hay dos opciones:


  • Crear un fichero con los datos geográficos dentro de él, de manera que el usuario se descarga todo y lo visualiza en Google Earth; esto es válido para datos poco pesados, y hay soluciones comerciales y gratuitas que permiten hacer esto.

  • Proporcionar al usuario con un fichero que permita visualizar desde Google Earth lo que sirvo con mi servidor de mapas; una administración pública que maneja un volumen importante de información geográfica cuenta normalmente con un servidor de mapas con servicios de mapa ya definidos. Es solo cuestión de tener algo para servir estos datos en Google Earth



He construido conectores universales que permiten enlazar servidores de mapas con Google Earth; en realidad hacen algo muy simple: reciben peticiones de Google Earth, y las traducen al servidor de mapas correspondiente.

Tengo construidos un par de ejemplos. El primero que mostraré en mi post siguiente es el conector universal de Google Earth a ArcIMS. El segundo es un conector universal para WMS.

Estos conectores los ofrezco por simple cortesía, pero declino toda responsabilidad sobre su funcionamiento y disponibilidad.



Public administrations at all levels (local, regional, national, and european) dealing with spatial data are wondering one way or another how to publish their spatial data in Google Earth.

The first thing you think about is: "well, I ask Google to publish my GIS data on their servers"; I don't know if Google has the capacity or the interest in doing so, but it looks a bit too much to my eyes considering how many different public administrations exist, with different datasets among them. Anyway, adding that big amount of datasets will make the user to never find our data ;-)

The best option is making something available on our website, that will allow the user viewing our data in Google Earth. There are two different options for doing that:


  • To create a file that Google Earth can open, that contains all the data to be shown; this is valid for light weight data, and there are some commercial and non-commercial solutions that will allow you to do this.

  • To provide the user with a file that will allow the user overlay my map services on Google Earth; a public administration that deals with a big amount of spatial data will probably have a map server with map services set up. It's only a matter od having something that allows overlaying this data on Google Earth



I have built universal connectors that allow hooking up map servers to Google Earth; actually they do something very simple: they accept requests from Google Earth, and translate them into the language of the map server.

I have two examples available. I will show the first one in my next post, the universal connector from Google Earth to ArcIMS. The second one is a universal connector from Google Earth to WMS.

I am offering these connectors as courtesy, but I decline any responsability on their performance and availability.