Finding a Secure Location in A Foreign City with QGIS

In this article I am going to talk about how you as an entrepreneur can manage to choose a secure location in a foreign city, both in terms of residence and where to set up an entrepreneurial venture. An easy way to discern which area is most suitable can of course be to ask the people you know locally. However if you don’t know many people in the city, or if you don’t feel that the people you know will be able to give you sufficient information, then I have another approach for you.

In order to find suitable locations I often use QGIS, which is an opensource program within the area of geographical information systems. There is also a more well-known program within the same industry by the name of ArcGis, but that one has a price tag on it. QGIS is totally free and does pretty much the same thing.

Finding a secure location in a foreign city – Medellín, Colombia

I am going to illustrate the process of finding a secure location in a foreign city with QGIS by using an example. The city of Medellín in Colombia is quite diverse when it comes to socioeconomic levels. We are going to do a simple exercise where we use QGIS to get a spatial overview regarding which area in the city is best in terms of safety. In order to do that we need three things:

  • The QGIS program that we will use in order to find a secure location in a foreign city, which can be downloaded here.
  • A Shapefile (vector layer) containing the different parts of Medellín (called comunas). That can be downloaded from, for example, the Medellín municipality page with geographical resources. If you are unable to find such files for the city you are investigating, it is also possible to create such layers yourself. This takes some time, but it can be done.
  • Socioeconomic data regarding homicides in the different parts of the city (i.e. the different comunas). In my case I got the information from the Medellín Advisor’s website. However, you can also access such statistics on municipality websites and national survey websites for the city you are investigating. If you are not fluent in Spanish the information of course needs to be translated.

QGIS overview

Graphic user interface of QGIS.

When you first open the QGIS program you will be faced with the GUI above. Click on Layer -> Add Layer -> Add Vector Layer. Thereafter you click on the three dots next to Vector Dataset(s) and locate the downloaded vectorfile/shapefile (.shp). Click on Add and then Close. Your view will now look similar to the image below:

Adding the numbers

To the left on the screen a layer has been added in the Layer box. Right click on this one and choose Open Attribute Table. In the window that opens you click on the yellow pen with the text Toggle editing mode and then you click on the button New field. Type in “Homicides” as name and click OK.

Finding a secure location in a foreign city by connecting socioeconomic numbers to geographical information systems. You then fill in the homicide numbers which corresponds to each of the comunas. Your view should now look similar to the image above. Save your edits and close the window.

Spatial representation of a secure location in a foreign city

Now you right-click on the layer again and choose Properties. Select Symbology in the window that opens. Switch from Single symbol to Graduated and choose Homicides as value.

Next to Mode you switch from Equal Count (Quantile) to Natural Breaks (Jenks). Thereafter you select Labels to the left and switch from No Label to Single Labels. Make sure that the field containing the name of the comunas are selected. For convenience you can also switch font size from 10 to 6. Then click OK.

Your view should now look similar to the image above. The darker red areas represent comunas with more homicides and the areas with a lighter color represent comunas with less homicides. We can see that the comunas also differ somewhat in size, which in some cases might give a somewhat misrepresentative view. For instance, a large comuna might have almost all its homicides concentrated in a certain part of its area.

A smaller comuna might for example have the same number of homicides as a large one, resulting in the same color. This also gives somewhat of a misrepresentation. In this case such a misrepresentation can be solved by dividing Homicides by area numbers in the table and then selecting those numbers as Values for this Graduated Layer. But you get the picture.

Adding satellite images as background in order to find a secure location in a foreign city

We are now done with connecting these numbers to a visualization, but it would be nice to take this a step further in order for the projection to look really neat. Therefore we are going to add a satellite image as background. For this presentation I am using QGIS version 3.16.3-Hannover. There have been some issues with adding satellite imagery in some versions, so in some cases there might arise some errors. Just be aware of this.

In order to get access to a satellite image, you need to install the plugin QuickMapServices by selecting Plugins at the top and then Manage and Install Plugins. Search for QuickMapServices in the window that opens and install it. You will now have the QuickMapServices button in your toolbar:

Click on this button and then choose Settings. Select the tab More services and Get contributed pack. You should now have access to the satellite image. Click the same button again and select Google -> Google Satellite. Now you ought to have a satellite image as a background. For me it looks a bit nicer if we make the comunas layer a little bit transparent. Right click on the comunas layer to your left and select Properties and then click on Symbology. Expand Layer Rendering and set opacity to let’s say around 60%. Then click OK.

Adding satellite images in order to find a secure location in a foreign city.

You will now have something similar to the image above with a semi-transparent layer of the comunas with the terrain as a background. We can see for example that the comuna La Candelaria seems to have quite a lot of homicides; indicating that it is a more dangerous area.

Viable options for a secure location in a foreign city

Palmita and Santa Elena have a low rate, but when we zoom in we can see that the terrain is pretty rural and on the outskirts of the city. Comunas like El Poblado, Buenos Aires, Manrique, Popular and Santa Cruz seem pretty central and with a relatively lower homicide rate, indicating safer areas. Hence they can be good choices when looking for a secure location in a foreign city.

Now, we have not looked at other aspects here like for example income levels and access to public transportation. You might want to live in a more upscale area or you might be looking for a more economic alternative. Low homicide numbers do not always coincide with income levels in an area, although they often do. In that case we might add income levels, house prices, rental prices and public transportation routes (in this case the most common one would be the Medellín metro) in order to further optimize our selection of a secure location in a foreign city.

Johan Bengtsson