Geographic layers#
A geographic layer is a set of features with their geometry (the provinces of Spain, the municipalities, the census sections, the shops) and a key that identifies them. Linked to a dimension, it lets you draw that dimension's values on a map: the amount per province in colors, the customers per municipality in symbols. Layers are uploaded and linked in Administration › Geographic layers (/admin/geo-layers).
Before you start#
- Uploading, replacing, renaming and deleting layers, and linking them to dimensions, requires Metadata administration (or System administration). Viewing the layers only requires Access to Empowerment Center or Portal access.
- Layers are stored in ECenter's own database. If it is a PostgreSQL, it must have the PostGIS extension (see Installation). If it is an Oracle schema, no extension is needed (see With the own database in Oracle).
- Layers belong to the whole installation: the same layer serves all connections.
The file format#
ECenter loads GeoJSON: a collection of features (FeatureCollection), a single feature or a geometry. Each feature brings its geometry (polygons, lines or points) and its properties, of which one will be the key and another, optionally, the name.
MapInfo (.tab, .mif) or Shapefile (.shp) files are converted beforehand with GDAL's ogr2ogr:
- Coordinates are expected as WGS 84 longitude and latitude. If the file declares another reference system, it is converted; if it does not declare one and the coordinates do not look like longitude and latitude, ECenter asks for its EPSG code (for example,
25830for ETRS89 / UTM 30N). With the own database in Oracle, only the reference systems in a list are converted (see With the own database in Oracle). - At most 200,000 features per file (
ecenter.maps.max-features). The file size is limited byECENTER_MAX_UPLOAD(100 MB by default) in the backend and byECENTER_CLIENT_MAX_BODY_SIZEin the frontend proxy. - An upload that is not turned into a layer is discarded after 24 hours (
ecenter.maps.upload-ttl).
The Geographic layers page#
The table lists the layers with their Name and their code, their Type (Polygons, Lines or Points), how many Features they have, their Key, their Extent and when they were Updated. When you choose one, its detail also gives the property of the Name, the Source, the File it came from and who updated it, and the actions Replace features…, Rename…, Change source and Delete….


Create a layer#
- Press New layer.
- In GeoJSON file, choose the file (
.geojsonor.json). ECenter analyzes it (Analyzing the file…) and says how many features it has, of what type, how many come without geometry and, if it declares one, its reference system. - In Feature key and name, the File properties table shows each property with how many Distinct values it has (and whether they are unique) and some Examples. Choose the property that is the Key of each feature and the one that is its Name (or none).
- Fill in the layer's data (below).
- Press Create the layer.
Creation is a job: the layer appears in the list when it finishes.


| Field | What it is |
|---|---|
| Code | The layer's identifier: letters, digits, _, . and -, up to 40. It cannot be changed: it is what dimensions and maps use. |
| Name | The name users see, up to 100 characters. |
| Source or attribution | Optional. It is shown in the corner of the map, also in the portal, in embedding, in the image and in the PDF: for example, “Source: INE” or “Natural Earth”. Many public cartography licenses require it. Single-line text, up to 200 characters. |
| Key length | The length of the keys; 0, whatever each one has. |
| Pad with zeros | Pads on the left with zeros up to that length the keys of the layer and those of the dimensions: province 8 becomes 08. |
| Reference system (EPSG) | Only if the coordinates are not longitude and latitude and the file does not say. |
When it is created:
- the keys are stored without surrounding spaces and, with Pad with zeros, padded;
- features with the same key are merged into one (a province with islands, for example);
- those without a key, or with one longer than 100 characters, are discarded;
- geometries are converted to WGS 84 and repaired if they are not valid;
- a number such as
28079.0is stored as28079, so that it matches the dimension's code.
The two demo layers:
| Layer | Code | Key | Name | Length | Pad with zeros | Source |
|---|---|---|---|---|---|---|
| Provincias de España | provincias |
COD_INE |
NOMBRE |
2 | Yes | Natural Earth |
| Municipios de la demo | municipios-demo |
CLAVE |
NOMBRE |
0 | No | — |
Link a layer to dimensions#
A map draws the values of a dimension on the feature of the layer whose key matches the code of each value. The link is made in the layer's detail or in the dimension's panel of the metadata editor (Geographic information section, see Dimensions).
- Choose the layer and, in Linked dimensions, the Fact table (of the connection chosen in the frame).
- Each dimension of the table says whether it is Not linked or linked to “…”.
- If the dimension has several columns, tick those that form the feature's key. Their values, joined in order, are the code; with none ticked, the last one. In a hierarchy you tick those that identify the feature: the province by
COD_PROVINCIA, without the zone; the municipality byCOD_PROVINCIAandCOD_MUNICIPIO. - Press Link to this layer. If it was already linked, Save key saves the columns and Remove link removes it.
In a dimension with a function, the key is the value of the function. Like any metadata change, linking, changing the key or removing the link first shows the affected maps.
Change a layer#
| Action | What it does |
|---|---|
| Replace features… | Uploads another file and chooses the key, the name, the padding and the source again, without changing the code: dimensions stay linked. It is used to update a cartography. |
| Rename… | Changes the name users see. |
| Change source | Changes the source quoted in the corner of the map. Empty, it quotes none. |
How layers are served#
Maps receive layers as vector tiles, which PostGIS calculates (or the application itself, with the own database in Oracle), with the geometry simplified to the scale of each zoom level: a layer of thousands of small features is drawn without downloading it whole. The browser caches the tiles for a day; when features are replaced, the layer changes version and browsers request the new ones. The frontend proxy compresses them.
With the own database in Oracle#
If the own database is an Oracle schema (see The own database in Oracle), maps use neither PostGIS nor Oracle Spatial. The page, the layers and the maps are the same. This changes:
- The geometry is calculated by the application, not by the database: reading the file, merging the features with the same key, repairing them and calculating the tiles.
- Each tile is stored the first time it is requested. After that the stored one is served, on all instances. Replacing the layer's features or deleting it deletes its stored tiles.
-
A file in another reference system is only converted if it is in this list:
Reference system EPSG codes WGS 84 4326ETRS89 and its UTM zones 4258, and from25828to25838REGCAN95 4081,4082and4083ED50 and its UTM zones 4230, and from23028to23038WGS 84 UTM From 32601to32660and from32701to32760Web Mercator 3857ETRS89-LAEA 3035Lambert-93 2154Portugal TM06 3763
With another code, the upload is rejected and the message (in Spanish) says which ones are accepted: «El sistema de referencia EPSG:… no está entre los que admite el almacén de mapas de esta instalación: …». Convert the file to WGS 84 beforehand with ogr2ogr -t_srs EPSG:4326, as in the example in The file format.
Delete a layer#
- Choose the layer and press Delete….
- If any dimension links it or any map uses it, the question says so beforehand, with what you can open by its name and the rest counted.
- Confirm with Delete layer.
The layer goes to the Trash with its features, and its code becomes free for another one. The dimensions are still linked by its code: the maps that used it warn that the layer does not exist until it is restored. It can be restored from the trash until its deadline is reached, unless another layer has taken its code in the meantime (the message, in Spanish, says «Ya hay otra capa con el código «…»…»).