Sunday, January 21, 2018

Learning QGIS - Import data and change projection

I am currently learning QGIS by attending the workshop at D-Lab, Geospatial Data and Mapping Fundamentals. Here I am using a small project to show what I learned the basics.
The goal of this small project is to make a map with the population count and the earthquakes worldwide, so that we can easily see where are the most dangerous places on earth.

Data download

First we need to download the population grid count data from Socioeconomic Data and Applications Center, I downloaded the population count data for 2015 at the resolution about 110km for demonstration purposes (you can download more higher resolution ones), you can find the population count data in GeoTiff here. And the earthquake data by query USGS catalogs, I’ve already downloaded the worldwide earthquakes larger than M6 from 2006 to 2018, you can find it here.

Import data into QGIS

Let’s load the data into the QGIS first. Since the population data is a GeoTiff, which is a raster file, we can add a raster layer as shown in the following figure:
png
The earthquake data is a vector data, and it can be added as a vector layer as the following figure, the QGIS is smart enough to find out the latitude and longitude as the Y and X field. You don’t need to change anything:
png
After we add the earthquake data, it now looks like this:
png

Change the projection

Many times, you will find that different data will have different projections. In a simple sense, the projection is the rule when you want to show things on the earth (3D sphere) onto a 2D Map. There are different projections, and if your data are in different projections, they will not line up in the map. Therefore, you need to make all the layers have the same projection.
You can find the projection of the data by right click the layer in the ‘Layers Panel’, and click the properties. The projection of this layer will be shown in the ‘General’ tab. As shown in the next two figures:
png
png
Note that, you can not change the projection here (even you change it here, the underlying projection is still the old one). If you want to change the projection, do the following steps:
Step 1:
Right click the layer you want to change the projection, and choose ‘Save as’:
png
Step 2:
A popup window will ask you the new name you want to save, and in the ‘CRS’, you can choose your new projection system.
png
Click the small global near it, and in the popup window, you can type ‘4326’ in the ‘Filter’, which will list the name of the projection system below. (in our case, we don’t need to change, but if you need change to another projection, just find it here)
png
Step 3:
After you save it as a new layer, you will see that in the ‘Layers Panel’. Remove the old layer:
png
Then you will have all the new layer with the new projections. Do this for all the layers in different projections (usually you change the vector layers to the projection system which the raster layer use)
png
Dada, we can see the above figure, we have the data loaded into the QGIS, but the population is all black, we want to change the color of the population based on the count, and for the earthquakes, maybe use the size of the circle as the magnitude and color it by using the depth. How we can do this? We will talk this next week.

5 comments:

  1. It is amazing and wonderful to visit your site. I've learn many things from your site.

    Flat earth forum

    ReplyDelete
  2. Am here to testify what this great spell caster done for me. i never believe in spell casting, until when i was was tempted to try it. i and my wife have been having a lot of problem living together, she will always not make me happy because she have fallen in love with another man outside our relationship, i tried my best to make sure that my wife leave this woman but the more i talk to her the more she makes me fell sad, so my marriage is now leading to divorce because she no longer gives me attention. so with all this pain and agony, i decided to contact this spell caster to see if things can work out between me and my wife again. this spell caster who was a man told me that my wife is really under a great spell that she have been charm by some magic, so he told me that he was going to make all things normal back. he did the spell on my wife and after 5 days my wife changed completely she even apologize with the way she treated me that she was not her self, i really thank this man his name is Dr ose he have bring back my wife back to me i want you all to contact him who are having any problem related to marriage issue and relationship problem he will solve it for you. his email is oseremenspelltemple@gmail.com he is a man and his great. wish you good time.
    He cast spells for different purposes like
    (1) If you want your ex back.
    (2) if you always have bad dream
    (3) You want to be promoted in your office.
    (4) You want women/men to run after you.
    (5) If you want a child.
    (6) You want to be rich.
    (7) You want to tie your husband/wife to be yours forever.
    (8) If you need financial assistance.
    (9) HIV/AIDS CURE
    (10) is the only answer to that your problem of winning the lottery

    Contact him today on oseremenspelltemple@gmail.com or whatsapp him on +2348136482342

    ReplyDelete
  3. Five weeks ago my boyfriend broke up with me. It all started when i went to summer camp i was trying to contact him but it was not going through. So when I came back from camp I saw him with a young lady kissing in his bed room, I was frustrated and it gave me a sleepless night. I thought he will come back to apologies but he didn't come for almost three week i was really hurt but i thank Dr.Azuka for all he did i met Dr.Azuka during my search at the internet i decided to contact him on his email dr.azukasolutionhome@gmail.com he brought my boyfriend back to me just within 48 hours i am really happy. What’s app contact : +44 7520 636249‬

    ReplyDelete
  4. My name is Tom cam!!! i am very grateful sharing this great testimonies with you all, The best thing that has ever happened in my life, is how i worn the Powerball lottery. I do believe that someday i will win the Powerball lottery. finally my dreams came through when i contacted Dr. OSE and tell him i needed the lottery winning special numbers cause i have come a long way spending money on ticket just to make sure i win. But i never knew that winning was so easy with the help of Dr. OSE, until the day i meant the spell caster testimony online, which a lot of people has talked about that he is very powerful and has great powers in casting lottery spell, so i decided to give it a try. I emailed Dr. OSE and he did a spell and gave me the winning lottery special numbers 62, and co-incidentally I have be playing this same number for the past 23years without any winning, But believe me when I play the special number 62 this time and the draws were out i was the mega winner because the special 62 matched all five white-ball numbers as well as the Powerball, in the April 4 drawing to win the $70 million jackpot prize...… Dr. OSE, truly you are the best, with Dr. OSE you can will millions of money through lottery. i am a living testimony and so very happy i meant him, and i will forever be grateful to him...… you can Email him for your own winning special lottery numbers now oseremenspelltemple@gmail.com OR WHATSAPP him +2348136482342

    ReplyDelete
  5. Yes it is possible to retrieve your stolen bitcoins. I never believed in bitcoin recovery because I was made to understand that it is not possible. But sometime in February I fell for a binary options scam which promised a higher return and I lost close to $75,000. I read an article on here as regards to a recovery expert and genius, so I reached out to Mr Aaron Gabriel, and to my surprise I got all bitcoins recovered within 1week frame. I don’t know if I’m allowed to share the links on here, but you can contact him if you are finding it very difficult to withdraw your funds at Aarongabriel310@gmail.com or you can also message her on WhatsApp +1 (317) 563-7226.

    ReplyDelete