I am trying to clip the state of MN out of the OSM Standard Basemap, omitting everything outside of the state boundaries. Everything I've read about clipping talks about clipping between two shapefiles, but the OSM Standard Basemap isn't a shapefile.

How do I clip this to get rid of the basemap outside of the state boundaries while retaining it within the state?

enter image description here

enter image description here

  • What is your final goal with that cutout? Dec 7 '20 at 19:00
  • I just want to be able to project the map of the state with my data.
    – DanG
    Dec 7 '20 at 19:17
  • please try this: Duplicate the state_of_minnesote layer and set its symbology to Inverted Polygons, then choose a White fill. Is this sufficient to what you want? Clipping the OSM would be much harder. Dec 7 '20 at 19:21

The OSM basemap (I guess you loaded to XYZ tiles) is a remote raster tile, thus the data is not on your machine, but accessed via internet. Plus you have several tiles with different resolutions for varying zoom levels. The original files are not accessible for editing this way, thus you can't clip it. What you can do is mask (hide) some parts of the basemap, overlaying another layer that covers the part you want to hide. So try to get a vector file that covers the part you want to hide - best use OSM data. There are several ways to load OSM data in QGIS, one is the QuickOSM plugin. There are other possibilities, look out here on this site or search the web.

Basically, you have two options to hide an area: place a layer over the OSM layer that covers the area. The other option: you have a vector layer that covers everything except the area you want to hide. Than apply an Inverted Polygons layer symbology and everything outside this layer will be covered.

The easiest way is to download the polygon shape of Minnesota from OSM with the plugin mentioned. Zoom somewhere to Minnesotat, than open the dialog window, set the query to Key: admin_level and Value: 4 and select Canvas Extent. Than run the query:

enter image description here

You will probably get several layers but you can delete everything except the polygon layer. If you have more states than just Minnesota, delete all others. When you are left with Minnesota alone, set layer style to inverted polygon and select a color: I used white. You could change transparency, so OSM would be semi-transparent outside of Minnesota.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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