8

I'm trying to create a globe view in QGIS 2.6 with an Azimuthal Orthographic projection using NaturalEarth's 110m countries dataset.

I'm following Hamish Campbell's blog post instructions that have been replicated by other users (eg here).

Problem 1

Using Hamish's recommended projection parameters with my lats/longs: +proj=ortho +lat_0=36.5 +lon_0=-118.8 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs to define a custom projection gives this result:

Azimuthal Orthographic attempt

Lots of artefacts - what am I doing wrong / is it a bug?.

Problem 2

But Hamish mentions the presence of artefacts (I wouldn't have thought the sort of artefacts I'm encountering but...) and recommends using some python to clip the dataset to the circle of the globe from the projection view.

I won't reproduce the python Hamish publishes (you can view it in step 2 in his post linked above) but having saved the file as clipper.py in QGIS python path, imported into the QGIS python window (import clipper) and done clipper.doCall(iface,36.5,-118.8) I don't get a new layer generated in the map window.

Are there any obvious things I might be doing wrong?


enter image description here

enter image description here

7
  • The command should be clipper.doClip(iface,36.5,-118.8).
    – AndreJ
    Commented Dec 22, 2014 at 16:00
  • Yes. doCall was a copy paste error I have used doClip
    – Mark Ruddy
    Commented Dec 22, 2014 at 20:32
  • 1
    Hey, nice to see this blog post is helping people :). I've tried running through it again in qgis 2.6 (previously was a much older version) and it seemed to work, so I'm not sure why the new layer isn't appearing in your layers list. One note though: if you're getting simplified geometries (the boxes in the first image), go to layer properties > rendering and turn off "simplify geometry".
    – Hamish
    Commented Dec 22, 2014 at 20:42
  • (worth mentioning that the python was lifted from this excellent post: gis.stackexchange.com/questions/78346/…)
    – Hamish
    Commented Dec 22, 2014 at 20:44
  • @Hamish hello! great blog and right to credit original GISSE post. Removing "simplify geomerty" did the trick superbly for aeqd - so simple. I'll retry the ortho projection now...
    – Mark Ruddy
    Commented Dec 22, 2014 at 20:51

4 Answers 4

8

Newer versions of QGIS have 'simplified geometries' enabled by default. As a result you might get an image like this:

enter image description here

To disable simplified geometries, untick the "Simplify geometries" option in the layer rendering options.

enter image description here

I'll update the blog post when I can.

0
7

I recommend reprojecting the shapefile first.

The On-the-fly-reprojection of QGIS is sometimes not able to cope with strange projections.

And make sure you are always working on a sphere. Mixing ellipsoid and sphere might also produce artefacts.

The method by Hamish works for me. I added a Vector -> Geometry -> Densify on the grid before reprojecting to Ortho:

enter image description here

If you reproject the clipped part of the world to aeqd, it does not really look the same:

enter image description here

The degree grid does not give a perspective view as the ortho projection provides. The aeqd definition promises equdistance, that's opposite to the perspective ortho view.

6
  • Thanks for the advice. On trying to reproject the ne_110m.shp I came across a projection error that relates to the extent of the layer (found some Qs on gis.stackexchange relating to it). Don't have time deal with that now & attempted Azimuthal Equidistant for laughs. Workflow: 1) Define projection +proj=aeqd +lat_0=36.5 +lon_0=-118.8 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs, 2) Create vector grid, 3) run clipper.doCall(iface,36.5,-118.8), 4) clip countries and grid, 5) change projection to aeqd. Gets a nice result which is an Azi Orthographic not Azi Equidistant. So now how to get AzEq?
    – Mark Ruddy
    Commented Dec 22, 2014 at 14:56
  • aeqd does not need any clipping, it can show the whole world except your antipode. See this topic on aeqd: gis.stackexchange.com/questions/68938/…
    – AndreJ
    Commented Dec 22, 2014 at 16:04
  • I'm finding this puzzling. I know aeqd displays the whole globe but using +proj=aeqd +lat_0=36.5 +lon_0=-118.8 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs gives my an orthogonal projection - see image showing natural earth ne_110m_countries wrapped around globe (see additional image attached above)
    – Mark Ruddy
    Commented Dec 22, 2014 at 19:57
  • You should better use aeqd with +R=6371000 instead of +datum=WGS84. PROJ.4 has some problems with ellipsoids on the aeqd projection, see trac.osgeo.org/proj/ticket/211.
    – AndreJ
    Commented Dec 22, 2014 at 20:20
  • Agree it isn't the same. My point is that using +proj=aeqd +lat_0=36.5 +lon_0=-118.8 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs in my instance does not produce an azimuthal equidistant projection (like this). Using +R=6371000 produces artefacts with +proj=ortho and aeqd
    – Mark Ruddy
    Commented Dec 22, 2014 at 20:20
4

As mentioned in the previous answer, the "Clip to Hemisphere" plugin will do the job.

Even easier: there is a "Globe builder" plugin which lets you:

  • Select Natural Earth Countries / Graticules
  • Select the desired projection and center position
  • Generate the appropriate map layer or layout item, all in one click

enter image description here

2

For people like me who think that Python is just a big snake, you can find now an excellent "Clip to Hemisphere" plugin in QGIS, wich does exactly the same work than the python code above. After installing the plugin, you can find the tool in the Processing Toolbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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