Adding a GeoBackground to a GeoGraphics increases the file size enormously. Does anybody have any ideas for minimising the resulting size?
Adding a ReliefMap background to a simple plot increase the file size from 4kB to 4.3MB. Adding a selection of plots (5) means the resulting file is too large to send by email.
Raising this question immediately alerted me to the possibility that you highlight. It will be necessary for me to have an automated method of choosing and automated way of choosing GeoZoomLevel dependent upon the range of data to be plotted. GeoResolution however is new to me. Thanks.
I have used GeoResolution which reduces the zoom level but the ByteCount has not changed and is approximately equal to the number of pixels x 4 where the number of pixels seems sufficient to populate the screen fully. ImageResize just makes the image smaller.
What appears to be missing is some sort of compression such as JPG for the background which could easily reduce the file and memory size by a factor of about 8. The lines drawn on the background are vector graphics which are relatively small.
Converting the notebook to pdf does not improve the file size, in fact, the notebook with many pictures increases to about double the size on using NotebookPrint[nb,pfilename].
Jack, thanks for you contribution but I am referring to the saving or printing of the complete notebook as pdf.
I have finally solved the issue by saving the file as pdf with the extension tmp and then converting the tmp to pdf using Ghostscript. I enclose the function compressPDF which works amazingly reducing the file size from a typical 60MB to 2MB.
I suspect the original issue may be related to the fact that certain kinds of graphics, notably GeoGraphics, get converted to rasterized form on conversion to PDF. It seems to be especially true for GeoGraphics with background imagery, and even happens to any overlaid ‘vector’ graphics. My hypothesis is that the need to maintain the illusion of sharp vector graphics means that the rasterization happens at very high resolution, much higher than (and essentially independently of) any background image.
Why a hybrid PDF with both raster and vector components can’t be created in certain cases is unclear.