{"id":25,"date":"2015-04-14T08:28:38","date_gmt":"2015-04-14T08:28:38","guid":{"rendered":"http:\/\/transnationalhistory.net\/mapping\/?page_id=25"},"modified":"2023-08-29T15:13:38","modified_gmt":"2023-08-29T15:13:38","slug":"pointvectorlayers","status":"publish","type":"page","link":"https:\/\/transnationalhistory.net\/mapping\/tutorials\/pointvectorlayers\/","title":{"rendered":"Point Vector Layers: how to depict points on a map"},"content":{"rendered":"<p style=\"text-align: right;\"><em><strong>Tutorial 2<\/strong><\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Now that you have a map, you would like to show particular points on it. This is where Point Vector Layers will be useful. In this tutorial we will try to depict 6 European cities that were particularly important in the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Grand_Tour\" target=\"_blank\" rel=\"noopener\">Grand Tour<\/a>.<\/p>\n<p><strong>STEP 1: FINDING COORDINATES FOR THE POINTS WE WANT<\/strong><\/p>\n<p>There are different ways to find out what the coordinates of the place you want to depict are. In the case of our Grand Tour example, we want to show the following cities: London, Paris, Vienna, Geneva, Venice, and Florence.<\/p>\n<p><a href=\"http:\/\/maps.google.com\" target=\"_blank\" rel=\"noopener\">Google Maps<\/a> is a very convenient way to get these coordinates. Right click on any point on Google Maps and choose <strong>What&#8217;s here?<\/strong>. This will give you the coordinates of the place, as shown on the photo.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-57 size-full\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-google-maps.jpg\" alt=\"\" width=\"620\" height=\"156\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-google-maps.jpg 620w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-google-maps-300x75.jpg 300w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>For specific areas or sites, <a href=\"http:\/\/en.wikipedia.org\" target=\"_blank\" rel=\"noopener\">Wikipedia<\/a> offers exact coordinates in the top right corner of the page. Florence&#8217;s <em>Duomo<\/em>, for instance, will appear with North and East coordinates.<\/p>\n<p><strong>STEP 2: MAKING A CSV IN A TEXT DOCUMENT<\/strong><\/p>\n<p>Now we want to list all our points in one place. To do so, we will be creating a CSV (comma-separated values) list. This will not be done on QGIS. Any text software can be used, such as:<\/p>\n<ul>\n<li>on PCs: Notepad or <a href=\"https:\/\/notepad-plus-plus.org\/\" target=\"_blank\" rel=\"noopener\">Notepad++<\/a><\/li>\n<li>on Mac: TextEdit (be sure to choose <strong>Make Plain Text<\/strong> from the <strong>Format<\/strong> menu) or <a href=\"http:\/\/www.barebones.com\/products\/textwrangler\/\" target=\"_blank\" rel=\"noopener\">TextWrangler<\/a><\/li>\n<\/ul>\n<p>1. Start by defining what your fields will be, and separate them with a comma. In our case, this will remain rather simple.<\/p>\n<p><strong>City,Latitude,Longitude<\/strong><\/p>\n<p>2. You may start your list on the second line. Each entry must be separated by a single line break.<\/p>\n<p><strong>Note<\/strong>: in QGIS, a positive latitude value is North of the Equator, while a negative one is South. A positive longitude is East of the Greenwich Meridian Line and a negative one is West.<\/p>\n<p>Our full list will then be:<\/p>\n<p><strong>City,Latitude,Longitude<br \/>\nLondon,51.500210,-0.126280<br \/>\nParis,48.852421,2.351008<br \/>\nVienna,48.211534,16.384351<br \/>\nGeneva,46.205327,6.139969<br \/>\nVenice,45.438171,12.334102<br \/>\nFlorence,43.769019,11.250152<\/strong><\/p>\n<p>3. Save the file under a .csv extension (using <strong>Save as<\/strong>). Let&#8217;s name it <strong>grandtour.csv<\/strong>.<\/p>\n<p>Your file should look like this and is ready to be inserted into QGIS.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-grandtour-csv1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-59 size-full aligncenter\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-grandtour-csv1.jpg\" alt=\"\" width=\"245\" height=\"144\" \/><\/a><\/p>\n<p><strong>STEP 3: IMPORTING A CSV INTO QGIS<\/strong><\/p>\n<p>To be inserted into QGIS, always keep in mind that a CSV must contain at least longitude and latitude values.<\/p>\n<p>In QGIS, insert the CSV by clicking on <strong>Layer<\/strong>, <strong>Add Layer<\/strong> then <strong>Add Delimited Text Layer<\/strong>.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-add-delimited-text-layer.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-61 aligncenter\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-add-delimited-text-layer.jpg\" alt=\"\" width=\"510\" height=\"230\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-add-delimited-text-layer.jpg 510w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-add-delimited-text-layer-300x135.jpg 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>The box that just opened should look like this and be filled in as shown: under <strong>File Name<\/strong>, browse through your computer to find your CSV file. You may change the name of your layer, such as <strong>Grand Tour cities<\/strong>. Make sure to choose <strong>CSV<\/strong> under <strong>File format<\/strong>. Tick the <strong>First record has field names<\/strong> box so your first line is not considered as a value. Finally, you need to indicate which of your values will be the X (horizontal) and Y (vertical) so QGIS can understand the logic of the CSV file. X is the longitude (West\/East) while Y is the latitude (North\/South). You also need to untick the\u00a0<strong>DMS coordinates<\/strong> box.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-csv-insert-dialogue-box1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-63 size-full\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-csv-insert-dialogue-box1.jpg\" alt=\"\" width=\"663\" height=\"503\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-csv-insert-dialogue-box1.jpg 663w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-csv-insert-dialogue-box1-300x228.jpg 300w\" sizes=\"auto, (max-width: 663px) 100vw, 663px\" \/><\/a><\/p>\n<p>One more box just opened. You need to select a CRS. Select <strong>WGS 84<\/strong> (the Authority ID is EPSG:4326) then click on <strong>OK<\/strong>.<\/p>\n<p>You finally have a map with\u00a0the cities shown\u00a0on it. By zooming on Europe, your map should look like this.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-europe-cities-grandtour.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-66\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-europe-cities-grandtour.jpg\" alt=\"2 europe cities grandtour\" width=\"857\" height=\"525\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-europe-cities-grandtour.jpg 857w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-europe-cities-grandtour-300x184.jpg 300w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>In this map only coastline and river layers have been kept in addition to our Grand Tour cities. Your map may look somewhat different if you have other layers activated.<\/em><\/p>\n<p><strong>STEP 4: CHANGING THE STYLE OF THE POINTS<\/strong><\/p>\n<p>Like the base layers in our first lesson, we can edit the style of our Point Vector Layers. To do so, right click on\u00a0the layer in the <strong>Layers<\/strong> list, and choose <strong>Properties<\/strong>.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-point-properties.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-point-properties.jpg\" alt=\"\" width=\"370\" height=\"357\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-point-properties.jpg 370w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-point-properties-300x289.jpg 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/a><\/p>\n<p>Under <strong>Style<\/strong>, you can choose from a wide range of colours, widths, shapes, etc. As I am planning to create a more complex map later on, I want my six cities to stand out: I will opt for red stars.<\/p>\n<p><strong>STEP 5: FORMATTING AND LABELLING<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Finally, like in most maps, we would like to show the labels for each of our cities (e.g. Showing &#8220;London&#8221; next to the point depicting the city). To do so, style in the <strong>Properties<\/strong> menu, click on\u00a0<strong>Labels<\/strong>. By ticking the\u00a0<strong>Label this layer with<\/strong> you can choose which of the fields of your CSV file will be displayed as a label. In this case of course, we want the <strong>City<\/strong> entry to be displayed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-80 aligncenter\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-label-city.jpg\" alt=\"\" width=\"368\" height=\"106\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-label-city.jpg 368w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-label-city-300x86.jpg 300w\" sizes=\"auto, (max-width: 368px) 100vw, 368px\" \/><\/p>\n<p>Further down in the same menu, you may also change the style (font, size, colour) of your label.<\/p>\n<p>If you want to see what your labels look like whilst keeping formatting\u00a0them, you can click on\u00a0<strong>Apply<\/strong> rather\u00a0<strong>OK<\/strong>. The menu won&#8217;t close but you will be able to see the changes you&#8217;ve just made.<\/p>\n<p>Now we would like to add a\u00a0buffer around your text. A buffer is a sort of halo around your text: it will be very useful if your map is quite dark and if you want ensure that your label is still visible. Under &#8220;Buffer&#8221;, you can choose what kind of buffer you want. In the case of my map, as it is quite white, I would like a black buffer with a white text in the middle. I previously selected a white colour in the Text formatting section, and now I am choosing a black buffer.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-buffer.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-81\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-buffer.jpg\" alt=\"2 buffer\" width=\"344\" height=\"289\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-buffer.jpg 344w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-buffer-300x252.jpg 300w\" sizes=\"auto, (max-width: 344px) 100vw, 344px\" \/><\/a><\/p>\n<p>So far my map looks like this:<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-cities-after-buffer.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-cities-after-buffer.jpg\" alt=\"2 cities after buffer\" width=\"497\" height=\"242\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-cities-after-buffer.jpg 497w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-cities-after-buffer-300x146.jpg 300w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><\/a><\/p>\n<p>There&#8217;s one final change to be made. As you can see the labels are not ideally placed. They are a bit over the stars and some of them hide the rivers that run through the cities. This can be done in the\u00a0<strong>Placement\u00a0<\/strong>subsection of the\u00a0<strong>Labels<\/strong> menu. In our case, we just need to put the labels slightly further away from the dot.<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-label-placement.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-label-placement.jpg\" alt=\"\" width=\"339\" height=\"176\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-label-placement.jpg 339w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-label-placement-300x156.jpg 300w\" sizes=\"auto, (max-width: 339px) 100vw, 339px\" \/><\/a><\/p>\n<p><strong>Around the dot<\/strong> only allows you to move closer or further away. Under\u00a0<strong>Offset from Point<\/strong>, you can choose where your label should be placed in relation to the dot. In my case, I am satisfied with the following display:<\/p>\n<p><a href=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-final-map-labels.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84\" src=\"http:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-final-map-labels.jpg\" alt=\"\" width=\"664\" height=\"438\" srcset=\"https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-final-map-labels.jpg 664w, https:\/\/transnationalhistory.net\/mapping\/wp-content\/uploads\/2015\/04\/2-final-map-labels-300x198.jpg 300w\" sizes=\"auto, (max-width: 664px) 100vw, 664px\" \/><\/a><\/p>\n<p><strong>Tip<\/strong>: you may not need such an elaborated map. Google Maps or Google Earth could deliver this equally well, depending on the needs of your project. Please read the excellent tutorials by <a href=\"http:\/\/programminghistorian.org\/lessons\/googlemaps-googleearth\" target=\"_blank\" rel=\"noopener\">The Programming Historian<\/a> on that matter.<\/p>\n<p><strong><a href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/pointvectorlayers\/advanced\/\">One step further: more\u00a0icons and labels to download<\/a><\/strong><\/p>\n<p>Last update: 21 May\u00a02015 on QGIS 2.8.1 Wien<\/p>\n<p style=\"text-align: right;\"><a title=\"Finding and Importing Shapefiles\" href=\"http:\/\/transnationalhistory.net\/mapping\/tutorials\/shapefiles\/\">Next tutorial:<br \/>\n<strong>Finding and Importing Shapefiles<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tutorial 2 &nbsp; Now that you have a map, you would like to show particular points on it. This is where Point Vector Layers will be useful. In this tutorial we will try to depict 6 European cities that were particularly important in the Grand Tour. STEP 1: FINDING COORDINATES FOR THE POINTS WE WANT [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":8,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-25","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":2,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/25\/revisions"}],"predecessor-version":[{"id":598,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/25\/revisions\/598"}],"up":[{"embeddable":true,"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/pages\/8"}],"wp:attachment":[{"href":"https:\/\/transnationalhistory.net\/mapping\/wp-json\/wp\/v2\/media?parent=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}