Pearson correlation and GIS


Do these two variables have a correlation?. To answer this important question first of all we have to know that only if it’s a linear relationship and there are no outliers we can take advantage of Mr Pearson’s correlation statiscal tool.

If i love chocolate, does this mean i have tendency of being chuby? or on the other hand there’s no relationship at all. Let’s figure it out.

For this particular occasion, input data XY are two DTM heights, my guess is the following: if correlation is too big, i may deduce they’re not independent products and one might been created from the other, in other words, we might have tried to cheat and we are using a different source that the one we have stated… In GIS sometimes things are not exactly as expected and there’s need to be assertive and making a plan for discovering this minor issues.




Let’s start from the beginning, if source 1 is the same as source 2, the correlation would be perfect, is this correct?. The answer is yes. r (Person correlation) would be = 1. So yes, if this was asking about chocolate and fleshiness this would be 100% right but this hardly or never happens in real life (direct and no other explanation or variable interaction… why is always so0o complicated?).



With real data, you would not expect to get values of r of exactly -1, 0, or 1. For example, the data for spousal ages (white couples) has an r of 0.97. Don’t ask me where i got this weird source (well, just in case:


If i fill source 2 with a random number, the correlation would be almost none accordingly (in this case r=0.17)


Now if we see the diagram of the first two sources and we get the Pearson correlation coefficient (r=0.24) which means the correlation is very weak.


But that was only a very small part of the table (only 30 iterations), so if i do the same calculation out of the +13,000 iterations i really need, i get these figures (by the way, theres no need to use such a complicated formula above, you can use this one in EXCEL: =PEARSON(A1:An;B1:Bn))


So the correlation now its moderate, which makes me deduct at least the sources seem different and i’d need more clues to think my customer might have tried to actually cheat me using the same source for both datasets.


r=1, correlation is PERFECT

0.75<r<1, correlation is STRONG

0.5<r<0.75, correlation is MODERATE

0.25<r<0.5, correlation is WEAK

<0.25, almost NO correlation, both variables are hardy related

I hope you guys have found this post interesting,
looking forward to hear where could you use it and/or your feedback,


Alberto Concejal

Comparing France Meteo and Spain Meteo from the visualization point of view


After living in France for four years i have to tell i am always aware of Meteo information on TV (well, i live in Brittany, i guess this makes sense!). It was the same in Spain or anywhere else in the world where i had lived and the reason why is i have always loved Meteo and statistiques, mostly after working as an aerial surveying photographer in the late nineties… but that’s another history.

Weather forecast its quantitative data that distributes spatially, meaning every single spot will have a different figure, even if it’s separated no more than 1 mm, at least in theory. So the question is: as its impossible showing predictions for every single square mm of the area of interest, we need to estimate them using different models. Still if we point anywhere at the map we should know if the icon or figure applies or not to the spot i want to know about.

Let’s make it easier to understand, lets use images!!!

First of all, i know its difficult but it’s important, please don’t have into account Meteo news are presented (in this particular case) by Anaïs BAYDEMIR, which is a beautiful TV journalist at France 2… Let’s not focus on this (but if you happen to want to know more about her i hereby copy a couple of links to both wikipedia and youtube:


Having said that, le’s take a look the way this is shown in Spain (TVE 2014). Well, again let’s not focus on the guy’s grey suit but…







Information it’s kind of OK but what happens if we want to know about a spot in the middle of two icons?. Is the partly cloud icon which applies to my place or it’s the ‘sun and flies’ one?. How can i be sure of the forecast if i live in this this big region in the SW of Spain?…






On the other hand let’s focus on Anaïs_Baydemir, ops, meaning let’s focus on the way France 2 shows this information:


Every single square mm is perfectly defined, if we want to know the forecast in a particular place we know the icon that corresponds to the spot and we don’t have to guess…


I know it’s kind of nothing too important, mostly if introduced this saucy way but think about it, wouldn’t you prefer to read Meteo this way? (again i’m not asking if you prefer the way the french beauty is showing the info compared to the way the spanish guy does, that’s completely irrelevant… right?)

MSc GIS and Meteo fan

Remote Sensing, Photogrammetry, Lidar and Landuse IGN Spain



A few more lines for leting you know again that i passed this other course just now in Instituto Geográfico of Spain (IGN).

Remote Sensing, Photogrammetry, Lidar and Landuse, a comprehensive 40h update on relevant information i need tu use on a daily basis. This ‘update’ helps me to better understand what i am working with and this way, being able to properly describe it for my daily analysis,

Advanced Thematic Cartography IGN Spain



A few lines for leting you know i passed this course last year 2013 in Instituto Geográfico of Spain (IGN). Spatial analysis, Spatial stats, proper simbolization, data mining and geovisualization. A very interesting 40h online course that helps me on a daily basis to be able to show geodata in a more professional way.

Because we normally need to deepen our geodata without making too complex to understand the result of our analysis.

HTML High resolution DTM visualization using Quantum GIS (Qgis)


This QGIS Plugin, Qgis2threejs, exports terrain data, map canvas image and vector data to your web browser!!


All you have to do is opening the DTM in Qgis (2.4.0 Chugiak), go to plugins library and install Qgis2threejs.


Once its installed you will see this icon on screen iconand you will need to clic on it.


Then choosing the parameters of the visualization and voilá!!

I have used a 5m DTM which source was LIDAR so the quality is very good


Hope you guys like it. Feedback would be greatly appreciated.

Alberto Concejal
MSc GIS and Quality Control
albertoconcejal [at]

DTM from SRTM? Let’s compare sources using RMSE (Root Mean Square Error) and a gaussian kernell density map


I guess we all can make a DTM out of many sources but SRTM is one of the most common ones, right?. Then let’s learn from this very simple approach how close we are from the SRTM raw data.

  1. Selecting a not very big representative area to be able to handle it,
  2. exporting raster to polygon (from SRTM 3 arcsec/90m) dataset 1
  3. exporting raster to polygon 30m (our DTM dataset) dataset 2
  4. exporting to POIs 30m (our DTM dataset) dataset 2b
  5. Spatial join POIs dataset 2b vs dataset 1
  6. RMSE
  7. visualizing delta using a density map/gaussian kernell +appropriate symbolization

In yellow we see theres a full correspondence between SRTM and our DTM dataset and in blue there’s a ‘hole’ and in red there’s a ‘mountain’, this means it’s in here where the shift is more important.

This way we can highlight if sources are OK.

It’s simple but it works. How do you like it?. Please feel free to send some feedbak.
(Software used: ArcGIS 10.1, Global Mapper 13.2)

Alberto Concejal


density maps parameters


Spatial join between both DTM datasets


Density map for highlighting differences between both datasets (ours and SRTM’s)


RMSE. It’s not too big so there’s need to visualize to find potential bizarre spots


bizarre DTM heights

La geografía española (con minúsculas)


Aquí la ‘convesación’ via twitter con el presentador de TVE Jacob Petrus. Me quejé de que se mencionara dentro de una frase, como tantas veces hemos oído, en radio y televisión, la expresión ‘La geografía española…’ refiriéndose a España en general. Lo que me indignó fue que Jacob Petrus es Geógrafo además de presentador generalista (y meteorólogo según pone en su CV) y como tal, según mi punto de vista, ha de ser precavido con la semántica y el significado de las cosas.

Allá por el año 1993, en la primera clase del primer día de carrera mis profesores Fernando Molinero y Maite Ortega (cada uno de ellos, en clases diferentes) mencionaron el hecho de que a menudo se usa la frase hecha ‘la geografía española…’ para hablar de La península o España, es decir, un lugar, sin embargo a ellos no les parecía correcto el uso dado que la Geografía (con mayúsculas) es una ciencia y como tal debe entenderse.

De acuerdo con sus palabras la RAE (Real Academia de la Lengua Española) dice:


(Territorio, paisaje. Usado también en sentido figurado). Pero si lo que se pretente es hacer una analogía, en este caso no sería a mi juicio correcto dado que la misma palabra tiene un significado quantitativa (ordinal) y qualitativamente (ciencia vs lugar) superior. En todo caso, queda a la interpretación particular.

Otros Geógrafos, también presentadores de televisión y meteorólogos como Florenci Rey jamás osaron utilizar tal expresión.

Claramente es una frase usada con ninguna maldad, con ganas de describir algo se dice ‘en toda la geografía española ocurre tal o tal fenómeno’ pero el efecto secundario de esas palabras es que se puede pensar que el todo LA GEOGRAFÍA es la parte EL LUGAR y de tal manera algo grande se convierte en algo pequeño.

La Geografía ya es de por sí una ciencia algo denostada por otras como la Arquitectura, la Biología, la meterología, la Topografía, el Urbanismo, la Física, y tantas otras. A lo largo de los años me he dado cuenta que no se comprendía claramente qué es ser un Geógrafo y qué es la Geografía, que éramos los que hacíamos de todo sin estar especializados en nada, de hecho cuando empecé a estudiar no había otro destino que la enseñanza o las oposiciones pero afortunadamente ahora, con la aparición del GIS y todo lo asciado a la geolocalización, eso ha cambiado notablemente.

La Geografía según yo la entendí era la ciencia de la interrelación de el hombre con el medio y hace falta la figura de un profesional que comprenda de manera global todas esas interacciones, es ahí donde llegamos los Geógrafos.

Más de 20 años han pasado desde ese día y he visto casi a diario cómo se ha usado la expresión por gente que no sabía y no tenía por qué saber la importancia de una simple frase, pero llegada la oportunidad de manifestarse usando Twitter y hablando directamente con la persona referida (Jacob Petrus) he creído conveniente hacerlo.

No obstante he de agradecer que al menos me haya contestado, cosa que habla bién de él.


Actualización: No sólo me ha contestado sino me ha asegurado que tendrá en cuenta mi anotación.


Me pone contento este grado de interactividad y rapidez de feedback. De nuevo Gracias Jacob!


‘Reality Checks’, also called ‘Ground Truth Tests’


Comparing all kind of Geodata (i.e 3D Buildings, DTM, DHM, DSM, Land Use, vectors,…) to background sources as Google Earth/ Bing, available sources from the country we are working on or WMS available sources, etc.


Figuring out if the data requested and we want to deliver is consistent enough compared to the so called “Truth”. Some of these checks are visual/manual, some others are more automated/analytic, Preparing ad-hoc reports using Photoshop macros to explain/flag/highlight etc. also videos, PPTs, specific ‘White Papers’ and any other way of facilitating the comprehension of the potential issues.

RSME comparing LIDAR data with a third party’s 3D dataset


I would like to share with you an easy analysis i have been working in the last days. I had a vector dataset of buildings and i knew how high they were (there was a field called ‘AGL’ or Above Ground Level) and a LIDAR 2m resolution dataset over the city of London. My aim was comparing both sources, understanding LIDAR data was the actual reality (or a closer version to it) and my source of 3D buildings was the dataset i needed to deliver to my customer…  Te actual height of those 3D buildings had been extracted using stereo photogrammetry methods. I also needed to focus on residential data, so heights below 15m… So make it easy. The question was:

How accurate is my dataset of residential buildings over London?. Which is the RMSE measuring them both?

I used Global Mapper v.13.2 (b062012) and ArcGIS 10.0 (b3200)

This is the 2m resolution LIDAR data provided by


I also needed to get a layer of points out of this dataset so i used Global Mapper and went to Files/Export elevation grid format and choose ASCII as the format.LIDAR-06

This is the layer of buildings and their AGL as label

I flagged those residential buildings

and using ArcGIS i performed a Spatial Analysis using Arctoolbox/Spatial analysis to join the Lidar heights in ASCII format and the residential heights… to be able to measure the difference between both datasets

this way i got a new vector layer which table contained both elevation fields (Lidar and my 3D buildings)

As you can see, i added a new field in ArcGis using table/add field and added ‘compare’ and SQL [“AGL”- “ELEVATION”]

then i measured it visually using a density grid in Global Mapper. Create density Grid.

And finally measured the RMSE by opening the table in excell format and usign the actual formula for extracting RSME values:

= SQRT(SUMSQ(M1:Mn)/COUNTA(M1:Mn)) —> Note this formula is only valid for this case. You’d need to update Mx values using yours:-)


Wow! a very high value. Does this value corresponds to our accuracy figures? Yes? No?.

Now it’s the time for decission makers to bring into action!


And what about some geostatistical analysis. I performed this using North East Trends in ArcGis. We can see from West to East there’s no variation  but we can see it increases the error the further the south…


So this is the area concentrating the higher differences comparing both datasets.

Hope you liked the analysis, if so…share!!!!




Finally got my QCQA European certification


Hi guys,

Just wanted to share with you I finally got my European certification in QCQA.

I struggled for two years to find some time for studying (It’s complicated when you have a full time job and you’re a father) but I finally made it.



Get every new post delivered to your Inbox.