OpenStreetMap and ESRI projections for Portugal

Hi everybody,

OpenStreetMap is not projecting correctly on (at least) some GIS programs as QGis or MapWindow5.

This happens whenever a shapefile or a raster file (image or grid), with a projection file (*.prj) of an ESRI projection for Portugal, is loaded in first place, or one defines the map projection for some ESRI Portuguese projection.

There are two ESRI projections widely used in Portugal:

• ESRI:102164: Lisboa Hayford Gauss IGeoE (ESRI)
• ESRI:102161: Datum 73 Hayford Gauss IPCC (ESRI)

Probably, the reason for this relies on the fact that ESRI projection files do not carry the TOWGS84 datum transformation parameters, so, when any GIS program read these projection files, they reproject from their CRS system to one of the above ESRI projection CRS, without performing the necessary datum shifts.

On the following link you can find printscreens of QGIS and MapWindow 5 showing these inaccuracies, a list of projections used in Portugal (mainland, excluding Madeira Island and Azores), and samples (shapefiles) of these ESRI projections and their equivalent EPSG projections.


That sounds like an issue with those particular programs rather than anything OSM can or should address. Suggest you report it on each program’s forum/support list.

Hi, Richard,

Both QGis and MW5 have already solved all issues regarding these portuguese CRSs. These two particular programs opens shapefiles correctly no matter the projection files are EPSG style or come from ESRI software.

OSM opens incorrectly only the shapes that have projections files (*.prj) from ESRI sources.

You really need to clarify yourself better regarding the “OSM opens” part of the above quote.

OpenStreetMap has a whole ecosystem of dozens, if not hundreds of pieces of software and code snippets. Some very advanced and well maintained, others not so.

Unless you specify exactly what software you are using and in what workflow, the chances of getting any meaningful answer are next to zero…

Hi mboeringa,

Well, the answer to your question is on the link to Google Drive I provided on the first post.

In “Printscreens.pdf”, the first two images are for WindowMap5 and the last ones for QGis.

On each group, the first image shows a shapefile, with an ESRI:102164 (Lisboa_Hayford_Gauss_IGEOE) projection file, projected over an orthophoto, of the same ESRI projection system, which is equivalent to EPSG:20790 (Lisbon (Lisbon) / Portuguese National Grid). As you can see, there are no shifts.

On the second images, I just changed the visible layer, from the orthophoto to OSM, and, what seems to happen is that OS map did not shift from DATUM WGS84 to DATUM Lisboa (Lisbon), and, hence, that displacement of about 250 meters.

I can also tell you that if I load, in first place, a shapefile with an EPSG:20790 (Lisbon (Lisbon) / Portuguese National Grid) projection file, there are no problems at all. Problems arise when the shapefile loaded has an ESRI:102164 projection file or any other ESRI projection system for Portugal.

On the samples I provided on the link (first post), you have shapes for a lot of Portuguese projection systems currently in use, both ESRI and EPSG, that you can try on any GIS software.


Hi Antonio,

I now downloaded your ZIP and had a look at the data and attempted to add it to QGIS 2.18.3 (I have no experience, nor even knew it until you mentioned it, of MapWindow 5).

If I set the Project’s projection / CRS to EPSG:20790 in the menu via the Project/Project Properties/CRS dialog, making sure the default “On the fly CRS transformation” remains checked ON, then each of the three shapefiles listed below and you supplied match up perfectly with the OpenStreetMap base layer loaded via the OpenLayers plugin:

  • epsg_20790.shp
  • lisboa_hayford_gauss_igeoe.shp (which according to your info is the ESRI equivalent projection of EPSG:20790)
  • lisboa_hayford_gauss_ipcc.shp

If I don’t set the Project’s CRS and CRS transformation in the project properties, then yes, of course, there is a mismatch, because the OSM base map is in an entirely different projection.

So, I actually don’t see anything wrong here. You just need to always ensure you set the CRS properly in the project properties, and leave the default CRS transformation checked on.

Even if there was a problem, you should have posted it on the QGIS or MapWindow 5 forums, on-the-fly projections and transformations are capabilities of the viewer or GIS you use, NOT of the webmap, which is always in a fixed projection in case of an image service like the OpenStreetMap Carto “Standard” style. In fact, since the data is from an image service, QGIS needs to warp the image, as it can’t use the actual coordinates like with vector tiles. You can clearly see this warping in the mangled text if you zoom out to the entire OSM layer using the right click “Zoom to Layer” option in QGIS if you have set the Project’s CRS and CRS transformation enabled.



Hi Marco,

You’re right. I’ve experimented with the latest version of TATUK GIS EDITOR and there is no mismatch at all, whatever is the shapefile projection system I load on the map.

Best regards