FOSS4G 2015 – Seoul

Last week I had the privilege to attend the main osgeo conference: the FOSS4G. This time it took place on Seoul, Korea. Exotic place I strongly recommend to visit, but better to focus on non-cultural surprises on this post.

It’s impossible to write everything on a single blog post, as it was impossible to assist to all the interesting parallel threads that run on those short five days. But let me guide you through my steps so I can share part of my experience until we get access to the full videos of that awesome week.

First there were the workshops. I have to confess something: my first options for workshops were cancelled. But it doesn’t matter, as I had problems deciding on first place. So, I started with the WS02 workshop:

Exploring the Sensor Observation Service Standard Enhanced by IstSOS Special Features

Let me summarize it: if you want to work with sensors, take a very close look at IstSOS. Combining PostGIS, Python, GDAL and Apache you get not only a complete sensor service, but a complete sensor data management system. Easy to use, easy to install, easy to everything!

IstSOS UI

Quality Assurance is integrated on IstSOS to make sure the sensor doesn’t go mad. This process are sometimes done asynchronously to conflate your own sensor data with other sources. It doesn’t just return a basic boolean, but a statistic value of confidence based on previous data.

Another interesting feature is the virtual sensors, which allows you to create your “own” “sensors” based on data from real physical sensors. Useful to conflate data and offer it on a unique endpoint as sensor.

As if this workshop wasn’t good enough, we got some real arduino and sensors to play with them.

arduino

Once we finished this amazing workshop, I went to assist Florent Gravin on the GeoNetwork 3 workshop in the afternoon:

geonetwork-workshop

WS08 Build your own data portal using GeoNetwork 3

Besides some Windows issues (surprise!), I think that the workshop was very successful. Assistants not only built their own user interface style for GeoNetwork, but asked us about advanced features and how to implement them.

geonetwork-workshop2

As Florent said: “We are the experts of GeoNetwork, so if you have any questions, it is now or never.” And we had questions asked.

Jet-lagged day finished after this workshop. So we went to the hotel to try to rest a bit more and start with renewed strength the following day, which I started with:

WS19 Beyond GeoServer Basics

If you already run a GeoServer, most of this workshop is already known to you. But if you don’t… bad you missed it! There were a lot of fancy features to play with, like regexp on parameters for sql layers (surprised that very few knew what regexp meant!).

And, of course, WPS already useful in production now. You can even use WPS inside SLD definitions!

After refreshing knowledge on GeoServer, I went for the last workshop:

WS21 OpenSource 3D GIS

Yes, you are right, 3D GIS has too much hype right now. But Oslandia did a great job on this workshop. If you don’t have experience with 3D, I strongly advise you to try to follow the workshop, posted on github.

workshop-3d

We even had some docker introduction. And the second day was finished, but we still had energy to went for the last one. Or some more beers:

last-one

I was already on the first slot of the FOSS4G conference, during the Opening Ceremony, when I first noticed that we talked too much about open instead of free.

openopeness

Besides that, Venkatesh made very clear that we need more Geo4All, specially on developing countries.

Very interesting the national SDI of Korea presentation about the workflow of open source. While I don’t fully agree with their vision, it is always refreshing to see new perspectives on this subject. Maybe we should make more clear that free software can have a professional customer support as good as any closed source software. Probably even better in most cases, as there are more companies that can offer it.

Now the conference divided on so many threads at the same time that it was impossible to follow them all. QGIS (new useful plugins to develop) and MapServer (now faster than ever) before lunch and the sensor and crowdsourcing session after lunch. There, between the ISA server for indoor spatial data, Apache Spark, Ontologies and CartoDB, we presented Cobweb. The day couldn’t finish without a very productive and promising BOFH session about crowdsourcing… and more!

Thursday was a hard day: jet lag started to go away, but taking #geobeers every night does not help much.

Alysa Wright started with a cool presentation about why and how did she start on the spatial world. We should never forget that, as a community, we come from very different places and perspectives. And still, we share a common view about freedom.

On the last session of the day, I learned about OpenDroneMap. I couldn’t stop asking myself why didn’t I knew about this incredible project before. Where drone software is even more awesome than the drone hardware.

Finally, Paul Ramsey talked about sustainability of free and open software and why we should care about who maintains it.

After the keynote, more social drinks with lots of fun:

Last day of conference is here. Friday tastes bitterweet. And not because of the food! María Brovelli starts with a keynote about crowdsourcing and VGI and how they can change our community. Because even if we don’t deal directly with the data, the software is also affected by all this.         The next keynote was from Marco Hugentobler, talking about the qGis community from a developer’s perspective. Because, yes, “developers are human and not everyone is aware of that”. What a surprise! In any case, never trust someone with the “expert” label, just trust the community.           After the coffee break, I attended a very instructive presentation from Henrik Lund Pedersen about caching fresh data. Is it possible to have a cached and updated server for GIS data?

During lunch we had some lightning random talks and I couldn’t stop myself. Please, use free and not open:

Jody Garnett talked about documentation and why we should be very careful when writing it: not only to help advanced developers but also to not scare newbies. Never use the word “easy”, for example. If you use it and the reader don’t find it easy, he will go away to look for something easier for him. And maybe the original documentation was easy, it’s just that it hasn’t been updated with new features.

Then we had another Cobweb session on the main grand ballroom, this time by Panos, talking about the mobile part of the framework.

And FOSS4G was finishing fast! But not before our president Jeff gave his vision about OsGeo and where we should focus on. Build community is the key. And shaking hands with people wearing suits.

On top of all the final party, GeoGatos gave the first Most Innovative Developer Award. We hope to repeat it year after year encouraging developers in osgeo software.

Before finishing this post, I want to say a very big thank you to all the sponsors. Without them, this is not possible.

See you next year in Bonn!

Published first in GeoGatos.

Jornadas SIG Libre Girona VII

Las Jornadas SIG Libre de Girona han girado en torno a servicios cloud y datos abiertos.

Almost all the plenary talks touched topisc like smart citizens, open data, crowd data, crowd sourcing,… It is quite clear this is an emerging subject that we are going to use more and more. But, is this really a business market or is this just something to research and contribute to the community?

Malcolm Bain – IdLawPartners

“Open core, dual licensing, master subscription, commercial open source product specialists – mucha jerga para hablar de cómo hacer dinero con Open source: Hablemos de sus aspectos legales”

What makes a software free is not the code: it is the license. And that’s what is important. But Malcolm hasn’t come here to talk about licenses or patents, but about business with free software. We need to find the added value for open software so we are able to sell it. The problem is: this added value has nothing to do with FOSS. FOSS is freaky, geeky, sneaky,… How can we mix this two concepts? Where is the value position?

The added value for FOSS based business is the legal part. Open source license grants you access, modify and distribute the source code, so you can “physically” fix the bugs yourself, get a local IT supplier to support you (or support yourself) and share that support across a community. You can also have your own agenda on the versions you use. There is an unlimited license to use your free software on the life cycle you want, you don’t depend on third parties company’s planning.

And most important: you can check the code you are being sold. No seller can cheat you selling software that doesn’t do what it needs to do.

Strategies to sell free software

There are many strategies to sell free software:

* Dual License: two types of licenses for the same code: private or free.
* Open Core: free core but extensions are payed.
* Subscription strategy: you sell the technical support only.
* Product specialist: revenues from services (maintenance and consulting).
* Consulting services strategy: pure service model.
* Hosted strategy: Saas, cloud.
* Platform providers: for example, openstack hosting.
* Legal services: consulting legal services.

The free software is an investment on the long run, which is something that capitalists investors usually don’t like. That’s why free software is going to win: because there are no capitalists investors that want to get their interests back.

We live in a world that is designed, built and run by Open Source software. Don’t forget it!

Alberto Labarga – NavarraBioMed

“Periodismo de datos y la visualización de datos abiertos”

Alberto works on health and medical services based on free software and free hardware. As a sidenote: he mentioned that all gis software he knew was free, so it looks like we are doing marketing stuff right. He talked about open data and how to display it. Sometimes we focus too much on technology and not on how our users perceive it. Right now, everyone claims to be doing big data visualization, but very few people has real access to big data databases. So, there is a lot of fuzzy smoke on this topic.

From the crowd data perspective, there are many interesting projects like #adoptaUnSenador or #adoptaUnCorrupto, where spanish government obscured PDFs about incomings and wealth of politicians were crowd-parsed. There are other projects, like @jjelosua’s “España en llamas”, which conflates all data about fires in Spain. As this kind of projects appeared, many tools were also developed to help this type of jobs. Transparency comes hand by hand with this projects, like visualizing budget spent on each public administration.

The biggest problem with opendata right now is that there is a lot of public data still not published. And what is published is usually static or not on a useful format. Spain (and Europe) still have to follow UK on this topic and open more data so more apps and usecases can be developed.

He had an amazing presentation where he presented more usecases I can write on a summary here.

Irene Compte – Exploradora y aventurera tecnológica

“Open Smart cities: mitos y realidades”

Irene did an interactive theatre presentation showing his view about how this smartcity concept started and evolved. She has been working on this topic since the very beginning of the concept and that made her have a very close experience.

Victor Olaya – Boundless

“Algunas ideas sobre música, literatura y mapas”

Closing plenaries, Victor Olaya enphasizes the need to do good maps. We have a lot of technical people working on maps, building maps. But, do they have some studies about it? Are they prepared to present data the best way? We assume that all maps are used the same way all across the world. And that we can use almost the same style for all usecases. All this assumptions only complicates things to the user in the end.

Ed Parsons – Google

“Where is the Cathedral and the Bazaar : some musings on openness, ecosystems and bringing geo to the web”

At the end of the day, as a closing plenary, we had Ed Parsons, from Google, who talked about what is his view on future hits on geospatial. Appart from his insistence on using the word “open” instead of “free” or “libre” (they are difficult non-marketable words, he said), there is a very clear position on Google trying to go further on their attempt to control what people do. “Only if you want, the choice to have a mobile phone is yours”, as he clearly states. But is this true? Can someone live on our society without using mobile phones?

For example, Google is working on backpacks to map inside buildings as their streetview cars map cities. This way, they will have more detailed information about where people are and what they do. They claim it is for offering more detailed services. I don’t doubt it but, where is intimacy going? Will new generations know what is to have a private space where they don’t need to pose? Where they can relax because no-one is watching? Are we coming closer to a 1984 Big Brother based on companies instead of Government? Will that may be even worse, even if the company’s motto is “don’t be evil”?

A lot of questions to answer.

Original entry in GeoCat’s blog

Jornadas SIG Libre Girona VII

Estas últimas Jornadas SIG Libre de Girona han girado en torno a servicios cloud y datos abiertos. Desde el apoteósico inicio con las ponencias plenarias, con parte destacada de Sergi Morales (ExportosenTI), el resto de las charlas han ido rodando todas en el mismo tema. Algunas quizás un poco más críticas, como F. Puga desde CartoLab cuando nos pidió que no olvidáramos que no todo el mundo tiene acceso global a internet, y que muchos millones de personas, las cuales no tienen nuestro nivel tecnológico, también tienen necesidades GIS.

Esto es lo que significa cloud en zonas en desarrollo. #siglibre7 #firstworldproblems

Otra gran cuestión que se ha levantado en estas jornadas ha sido, de la mano de Malcolm Bain, cuales son los límites legales de los servicios de almacenamiento de datos en la nube, qué podemos esperar y exigir y hasta qué punto, desde la perspectiva del proveedor de servicios, tenemos que ofrecer un mínimo de nivel de servicio. Resulta sin duda sorprendente aprender que algunos de los contratos que aceptamos en servicios muy conocidos (como correo electrónico web o hosting) son, sencillamente, ilegales.

La batalla del software libre ya está ganada, ahora queda la batalla de la libertad y privacidad de los datos.

También ha resultado una delicia ver el enfrentamiento dialéctico entre varios de los ponentes, como cuando Javier de la Torre (Cartodb) arremetió contra OGC o las IDE. Sin duda un tema que, aunque no coincido completamente con su opinión, es algo a debatir y mejorar. ¿Deberían intentar los IDE hacerse más amigables para acercarse al usuario o es suficiente con ser un repositorio de datos?

El jueves por la tarde, Geocat tuvo sesión doble entre varias charlas muy centradas en los metadatos y su importancia en los IDE. Primero presentamos rápidamente quiénes éramos y qué hacíamos, centrándonos sobre todo en GeoNetwork y Bridge, mencionando también nuestro futuro GeoCat Live. Y justo antes de terminar el día, un taller de 30 minutos para presentar GeoNetwork, justo antes de dar paso a la primera reunión de geoinquietos nacionales.

Es difícil resumir en un sólo artículo toda la tremenda dimensión alcanzada en estas jornadas. Mucho optimismo, muchas ganas de seguir trabajando y, sobre todo, la certeza de que estamos en el camino correcto, apoyando el software y los datos libres, centrándonos en la parte social de nuestro trabajo. El viernes, casi para finalizar, Javier Sánchez orientó la recta final de las jornadas hacia este tema, hablando de las empresas sociales, las cuales no sólo tienen una cuenta de resultados económica sino también social.

En resumen, las Jornadas SIG Libre Girona son sin duda el Evento SIG(en mayúsculas) que cualquier hispano hablante debería tener en cuenta si quiere estar al día de las últimas novedades.The main theme of this Jornadas SIG Libre de Girona has been cloud services and open data. Since the apotheosic beginning, with an outstanding speech of Sergi Morales (ExportosenTI), the rest of the conference has been running around the same theme. Some of them maybe more critical, like the one of F. Puga from CartoLab when he asked us not to forget undevelopment zones where not everyone has internet access and millions  of people, which doesn’t have our tech level, also have GIS needs.

This is what cloud means on undevelopment countries. #siglibre7 #firstworldproblems

Anotheer interesting theme of this conference came by the hand of Malcolm Bain, who told  us about the legal limits of data cloud services, and what can we expect and demand and to what extent, from the cloud service provider, we have to offer a minimum service level. It is undoubtely surprising to learn that some of the contracts we accept on very well known services (like web mail or hosting) are, in fact, ilegal.

The battle of free software is ended, now we have to battle on freedom and privacy of data.

It has also been delightful to see the debate between some speakers, like when Javier de la Torre (Cartodbtalked against OGC or the government repositories of data. Undoubtfully a theme which, although I don’t fully agree, needs some discussion and improvement. Should government repositories of data become more useer friendly or should they remain just as repository of data?

On thursday evening, Geocat had a double session between speeches very focused on metadata and the importance of governmment spatial portals. We first focused mostly on GeoNetwork and Bridge, talking also about our future GeoCat Live. and, just before ending  the day, a workshop of 30 minutes to present GeoNetwork, which has followed by the first national meeting of geoinquietos.

It is hard to summarize in only one article all the huge dimension reached on this conference. A lot of optimism, willing to keep working and, most of all, the certainty that we are on the right path, helping free software and free data, focusing on the social part of our work. On Friday, almost to finish, Javier Sánchez oriened the end of the conference to this theme, talking about social companies, who have not only an economic result but also a social one.

In the end the Jornadas SIG Libre Girona are undoubtely the GIS Event (capital letters) to which every spanish speaker should take into account to be in contact with latest GIS news.

Original article here.

¿Qué es GeoNetwork?

GeoNetwork es una aplicación web que permite mantener un catálogo de datos referenciados geográficamente. Esto es, un portal con buscador que permite visualizar metadatos combinándolos con mapas. Sigue estrictamente los diferentes estándares para datos, desde Inspire hasta OGC. Esto ha propiciado su gran expansión en muchas organizaciones, como el geoportal suizo  o el brasileño,pasando por el neozelandés.

Se despliega sobre un contenedor de aplicaciones java (como tomcat o jetty), funcionando sobre el framework Jeeves . Jeeves se basa en transformaciones XSLT que permiten un desarrollo rápido y sencillo (a la vez que potente) de interfaces tanto para un usuario como para máquinas (XML).  Esto hace que los datos en GeoNetwork sean fácilmente accesibles por diferentes plataformas.

De Emergya a GeoCat

Estas últimas semanas han sido caóticas y como ejercicio para asentar y echar el ancla, me gustaría hacer un breve resúmen de mi cambio de trabajo.

is principales motivaciones para dejar de trabajar en  Emergya, a pesar de la enorme calidad humana y técnica que tiene, fueron tres:

  • The current situation in Spain doesn’t allow us to perform interesting projects, forcing companies to focus only on survival, with all the friction and discomfort that this generates.
  • Las reto . Y esta, creo que es la motivación principal. El enorme reto que supone el cambio de contexto a una nueva empresa, con una forma de trabajar tan parecida y a la vez tan diferente. Necesitaba ver mundo, aprender, beber de otras fuentes. Cinco años en Emergya son maravillosos, pero empezaba a sentir que se me estaba quedando pequeña. ¿Pez grande en lago pequeño o pez pequeño en el mar? ¿Pez grande en lago pequeño o pez pequeño en el mar?
  • GeoGatos¿Alguien podría rechazar la posibilidad de convertirse en un geo-gato? ¿Puede haber un paso más allá de esto? ¿Se puede no querer trabajar con metagatos?(metadata, impossible to translate)?

Por supuesto que no ha sido una decisión fácil. Para mi Emergya es, y siempre será, esa empresa que me acogió con todo el cariño del mundo y me ayudó a dar mis primeros pasos en el mundo laboral, fortaleciendo mi convencimiento de que el software libre es el camino correcto. Lo quiera o no, Emergya forma parte de mi y el título de "ex-emergyana" ya no me lo quita nadie. Espero no olvidarme nunca del camino de vuelta a la gatera.

Pero era una paso que tenía que dar. Así que me lancé a la piscina, y tras una semana de toma de contacto, ya no tengo ninguna duda de que ha sido la decisión correcta. GeoCat tiene un equipo de trabajo impresionante y acogedor y su línea de desarrollo es realmente fascinante. Así que supongo que a partir de ahora me escucharéis menos de cálculo de rutas y más de metadatos e interoperabilidad (que no quiere decir que vaya a abandonar el routing, por supuesto, una tiene su corazoncito).

Próxima parada: GeoNetwork.

GNU Health – El GNU más solidario

Muchas veces me encuentro por casualidad con tecnologías o aplicaciones libres que sorprenden agradablemente no sólo por su uso sino por el impacto que pueden llegar a causar. Este es el caso de GNU-Solidario, o GNU Health, recientemente premiado por la FSF por su aportación solidaria. Básicamente consiste en una plataforma libre para gestionar datos médicos, tales como expedientes de pacientes, resultados de pruebas, diagnósticos,… Aunque no es un tema que domine (ni mucho menos), podemos comprobar en la misma página web que la plataforma está muy avanzada y ya están colaborando con Naciones Unidas para utilizarla allá donde el software libre se hace indispensable.

GNU Health

Sin embargo, lo más sorprendente de todo es que este proyecto ha salido de la mente de un joven informático canario, Luis Falcón. Y es que muchas veces no tenemos que buscar lejos para encontrar talento capaz de cambiar el mundo.Sometimes I find technologies and free software that pleasantly surprise me, not only because of its use, but because the impact it can cause. This is the case of GNU Solidario, or GNU Health, recently awarded by the FSF for their solidary contribution. It’s basically a free platform for managing medical data such as patient records, test results, diagnoses, … Although I am not an expert, we can check on the same website that the platform is well advanced and that they are already working with the United Nations to use this free software wherever it is essential.

However, most surprising of all is that this project was born inside a mind of a young computer scientist from Canarias, Luis Falcon. Often, you don’t have to look far away  to find talent that can change the world.

Anotaciones y Decoradores en Java

Las anotaciones o decoradores sobre el código se han vuelto muy comunes en los últimos tiempos. Permiten al programador añadir información útil extra ya sea para comentar mejor el código o para modificar la forma de compilar/ejecutar una clase concreta. Son una extensión a Java para permitir la programación orientada a aspectos.

Las anotaciones pueden ser de tres tipos, según el momento en el que son visibles:

Información para el Compilador

Estas anotaciones permiten al compilador indicar si debe o no omitir errores y warnings o qué hacer con ellos. A nada que se haya trabajado con un IDE Java (como eclipse) se habrán utilizado este tipo de anotaciones de forma natural, por ejemplo usando @Override sobre una función para indicar que está sobreescribiendo una declaración definida en una clase padre. Esta anotación es completamente opcional,  pero permite tanto al compilador como al desarrollador comprobar que efectivamente se está sobreescribiendo una funcionalidad existente por herencia.

Por ejemplo:

public class Parent {     
    public void do(){
        System.out.println("Parent");
     }
}

public class Son extends Parent{     
    usando @Override
    public void do(){
        System.out.println("Son");
     }
}
Anotaciones en Tiempo de Compilación y Despliegue

Estas anotaciones permiten añadir información extra al compilador para que modifique la forma en la que se genera el código de los ficheros .class. Puede servir para modificar clases (añadiendo o modificando funcionalidad respecto a lo descrito en el código fuente), generar clases nuevas (por ejemplo en base a un fichero descriptor), etc...

Estas anotaciones sólo serán visibles en este punto, es decir, no se escribirán sobre los .class y por tanto no se podrán consultar en tiempo de ejecución.

Anotaciones en Tiempo de Ejecución

Estas anotaciones pueden ser consultadas en tiempo de ejecución y funcionan de forma muy parecida a como se utilizaría una interfaz.

Veamos directamente un ejemplo de cómo crear una anotación Runtime y cómo se puede utilizar. La anotación MyAnnotation se podrá aplicar a elementos de tipo field, es decir, a atributos de una clase:

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
     public @interface MyAnnotation {
}

Ahora podemos crear una clase que esté anotada con esta anotación:

public class myObject
 {
 @MyAnnotation
 public String field;
 }

De esta forma, en cualquier otra parte del código, podemos comprobar mediante reflexión si un objeto tiene un campo marcado con la anotación:

Class res = objeto.getClass();
for (Field f : res.getFields()) {
     if (f.isAnnotationPresent(MyAnnotation.class)) {
          System.out.println("OK");
      }
}

Más información:

Notes on the GeoServer Workshop

These are the notes I took on the GeoServer workshop at the last gvSIG Conference.

Data Directory

It is important to change the settings of the geoserver_data_dir in the web.xml file to keep the data each time you restart the application container (like Tomcat). It is also good to check out the other settings as it contains interesting facts such as the type of projections to be used or the size of the cache. There are configurable data on the fly and data not configurable on the fly.

Let’s try adding some data sources to generate the layers. To add a shapefile, you have to copy the file in the same physical server machine. To include the shapefile in GeoServer, look for the option of adding a new shapefile datastore type. If you use the location “file: data /…” you use a relative uri to geoserver. You can also search using the “Browse” and use absolute paths.

Warning: Do not you give permission to any user on the configuration interface because they can see all the physical hard disk in this type of dialog.

Memory Mapped Buffers

It is best to use memory mapped buffers (unless you use Windows) if you have enough RAM, then you will avoid continuous access to physical disk. Also, it is best to reproject from native to declared projection. If the shapefile is very big, calculate the bounding box take some time. This does not happen in real databases where spatial indexes.

GeoServer allows you to insert watermarks in your data (for example to use OpenStreetMap).

When you use database connections, you should check the validate connection option, because you never know when the connection is going to crash.

GeoWebCache

GeoWebCache allows, on the latest version of GeoServer, to set up easily which layers will be cached.

You can use data which varies through time, for example for storms and hurricanes. On the database table, you will have a column for time. You can also use elevation data, but then you have to use it with Google Earth. The interesting thing is that, once you have the data, some hipothetical free visor can be used to support it…

Apuntes del taller de GvSIG 2.0

Estos son los apuntes que tomé sobre gvSIG 2.0 en las últimas Jornadas GvSIG.

Pre-requisitos:

  • Java
  • Eclipse
  • Ant (opcional)
  • Maven (opcional)
  • gvSIG (esto es recursivo :))

La principal ventaja de gvSIG 2.0 es que puedes crear un plugin sin saber cómo funciona gvSIG ni tener que compilarlo. Tenemos una instalación de gvSIG que despliega unos binarios que genera el workspace.. Pero no tenemos que tocar los fuentes de gvSIG, salvo que algo no funcione (bugs) o haya que añadir alguna funcionalidad al núcleo. Preferentemente no lo toques, mejor consulta con los desarrolladores del núcleo de gvSIG y ellos intentarán encargarse.

Con el binario de gvSIG viene un asistente para ejecutarlo y que cree un workspace de eclipse con una plantilla prefijada que deja todo configurado para compilar nuestra extensión. También incorpora un asistente para generar instalables fácilmente. Estos asistentes son accesibles mediante la aplicación gvSIG, en el menú de la aplicación.

Org.gvsig.tools is the basic infrastructure library to develop plugins.The main functionality is focused on the registration of extension points, utilities to separate API, implementations, SPI (service provider), and monitoring tasks (which in version 1.0 used to freeze the application).This library also supports events, persistence, etc …

Una librería es un jar. Cuando nuestra aplicación levante el jar, org.gvsig.tools prepara dicha librería y la inicializa dentro del core de gvSIG. Las clases dentro de la librería implementan la interfaz Library (AbstractLibrary).

Los managers (PluginsManager) son el punto de entrada a las funcionalidades. Son como factorías (singletons) (al menos uno por librería) que levanta instancias de las funcionalidades incluídas dentro de la librería. También guarda la configuración del módulo.

Los locators (PluginsLocator) permiten registrar implementaciones de managers. Nos permiten recuperar la implementación de manager de un API en concreto. "Dame el manager de esta librería."

Un plugin es una pieza que aporta una funcionalidad: botones y barras de herramientas, opciones de menús, proveedores de datos y tipos de documentos. Andami no ha evolucionado demasiado desde la versión gvSIG 1.x. Andami es el framework de los plugins.

El plugin siempre tendrá al menos dos ficheros:

  • config.xml que indica las clases que implementan el plugin, las dependencias y los menús
  • package.info que indica la versión, el nombre, el build,... del plugin.

Una extensión (IExtension) es un conjunto de herramientas asociadas a un plugin metidas en una barra de herramientas o menú y funcionan de forma conjunta. Un grupo de plugins, vaya. La extensión que implemente ExclusiveUIExtension especifica qué herramientas están o no visibles en cada momento, sin tener que tocar código en el core de gvSIG.

Para crear un nuevo plugin, hacemos uso de la herramienta del menú de generación de plugins disponible en la versión de desarrollo de gvSIG. Esto genera el workspace automáticamente e instala dicho plugin en el gvSIG desde el que hemos generado el plugin. Si no tienes versión de desarrollo, tendrás que compilar gvSIG de los fuentes..

Conviene ir haciéndolo mientras se leen estos apuntes o puedes perderte.

El plugin constará de dos proyectos maven: org.gvsig.plugin y org.gvsig.plugin.app. org.gvsig.plugin aportará la funcionalidad de la librería de forma independiente de gvSIG (la lógica de negocio). Puede tener dependencias de librerías de gvSIG, pero debería poder funcionar sin tener que abrir la aplicación. Es decir, no requiere nada de Andami, por ejemplo. En org.gvsig.plugin.app.mainplugin (dentro de org.gvsig.plugin.app) tendrá la implementación de dicha funcionalidad dentro de gvSIG.

The “api” packages should contain interfaces and the “impl” packages should contain implementations.

En principio el workspace está preparado para trabajar con eclipse e importar los proyectos con el plugin de maven. Si hemos cogido una plantilla adecuada al generar los fuentes del plugin, tendremos prácticamente todo el trabajo hecho (salvo la lógica de negocio exacta de nuestro plugin).

Es importante hacerse un proyecto java para probar nuestro plugin, con su propio main, sin tener que arrancar gvSIG. Así mismo se recomienda que en la parte de librería haya tests unitarios. Es decir, podemos hacer una aplicación con toda la potencia de gvSIG, pero sin utilizar gvSIG en sí, es decir, como si gvSIG fuera una potente librería gis. Conclusión: si lo hacemos bien, podríamos incluso utilizar nuestro plugin de gvSIG en otra aplicación... como GoFleet.

Cada plugin tiene su propio instalador, que también se genera con un asistente dentro de la aplicación gvSIG.