Friday 15 December 2017

coordinate system - Shapefiles and OpenStreetMap data do not overlap in QGIS?


So I'm pretty new to GIS, and I'm working on a mapping project using data for Vancouver, Canada. I want to combine OpenStreetMap data along with data provided by the City of Vancouver. But the City data don't line up with the OSM data when I map them in QGIS.


Following the advice of an answer to Projected maps should but do not overlap in ArcMap?, I checked the two data sources against a third (a map of the world). The OSM data is right -- British Columbia is in the right spot -- but the City data puts Vancouver in the south of France.


My data sources are:



  1. Bikeways and libraries from the City of Vancouver. (Both are SHP files.) These are the data that don't align with the others.

  2. A map of British Columbia from Open Street Map. I put the data into a database using osm2pgsql.

  3. A world map that's part of the Open Street Style project.



Projections:



  1. The City data are projected in UTM zone10, NAD83 (CSRS). I've selected this in QGIS's Layer Properties screen for those layers. Projection string: +proj=utm +zone=5 +ellps=GRS80 +datum=NAD83 +units=m +no_defs

  2. The OSM maps are in Mercator projection. QGIS has many Mercator choices, and I wasn't sure which one to use, so I guessed "Popular Visualization CRS / Mercator". +proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

  3. For the world map, Quantum GIS loaded the projection from the .prj file. That's +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +over +no_defs


Projected maps should but do not overlap in ArcMap? talks about zone problems. That sounds like what I might be experienceing. So I tried changing the libraries from UTM zone 10N to other zones (15N and 60N) but nothing changed.


Does anyone have suggestions for what to try next?



Answer



What we really have to find out here are the projections of your input data.





  1. City data


    The Shapefile comes with a .prj file that is perfectly interpreted by QGIS. Don't change the layer settings!




  2. OSM data


    If you are using OSM vector data, they are in WGS84 Geographic coordinates (EPSG:4326). Only the raster tiles are in Web Mercator (EPSG:900913).





  3. Open Street Style data


    If QGIS recognized the .prj content, leave it that way.




Finally, chose a project coordinate system (I'd suggest the UTM one) and activate on-the-fly reprojection as @Mike_Toews already explained.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...