GeoNetwork from Scratch II : Attack of the IDEs

We have already seen how to compile and run a basic GeoNetwork instance. Although we know that real developers will probably skip this step too, for new developers in GeoNetwork, it will be relief to have an IDE to work with. I know that many GeoNetwork developers use NetBeans or Intellij but as I am used to work with Eclipse, that’s what we are going to explore on this post.

First of all: Eclipse has better support for Maven projects on each version. So, to avoid headaches, just download the latest eclipse available.Eclipse has many installer tutorials, so I won’t stop here explaining how to run eclipse. I will just assume you know how to do it.

To run GeoNetwork from eclipse is very very easy. Just right click on the Package Explorer view to import -> As Maven Project over the folder you already had cloned on the last post:

Import As Maven Project
Import As Maven Project
Import As Maven Project
Import As Maven Project

There is still something Eclipse does not support right about GeoNetwork: we have a classes folder that Eclipse tends to misconfigure. So, go to that folder, right click and remove as source folder. To do this, go to the “web-app” project and right click on src/main/webapp/WEB-INF/classes. Select Build Path > Remove From BuildPath.

Then, completely remove the folder from the source code. Don’t worry, it’s git, you can recover it later. You can also do this by right-clicking on the folder and selecting Delete. Yes, you are sure you want to delete folder “classes“.

Now, update as maven project right clicking on the project “web-app” and selecting Maven > Update Project …

update project

Once this finishes, you can restore the folder we previously removed. Go to the “web-app” project, right click on src/main/webapp/WEB-INF and select Replace With >HEAD Revision. Yes, you are sure.

Congratulations! You are ready to use Eclipse to modify GeoNetwork.

But wait, how do we run GeoNetwork inside Eclipse to be able to debug?

We have several approaches here. Remember the jetty command to run GeoNetwork from the console? It is available also inside Eclipse (right click on web-app and Run As > Maven Build) and you can add some maven variables to be able to run in parallel a debug watch to debug your code. You can also set up a Tomcat server inside Eclipse and run GeoNetwork from it. This second option is more easy for beginners, so that’s what we are going to do now.

First, you have to create a Tomcat server inside Eclipse. So, search for the “Servers” tab and right click on it. Select New > Server. You will see a windows offering different types of servers. We will select the Tomcat v.7.0 Server one. You will probably won’t have any server runtime environment configured for it, but you can “Add…” a new one. There are many tutorials[1][2] for this, so we won’t stop here.

On the following window, you can select which applications to run. Obviously, you choose the one called “web-app” and Finish.

Now, you will have a new Server on the Servers tab. select it (left-click) and click on the green arrow just on the top of that tab. You will see on the “Console” tab all the output of GeoNetwork starting up. Once it is started, you can enter GeoNetwork the same way as before, using http://localhost:8080/geonetwork

Have fun customizing GeoNetwork!

JIIDE 2015 – Sevilla

Last week I attended the JIIDE conference, that took place here in Sevilla. This is the official conference for both portuguese and spanish spatial data infraestructures. The presentations were diverse and rich in content and there were working groups for INSPIRE and conformance running in parallel.

You could see some trends in how SDIs are evolving through all the Iberian Peninsula. Geograma explained to us that hiding data behind paywalls or registering sites makes us less compliant. But on the other hand, maybe it doesn’t matter because as José Fernández (IECA) showed us, data is going more and more open and free. Why should someone pay for data generated on a public administration? It has already been payed by taxes and a paywall is just another stone on the way of generating added value to the data. And above all this, every country has a different payment and access system, so it is virtually impossible to query the same data on different countries easily, which was one of the goals for INSPIRE.

Transparency, interoperability, quality, conflation,… keywords through all the conference. As an example of conflation and reusability, IECA was created by the union of the geospatial information department and the statistics department of the government of Andalucía. This allows them to localize statistic data that, once the privacy details are removed, can be easily shared. Creative Commons is the main license for all their products.

On a statal level, now we have the CNIG, who unifies all the data from Spain and allows us to download (or buy) data. Here, the map is not the central issue, but just another product you can use.

And still, there are many things INSPIRE has yet to solve. There are a lot of abstract requirements the nodes are not sure how to solve. All data has to have quality metadata associated to it, but, is there any quality minimum required for the data? How close the scales should be? What precision? And above all, how are the different public administrations supposed to handle all this without specific financing from Europe? Or what is worst: why do Europe ignore the conclusions reached by several working groups on different countries? Why reinventing the wheel?

There was another subject running through all the conference: why do SDIs have less users than open data portals? Is it because the type of data? Is it because we don’t focus on usability? Why do they choose data from worse quality (or not government certified)? It looks like we have to work more on usability and user interaction.

Should SDI focus on developing applications around the data? Or should they just focus on being a data repository third party companies can query to generate added value? Should we merge with the opendata portals even if that means lose part of the focus on spatial data?

Javier López, explained the problem about persistent identifiers. We have to assume that the entities generating data will not be persistent. But their data should survive those entities and we should be able to trace back who created the data and who have been maintaining it. How to achieve this without being too dependent on some specific platform? How to create a standard that survives through the years?

We also had the visit of Rodrigo Barriga Vargas (IPGH) who told us about GeoSUR, an initiative to create, conform and share quality spatial data in America. He told us how lucky we are to have INSPIRE as a gubernamental initiative to force us to follow standards.

But the best thing was to see how GeoNetwork is being used more and more and we have happy users advocating that it is the only SDI that makes sense.

GeoNetwork From Scratch I : The Phantom Catalog

GeoNetwork never has been an easy software to work with. But specially after the 3.0 version release, many things have changed. On this series of posts we will try to help new developers start with GeoNetwork.

The source code of GeoNetwork is available on a public repository on Github. This means that you can clone, fork and propose pushes of your custom changes. If you are not familiar with repositories of code or git, you should check this quick manual.

GeoNetwork is built using maven version 3+. It is written on Java and requires version 7 or more. It works both with OpenJDK or the Oracle version.You will need git and maven installed on your local machine to work. There are several ways to install this on your local machine; for example if you have a Debian based OS (like Ubuntu), you can install them with just this command:

sudo apt-get install maven git

Make sure you installed maven version 3!!

$ mvn –version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
Maven home: ….

Remember that this will also install java on your system. You can check that the version is the right one with the following command:

java -version

So, the very first step once you have your environment set up is clone the GeoNetwork repository on your local machine. That can be done on the command line using the following command inside an empty folder where the source code will be populated:

cd yourEmptyFolder
git clone
git submodule init
git submodule update

As you can see, all the source code shown on github is also available on your local machine now.

The source code of GeoNetwork is split on several smaller maven projects. To run GeoNetwork, you have to build all of them and run the project named “web“. If you are familiar to maven, you will probably have guessed that you have to run a package install command on the root folder of GeoNetwork source code. But if you try that, maven will warn you that for building GeoNetwork you need more memory than the default memory provided to maven. This means, you will have to export the maven options to increase the memory like this:

export MAVEN_OPTS=”-Xmx512M -XX:MaxPermSize=256M”

At this point we are not interested in running the tests, so you can skip them using the parameter “-DskipTests”:

mvn package install -DskipTests

At the end of this build (which can take long, depending on your network connection, as it has many third party libraries), you will see something like this:

[INFO] ————————————————————————
[INFO] Reactor Summary:
[INFO] GeoNetwork opensource ……………………….. SUCCESS [ 3.111 s]
[INFO] common utils ……………………………….. SUCCESS [ 13.678 s]
[INFO] Caching xslt module …………………………. SUCCESS [ 7.607 s]
[INFO] ArcSDE module (dummy-api) ……………………. SUCCESS [ 7.860 s]
[INFO] GeoNetwork domain …………………………… SUCCESS [ 33.785 s]
[INFO] Oaipmh modules ……………………………… SUCCESS [ 0.833 s]
[INFO] GeoNetwork Events …………………………… SUCCESS [ 0.654 s]
[INFO] GeoNetwork schema plugins ……………………. SUCCESS [ 4.646 s]
[INFO] GeoNetwork schema plugins core ……………….. SUCCESS [ 5.338 s]
[INFO] GeoNetwork schema plugin for ISO19139/119 standards SUCCESS [ 8.432 s]
[INFO] GeoNetwork core …………………………….. SUCCESS [ 16.304 s]
[INFO] GeoNetwork schema plugin for Dublin Core records retrieved by CSW SUCCESS [ 5.031 s]
[INFO] GeoNetwork schema plugin for Dublin Core standard . SUCCESS [ 8.419 s]
[INFO] GeoNetwork schema plugin for ISO19110 standard …. SUCCESS [ 3.627 s]
[INFO] GeoNetwork CSW server ……………………….. SUCCESS [ 5.546 s]
[INFO] GeoNetwork harvesters ……………………….. SUCCESS [ 3.888 s]
[INFO] GeoNetwork health monitor ……………………. SUCCESS [ 2.489 s]
[INFO] GeoNetwork services …………………………. SUCCESS [ 8.597 s]
[INFO] Geonetwork Web Resources 4 Java ………………. SUCCESS [ 5.261 s]
[INFO] Cobweb Customizations ……………………….. SUCCESS [ 4.226 s]
[INFO] GeoNetwork INSPIRE Atom ……………………… SUCCESS [ 3.990 s]
[INFO] Tests for schema plugins …………………….. SUCCESS [ 2.334 s]
[INFO] GeoNetwork user interface module ……………… SUCCESS [ 35.356 s]
[INFO] JS API and Service documentation ……………… SUCCESS [ 21.203 s]
[INFO] GeoNetwork web client module …………………. SUCCESS [ 47.484 s]
[INFO] GeoNetwork Web module ……………………….. SUCCESS [ 48.490 s]
[INFO] GeoNetwork E2E Javascript Tests ………………. SUCCESS [ 1.645 s]
[INFO] ————————————————————————
[INFO] ————————————————————————
[INFO] Total time: 02:19 min (Wall Clock)
[INFO] Finished at: 2015-07-17T10:36:43+01:00
[INFO] Final Memory: 232M/441M
[INFO] ————————————————————————

This will generate a war file you can use in any Java Application Container (server) like Tomcat on web/target/geonetwork.war

Congratulations! You are ready to run GeoNetwork. To do this, just go to the web folder and run jetty in there:

cd web; mvn jetty:run

After jetty starts, you can see your running GeoNetwork by opening a browser and enter to http://localhost:8080/geonetwork

Continue in Attack of the IDEs

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.