0

This looks like an easy solution but, for the life of me, I cannot manage to solve this. I have browsed this website where solutions were provided but unfortunately, none have produced the desired outcome.

I am very novice in QGIS, so any solution provided should be very detailed.

I have downloaded layers that contain information on the type of land cover (source: source of CLC layer). After importing in in QGIS (New Project>Browser>GeoPackage>New Connection>path to file) and then dropping the file in the Layers, I see the layer and its contents. At the bottom right, the CRS is EPSG:25830. In the Properties of the layer (right-click on the layer and click on Properties), I see that the CRS is EPSG:25830. (see the properties of the land cover layer: properties of the land cover layer and its assigned CRS: assigned CRS of the layer)

Now I want to overlay the limits of the municipalities. The SHP file comes from here. To check its coordinate system, I uploaded it to MyGeoCloud. Its reference system is WGS 84 / Pseudo-Mercator (EPSG:3857). If I import it into a new QGIS project, it displays that value too.

I have tried this:

  1. Import the land cover layer into a new project, then drop the municipalities => failed enter image description here

  2. Import the municipalities and then the land cover => failed enter image description here

    However, I was under the impression that QGIS (I am using 3.36 Maiden) was able to adjust that.

  3. Reproject the shapefile before importing to the project => failed.

    Some answers here suggested reprojecting the layer (I will reproject the municipalities layer). So I did: New Project>Import the limits>Vector>Data Management Tools>Reproject Layer. I chose EPSG: 25830 as the Target CRS. I then export the layer by right-clicking on the layer>Export>Save Features As...> and I choose a name for that file. If I right-click on that exported layer, I see that the CRS of that layer is the one I want:

    enter image description here

I create a new project and drop the new shapefile with the CRS of 25830 and the CRS I want is at the bottom-right of QGIS.

I drop the layer of land cover onto that project and it does not match. enter image description here.

What do I do wrong? Could you list a workflow that would work?

EDIT: steps to download the layers: Land cover layer:

  1. Go to this link and search ("Buscar") enter image description here,
  2. then download the Geopackage file. enter image description here

SHP file of the municipalities:

  1. Go to this website (or search "municipios ign esri" on Google if the link does not work)
  2. Download as SHP enter image description here
11
  • @babel: will try tomorrow and let you know. Yes, I changed the layer CRS (by reprojecting) because drag and drop did not work. Anyway, I'll try a new project and redo everything to see if that works. Commented Jun 24 at 21:02
  • @Babel: that was option 1 in my question. For option 1, I did not change the projection (no assignment, no reprojection), that is why I tried other options. My objective with this is to compute the area of each municipality that is covered by one of the 44 classes available in the Land Cover layer. So I thought of importing both layers by drag and drop and then applying Intersect or Union, but that gave me an error (GEOS is unable to perform the task). The workflow seems simple but I just cannot make it work. Commented Jun 25 at 6:39
  • Sure: here's the WMS connection: servicios.idee.es/wms-inspire/… and the shapefile is here: opendata.esri.es/datasets/ComunidadSIG::municipios-ign/… Is this what you need? My problem is that the behavior of QGIS is not consistent: the drag and drop may work, then I save and reopen and then it no longer matches. I am sure I am missing something. Commented Jun 25 at 6:47
  • I do not have access to the computer with QGIS before tonight (European time). Will update when I can. Thanks a lot in advance. Given what I want to achieve, is it better to use Union or Intersection? Commented Jun 25 at 7:22
  • I don't see anything like you show in your updated question. Can you just link to your files on WeTransfer, DropBox, etc?
    – Pointdump
    Commented Jun 25 at 9:39

1 Answer 1

3

The problem seems to be a CRS issue: you probably (wrongly) changed the layer's CRS what you should never do if you're not really 100% sure what you do: see here for details. Whenever a layer does not fit on a basemap, in about 99% it's becaus a wrong CRS definition was assigned to it.

So to solve the problem:

  1. Create a new, empty QGIS project with an OSM basemap and drag and drop your files. They should perfectly allign with the basemap. I always recommend this to see if the data is located in the correct location:

    enter image description here

  2. As your files come in two differen CRS (see here and here), for intersecting them, you should reproject them to the same CRS. I would advice to reproject Municipios layer from EPSG:3857 to EPSG:25828 as the other layer. Go to Menu Processing -> Toolbox -> Reproject Layer.

    Alternatively, right click the layer -> Export -> save featuers as... and there, choose the CRS you want to reproject to. This has the advantage that you can also save the file as a Geopackage and avoid the cumbersome handling of Shapefiles.

  3. Another problem with your data appears when you want to Intersect: Feature (522) from “Municipios_IGN” has invalid geometry. Run Fix Geometries to repair them, then Intersection works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.