Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm pretty new to QGIS and having a bit of trouble getting a text layer to match my shapefile. I'm trying to plot Canadian cities on a shapefile I have of Canada provinces. The provinces shapefile is from: http://www5.statcan.gc.ca/access_acces/alternative_alternatif.action?l=eng&dispext=zip&teng=gpr_000b11a_e.zip&k=%20%20%20%2040968&loc=http://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/files-fichiers/gpr_000b11a_e.zip

and the city data I got from: geocoder.ca under there free data downloads.

So I tried reading a few articles on this and enabled on the fly CRS transformation. Looking at the provinces shapefile for the metadata it says:

In layer spatial reference system units : xMin,yMin -141.018,41.6814 : xMax,yMax -52.6194,83.1355 Layer Spatial Reference System: +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs

So when I plotted the city file I choose to project it using WGS 84.

In layer spatial reference system units : xMin,yMin 0,0 : xMax,yMax 140.87,76.4935 Layer Spatial Reference System: +proj=longlat +datum=WGS84 +no_defs

and unfortunately my city data doesn't look plotted right. It looked mirrored and there is a point that is way off (guessing the data is wrong). Not sure why it would be mirrored though. Suggestions?

Since I don't have the rep yet to post images I uploaded an image of what my output looks to skydrive: http://sdrv.ms/YV2Whl

Cheers

share|improve this question

3 Answers 3

up vote 3 down vote accepted

It looks to me like your longitude values are positive, which WGS84 interprets as East of the prime meridian. Points West of the prime meridian have negative longitudes. Confused yet?

It makes a bit more sense when you think of the longitudes as Eastings, so negative values are less east and positive values are more east. You should be able to fix your problem by multiplying your longitude values by -1, or by subtracting them from 0. Don't do this to your latitudes, though, or your coordinates will show up in the Southern Hemisphere!

Edit: I downloaded the point data and confirmed that the longitudes are positive.

share|improve this answer
    
You also might want to check up on that one point in the Atlantic. –  Jay Guarneri Apr 4 '13 at 15:15
2  
Cheers that fixed it (aside from my 1 off plot, which I'm guessing is just bad data) –  Wizuriel Apr 4 '13 at 15:16
    
Glad I could help. –  Jay Guarneri Apr 4 '13 at 15:18

Have you turned your text data (Canadian Cities) to a point shapefile? You can do this in a two step process:

1) Use the Add Delimited Text Layer plugin to change your text file to points
2) When the new layer is loaded to QGIS, right click on the layer and choose Save As to make it a new shapefile

When you have the cities as a point shapefile you can do a Spatial Join (Vectors - Data Management Tools - Join attributes by location). This will allow you to get attribute information from your Province polygons, and write it to your cities shapefile attribute table.

share|improve this answer
    
When I do that is complains that it failed. Export to vector file failed. Error: creation of layer failed (OGR error:Failed to open Shapefile `test.shp'.) –  Wizuriel Apr 4 '13 at 15:06

Can you share the text file. I am assuming it may be that you do not have a header row (ie: x,y,name). You will want it to look like:

x,y,name
-100,49.5,Regina
-122,49.1,Vancouver
share|improve this answer
    
I don't have it in that order. sdrv.ms/ZBM0bN, will try changing it to x,y,name –  Wizuriel Apr 4 '13 at 15:25
    
Tried changing it to that order and still no change –  Wizuriel Apr 4 '13 at 15:35
    
Can you send me the file, or point me in the direction where I can download it. –  Ryan Garnett Apr 4 '13 at 15:51
    
These are the files I'm working with: sdrv.ms/Y0bu3a –  Wizuriel Apr 4 '13 at 16:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.