My project consists of geocoding all Muslim mosques in Portugal (I have this data in CSV file) using QGIS.

I'm using OpenLayers to get my base map (Google Streets), but I want to get only the map of Portugal, instead of World Map. Is it possible?

I've tried to use OpenStreetMap and GoogleMaps pluggins, but I don't know how to isolate Portugal from the World Map.

I have other shapefiles of Portugal, but it doesn't show all the info as Google Maps.

  • Other than just a map of Portugal, what other data do you want? – nmtoken Dec 18 '17 at 13:44
  • Do you want an isolated map of Portugal or do you want to restrict the extent of you map to Portugal? Is it a website, reachable from all over the world? Do you want to host the tiles by yourself? Do you have funds to pay for a service? Have you tried OpenStreetMap maps? There are various services where you could try e.g. OpenMapTiles or MapBox. Please be more specific in your question, so people can help you better. – bennos Dec 19 '17 at 9:24
  • Hello @nmtoken. I just want the map, with street and area names on it. The data I want to geocode I have in a CSV file. – Paulo Vitorino Dec 19 '17 at 10:58
  • Hello @bennos. I'm sorry for not being more explicit, but it is hard for me to explain more thechnical topics. I want an isolated map of Portugal, which shows street names and area names. I have all the data I want to geocode in a CSV file. I've tried to use OpenStreetMap and GoogleMaps pluggins, but I don't know how to isolate Portugal from the World Map. – Paulo Vitorino Dec 19 '17 at 11:00
  • Do you want to view it only in QGIS or do you want to create a webmap with OpenLayers for viewing the map in a browser? – bennos Dec 19 '17 at 11:11

The Direção-Geral do Território (DGT) offers some maps as WMS at http://mapas.dgterritorio.pt/. There is also a guide for loading the maps in QGIS.

You can check in the Online-Viewer which map suits you or the catalog of services.

Note: I don't speak portuguese and don't know exactly which maps are available and which licences do apply to the maps.

Additionally you can check out the QuickMapServices Plugin in QGIS where you can find numerous maps using the search toolbar.


To restrict the data within a boundary, you can use the QGIS plugin Mask.

Install the plugin

Install the QGIS plugin Mask from the official repository.

Create the boundary polygon

Create a single polygon with the portuguese boundaries. You can use the CAOP data. Use Vector → Geoprocessing Tools → Dissolve, select dissolve all (it will take a few minutes) to keep just the outer limits of Portugal.

Remove the fill property from the polygon.

Use Mask

Select the polygon of Portugal. Go to Plugins → Mask and select Create a Mask. Apply.


Output of the mask usage

  • Hello @jgrocha. Where can I apply this code? I don't know anything about Python scripting on GIS software, or other types of code within the program. – Paulo Vitorino Dec 19 '17 at 19:40
  • @PauloVitorino I've changed my answer. Is this what you are looking for? – jgrocha Dec 19 '17 at 20:32

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.