Help using Natural Earth data in QGIS
Home › Forums › Advice & Tutorials › Software & Services › Help using Natural Earth data in QGIS
Tagged: projection, QGIS, raster
- This topic has 7 replies, 1 voice, and was last updated 14 years, 7 months ago by Nathaniel.
-
AuthorPosts
-
April 27, 2010 at 9:27 pm #3385
TBParticipantHi,
I am a new QGIS user having a problem getting Shapefile and Raster data from Natural Earth to properly work together. I think my problem has a simple solution.
I am using a 1:10m Shapefile along with 1:10m Raster imagery from Natural Earth. When I open up these two files in QGIS the background raster imagery is displayed at a size much larger scale than the Shapefile data. The Shapefile and Raster imagery data are from the same Natural Earth dataset (1:10m) and should work together and appear at the same scale.
I have looked through QGIS to make changes to the rendering and other settings but I can not fix the problem. I have turned on “on-the-fly” re-projection in project settings in QGIS but this has not fixed the problem.
Any suggestions on what settings in QGIS I need to adjust in order to get the Shapefile and Raster imagery to align or scale correctly?
Thanks
Using QGIS 1.4.0 on Windows XP SP3
April 28, 2010 at 8:13 pm #4014
NathanielKeymaster@TB: Sounds like QGIS is not paying attention to the projection info on the TIF file. You’ll need to use QGIS’s define coordinate reference system (CRS) tools. Looking at the QGIS manual, this can be changed by selecting your raster in the table of contents, getting the properties, and in the general tab, it will list a coordinate system (it might say NULL now) and there is a CHANGE button next to that. You want it to be something like: proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
April 29, 2010 at 10:34 am #4015
TBParticipantHi,
Thanks for your reply.
I have followed your suggestions and looked online for help but I am having no luck in fixing the problem. This seems like such a simple task – I must be missing something really obvious.
I made a 2 minute screencast video that shows what I am doing (or perhaps what I am doing wrong). The video is on Youtube and shows what I’m doing and seeing in QGIS. In the video I am using the ’10m-admin-0-countries’ shapefile and ‘NE2_LR_LC_SR_W_DR’ raster image file – both downloaded from Natural Earth. Perhaps you could take a quick look? The link is below:
http://www.youtube.com/watch?v=JuE9rbNd5oQ
The video quality isn’t the best, but hopefully you might see something that will help me solve this issue.
Thanks very much
April 29, 2010 at 3:55 pm #4016April 29, 2010 at 10:35 pm #4017
TBParticipantHi,
Thanks for your patience – I very much appreciate your assistance!
Sorry about the video – I changed it from private viewing. Here is the link:
http://www.youtube.com/watch?v=qWOUTG9fjjQ
As you will see in the brief video I set the projection for each layer to WGS84 lat/lon ( EPSG:4326) and set the project projection to EPSG:4326 and enabled on-the-fly reprojection.
As you can see in the Youtube video, QGIS is still projecting the vector layer and the raster image layer at very different scales/sizing. I have downloaded at least three raster image files from Natural Earth and they have all had this problem. When I am in QGIS I add the Raster layer and then the vector layer, set the projections to all be the same and it still does not work. I must be doing something wrong that is very obvious – but I can’t figure it out!?!?!
I sent an e-mail to nathaniel@naturalearthdata.com which contains two small screenshot image files which might assist you in possibly determining what I am doing wrong. The first image shows the names of the two raster files that I downloaded from Natural Earth. Do I need to do anything to changing the filenames? The second image file is an image from a text editor that shows the world file. I’m not sure if that info helps at all.
Any other ideas or suggestions.
Thanks very much!
April 30, 2010 at 5:48 pm #4018
NathanielKeymaster@TB: Please try the following version of the tif:
http://www.nacis.org/naturalearth/temp/NE1_LR_LC_SR_GEOTIFF.zip
Other people have reported it loaded better into open-source GIS systems.
Reviewing your video, it looks like the coordinate system is fine on the image. What is wrong is QGIS is not reading the pixel size or upper-left registration point correctly. The extent should be ±180 ±90 and registered at -180, 90 (I’m not sure how QGIS measures the pixel cell offset so that could be slightly off from integer values). What it’s doing is assuming each pixel is equal to 1 decimal degree, and registereding the image at 0,0 (in the middle of the geographic coordiante space).
I’m not seeing how to set the extent quickly in Google search. Please ask how to do that in the QGIS forums.
May 1, 2010 at 11:48 pm #4019
TBParticipantHi,
Thanks for the reply. I tried the file you included in your prior post and it worked correctly with a state and province boundary vector file!
I’m not sure if I understand all of your explanation on what is causing the problem. I will attempt to get help at the QGIS forums with the aid of your info.
In regard to the raster file that your directed me to – http://www.nacis.org/naturalearth/temp/NE1_LR_LC_SR_GEOTIFF.zip – is it possible for me to access other raster files like that one? How is the file that you directed me to different from the raster files that I have been downloading from http://www.naturalearthdata.com that did not work?
I went to the NACIS.org website and clicked on the Natural Earth link on their homepage and it just directs me to http://www.naturalearthdata.com homepage. It would be great if I can gain access to the other raster files that will work correctly in QGIS.
Thanks for your assistance!
May 2, 2010 at 4:23 am #4020
NathanielKeymaster@TB: Sorry, but there is but that one geoTIFF at present. It was created to isolate a similar problem a couple months ago. I’d like to convert all the TIFFs to work in QGIS and other open-source GIS programs but that is several gigabytes to process. The onus also falls on the open-source community to support files that a GIS like ESRI’s ArcMap can read in fine (same goes for vector versions of Natural Earth that sometimes fail in Mapnik). In the case of the raster, the problem is likely that the TFW file has the correct info but the header in the TIF does not (or at least it’s encoded “wrong” to QGIS). There is an order of operations GIS apps use to pull out the coordinate system space on a TIFF image. Because it’s erroring on the TIF header (which is giving priority), QGIS never gets to the TFW version. One alternative for you is to open the TIF up in a normal image editor and save a copy out. That will strip the header from the new TIF and then QGIS should then read the TFW to locate the TIF image. You might have to tell QGIS that the projection is geographic WGS84, but the registration and cell size will be right in the TFW. Let me know if that works for you as a workaround.
-
AuthorPosts
You must be logged in to reply to this topic.