7

I am working with QGis 2.8 and want to use the print composer to create a jpg image. I used this PlugIn (https://github.com/jdugge/ClipToHemisphere) to create the globe.

The graticules I created the following.

  1. Set Projection of Project to WGS 84
  2. Open World Map Layer which was not processed by the Plug In (I tried it with the processed one as well, that did not change the outcome)
  3. Create a VectorGird with the extend of World Layer loaded in step 1
  4. Densify the Geometry

That left me with a nice grid.

Then I went into the projects properties and set the projection to my custom CRS which is centered in Afghanistan. In the Rendering properties I had to unselect "Simplify Geometry" (for all my layers, not just the grid layer). I open the Print Composer and all looks good. But when I save the created globa as an image, there are lines which I did not see before. I have no idea where they are coming from...

Thats how it looks in the print composer. PrintComposer

Thats how the exported image looks like. Exported Image

Any thoughts on this?

  • Not sure it will work,but have you tried exporting a PNG instead of JPEG? PNG can create hollow background, and JPEG can not. Might be that the pront composer hide the lines that you see, but exporting to a JPEG un-hide them – dof1985 Mar 30 '15 at 8:57
  • @dof1985 No, I have not tried that yet. I will tonight and let you know. I tried it as a PDF but that did not help neither. – Stophface Mar 30 '15 at 11:41
  • Can you try with a current development snapshot of QGIS, and disable the automatic clipping for the grid layer? It's under the advanced button for the symbol. I'd be interested to hear if this fixes the problem. – ndawson Mar 30 '15 at 18:32
  • @ndawson can you sepcify that? – Stophface Mar 30 '15 at 21:12
  • @dof1985 a png still gives the same lines. – Stophface Mar 30 '15 at 21:14
3

I think I might have a solution. That is if something in your workflow is missing.

I have replicated your workflow, but would like to emphasize the following. If this is what you've done, so hopefully the bug report would be useful, otherwise this might help.

Note that I have used World_from_space projection, with central meridian set to 0.0, 0.0

+proj=ortho +lat_0=0.0 +lon_0=0.0 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs

Also note that clipping to hemisphere was done using the same 0.0, 0.0 for both lat and long of the central hemisphere.

Last, I would like to stress out, that I produced the grid (polygons) based upon an unclipped layer of the world countries (from DIVA-GIS) using WGS-84. Than I clipped both layers through the plugin, by layer extent and 0.0, 0.0

Those are the results in the map composer, and in a png.

MapComposer

PNG

I think that the main things that are important is:

  1. clip both layer and grid with the plugin.
  2. Make sure the "latitude (and longtitude) of center hemisphere" are identical to +lat_0=0.0 +lon_0=0.0 (those that are defined in your projection)
  3. When creating my grid I set it to create polygons, rather than polylines.
  • Ah, now I understand your answer. Did not quite get when you posted it on the bug report! Yes, I created the grid layer based on the world map layer which was processed with the Clip to hemisphere plug in beforehand. Just to get it right: You created the grid layer based on the world map layer(both unprocessed by the clip to hemisphereplug in) in WGS 84. After that, you used the clip to hemisphere plug in with the coordinates you needed (in your case+lat_0=0.0 +lon_0=0.0) on both layers (word map and grid layer) and finally set the projection to the custom CRS? – Stophface Apr 14 '15 at 11:33
  • @Stophface, exactly. Note that I've changed on-the-fly projection only. – dof1985 Apr 14 '15 at 12:04
  • Hm, that does not do the trick for me. I open a new project, import the world map layer and create the grid based on that layer. Everything is in WGS84. The project and my two layers. When I use the Clip to Hemisphere plug in on the two layers, it asks me how I want it projected. I tried both now, my custom CRS and WGS84. Then I set my project properties to my custom CRS using the same lat and long as I used in clip to hemisphere. I uncheck simplyfiy geometry and my results look like this: s30.postimg.org/ee22tc269/… – Stophface Apr 15 '15 at 6:51
  • Forgot to mention - Create the grid as polygons. I will edit it into my answer. Note that using polylines as grid, I have recieved an odd, similar to what you refer to, output, in both print composer and export. – dof1985 Apr 15 '15 at 7:15
  • Ah that did the trick! Thanks a lot for your effort :) Since you seem to know your way around QGis and everything I have another question. I downloaded and installed PostgreSQL and PostGIS from here kyngchaos.com/software/postgres (working on OS X 10.10). How would I get that to run? When I go into the terminal and type psql it says command not found... Is there anything I need to consider apart from just installing the .dmg package? – Stophface Apr 15 '15 at 8:08

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.