I am trying to build a base map for North America with political boundaries, lakes&rivers, ecoregions, and oceans in QGIS. I can retrieve shapefiles from opensource websites that provide the data that I want but they are in different projections and aren't displayed correctly (below is the image of the map when the files are imported directly as is to the map).

The North American data are in US National equal area (ESPG 2163) and the ocean shapefile is in WSG 84. The current map projection is ESPG 2163 (which is better than WSG 84 at my map extent).

enter image description here

Attempts: I tried to reproject the ocean shapefile with "Save as... " and setting CRS to ESPG 2163 to the ocean shapefile but it still displays the oceans backwards in parts of the map at different scales (the polygon covers the landmass instead of the ocean).

Is there a reprojection that I can use to make the ocean shapefile "fit" properly? Or is it a problem with the ocean shapefile itself that can't handle other projections in which case any suggestions for open ocean shapefiles?

Details on files:

Ocean shapefile: WSG 84 (+proj=longlat +datum=WGS84 +no_defs) http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-ocean/ (note: the ne_10m_lakes file from the same source does not have a wonky projection in the map)

North America Spatial data (shapefiles with political boundaries, lakes&rivers, ecoregions): ESPG 2163 (+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs) https://www.sciencebase.gov/catalog/item/4fb545b6e4b04cb937751d3d

  • what happens if you don't "reproject" the oceans - just drag and drop the file in there with OTF reprojection on. – Ian Turton May 4 '17 at 16:21
  • With regards to the oceans shapefiles. I wonder if the sign of the longitude or latitude may be incorrect, and the dateline issue does appear to have an affect in your case. – jbgramm May 4 '17 at 17:13

I think iant touched on the problem... artifacts like this are often down to features crossing the "dateline" (or more correctly, the antimeridian, 180W/E). I find this is the case in some (but not all) of the Natural Earth shapefiles, for instance. When a line crosses this meridian, the end result is usually a line that cuts across the map.

I'd suggest using ogr2ogr with the -wrapdateline option to create new shapefiles clipped to the bounding box of WGS84. Then try projecting (or using OTF projection) to your new projection, and see if that improves things.

ogr2ogr is a command line tool. As far as i know it's installed alongside QGIS. You should be able to run it from a terminal window (linux/mac) or osgeo4w shell (windows). The manual page includes an example (near the bottom)

something like this should work. Confusingly, you put the output filename first. Gets me every time ;-)

ogr2ogr -wrapdateline -t_srs EPSG:4326 output.shp input.shp

There seems to be a consensus that the issue lies in the ocean shapefile from Natural Earth. As an alternative, the Water Polygons from openstreetmapdata.com work fine. (I searched for other ocean shapefiles after it was clear it was the shapefile causing issues). I prefer the 22MB shapefile ("Simplified polygons, use for zoom level 0-9") because it is faster to load and the other shapefile ("Large polygons are split", 437MB) is composed of many small polygons and slow to load.

working polygon


  • 1
    good call. It's worth noting they have a generalised/simplified version which is more compact and easier to work with for this sort of scale. – Steven Kay May 4 '17 at 18:43

There definitely seems to be some mathematical instability regarding the Oceans polygons and that projection (and others).

The quick and easy answer is to use project properties to change the background color to blue.

enter image description here

The longer, harder way is to clip the ocean to the bounding box of the epsg:2163 but annoyingly they cross the anti-meridian ( 167.65 15.56 -65.69 74.71) so you'll need two boxes and then stitch them together.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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