A Cadastre GML file (Catastro is Spain’s land and property register for tax purposes) can be opened in two ways, depending on what you want to see. With a text editor you read its coordinates; with a free mapping program such as QGIS you see the plot drawn and can compare it with the cadastral map. This guide explains both routes, what is inside the file and what to do when the property appears where it should not.
Why does it not open with a double click?
A GML is a text file with the extension .gml, and Windows does not know which program should open it. If you double-click, either nothing happens or you are asked which application to use. Nor is it an image or a document: it is a list of coordinates with a structure that mapping programs know how to interpret.
Before opening it, it helps to be clear about four things:
- What it is. A plot GML contains the polygon of the property, the ordered list of the coordinates of its corners, and the coordinate system. We explain it in what a GML file is.
- Which system it is in. For this area, ETRS89 UTM zone 30 north, code EPSG:25830. If the file does not state another, that is the expected value.
- Whether it is compressed. Some files arrive inside a
.zip. It has to be unzipped first. - That it is not edited by hand. Changing one digit in the coordinates changes the property. If something has to be corrected, the file is regenerated from the survey.
Option 1: read it with a text editor
This is the most direct way to check what the file contains, without installing anything. Windows Notepad will do, although Notepad++ or Visual Studio Code, which are free, show it in colour and are more comfortable.
Right-click the file, choose “Open with” and pick the editor. What you will see is text full of tags between angle brackets. This is a simplified example with illustrative coordinates (a real Cadastre GML has more fields):
<gml:Polygon srsName="urn:ogc:def:crs:EPSG::25830">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">
715320.00 4316780.00
715385.40 4316775.20
715390.10 4316708.60
715322.50 4316712.30
715320.00 4316780.00
</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
What to look at:
srsName: the coordinate system. It should say 25830 if the property is in zone 30.posList: the corners, as Easting and Northing pairs. The Easting has six digits and the Northing seven.- The first and last pairs are the same: that is how the outline closes. If they do not match, the polygon is open and validation will fail.
The text editor only tells you what is there, not what the plot looks like. For that you need the next step.
Option 2: see it drawn with QGIS
QGIS is a free, open-source mapping program, and the one most used to open a GML. The steps:
- Install QGIS from its official site, qgis.org.
- Create a new project and, in the “Layer” menu, choose “Add Layer” and “Add Vector Layer”.
- Select the
.gmlfile and click “Add”. If it asks for the coordinate system, enter EPSG:25830. - Zoom to the layer, by right-clicking it and choosing “Zoom to Layer”. The polygon of the plot will appear.
- Look at the data with the attribute table button: it shows the fields that accompany the geometry, such as the area or an identifier.
To see the plot on a map, add a background. QGIS can load the Cadastre’s orthophoto and plot map through the WMS services the Cadastre itself publishes; the Cadastre’s electronic office gives their addresses. If you overlay the GML geometry on the plot map you can see at a glance where it fits and where it does not, which is what the Cadastre then validates.
One useful detail: in the layer properties you can check the coordinate system. It should be the same as that of the QGIS project. If not, the property may appear shifted.
Other ways to see it
- The graphic validation report. If the GML has been submitted on the Cadastre’s electronic office, the reply (the IVGA) usually includes a graphic representation of the property relative to the neighbouring plots. We explain it in graphic validation report.
- A CAD program with a mapping module, such as AutoCAD Map 3D, which imports GML. Basic AutoCAD does not do so reliably.
- Google Earth does not open GML. It needs a KML or a file converted from QGIS, which exports it from the layer menu.
- Excel is no use for drawing the plot. It can open the coordinates copied from the text, but it does not interpret them as a polygon.
If the plot does not appear or is in the wrong place
Almost always the problem is in the coordinate system, not in the survey. This table summarises the most common cases:
| What you see | Probable cause | What to do |
|---|---|---|
| Nothing appears | The layer is far from the current view | Zoom to layer |
| The property is in the sea or in Africa | Easting and Northing swapped, or another system | Check the order of the coordinates and the EPSG |
| Shifted by about a hundred metres | The file was in ED50 and loaded as ETRS89 | Transform from ED50 to ETRS89 |
| Several outlines appear | The GML has one plot for each resulting property | Expected in a subdivision |
| It will not open | It is compressed or is not really a GML | Unzip and check the extension |
If you want to know why a coordinate in another system shifts the property, we explain it in survey coordinates: UTM, ETRS89 and geographic.
What a correct GML must meet
Before submitting or accepting a GML, it is worth checking that:
- It is in ETRS89 UTM zone 30 (EPSG:25830).
- Each outline is closed: the first and last corners match.
- There is one outline for each property that must be recorded.
- The area matches that of the survey.
- It does not overlap neighbouring plots on the plot map.
- It has no duplicate corners or crossing lines.
A fault in any of these points usually ends in a negative report. We explain it in what to do if the graphic validation report is negative.
When it is best to have a surveyor prepare it
Opening a GML needs no technical training; creating one that passes validation does. The geometry has to come from a field survey with the right equipment, and be calculated in the official system. A GML made from a sketch, an image or the drawing of another plan, without checking, is the most common reason a procedure gets stuck.
At Clotoides we measure the property with GNSS RTK and a total station, calculate the coordinates in ETRS89 UTM 30N, generate the GML, check that it closes and does not overlap, and deliver it together with the plan and a note explaining what is in each file. It is signed by Vicent Doménech, chartered surveyor no. 8948. The GML is technical documentation: it does not prove ownership or replace the procedure of the Cadastre, the Registry or the town council.
Frequently asked questions
Which program opens a GML file?
A text editor to read the coordinates, and QGIS, which is free, to see the plot drawn. Some CAD programs with a mapping module also import it.
Can I open the GML with Excel?
You can open it as text, but Excel does not interpret it as a polygon, so you will not see the plot. For that you need a mapping program.
Can I correct the GML by hand if there is an error?
It is not advisable. Changing a digit changes the property, and the structure of the file can be damaged. The right approach is to regenerate it from the survey, once you know what is failing.
What is the difference between a GML, a KML and a SHP?
They are geographic data formats. GML is the one the Cadastre receives. KML is the Google Earth format and SHP is the one used by many mapping programs. They can be converted from one to another, but the one that serves for the procedure is the GML.
Can the GML I download from the Cadastre be used to correct my property?
It describes the plot as it stands today in the Cadastre. To correct it you need a new survey, and a new GML produced from it.
If you have been asked for a GML and do not know where to start, tell us about it on the contact page or see the Cadastre, Registry, GML and IVGA service.
Tags gmlcatastrogeorreferenciacion
Written by Vicent Doménech, geodesy and cartography engineer, chartered surveyor no. 8948.