pombreda / gmapcatcher

Automatically exported from code.google.com/p/gmapcatcher
0 stars 0 forks source link

Export to PDF option (working code attached) #290

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What new or enhanced feature are you proposing?
A way to export a region (map) to a PDF consisting in one page, or several 
pages in a mosaic of tiles, to be able to print it later. This issue also 
solves the issue 279.

What goal would this enhancement help you achieve?
Although you can export a map to .png is rather difficult to cut it in several 
pages (as a grid of 5 x 5 A4 pages for example) if the file is too big. There 
are few programs that support this feature (print an image in a grid of pages) 
AND at the same time, that can open a really big png file.

Thus, it will be great if we can export from the tilestore.db database, smaller 
images, one for every page. Since there are many things that "will be great if 
...", I wrote a (again) rude python program that reads directly the 
tilestore.db and creates a .pdf file with the required region, zoom, and dpi, 
with the map of that region split in several pages. As you see in the main 
function, there's no command line interface, you have to write your call to 
mapPDF() there, but the interface is pretty flexible to achieve whatever you 
want. To run this sample program, you need to call ./mapexport 
path/to/tilestore.db there this .db is the sqlite of gmapcatcher with all the 
layers in the same DB, or, it could be also a RMaps sqlite file (see RMaps app 
for android). Please note that you need to download the tiles with maps.py or 
download.py before using this program. I think that it could be easy to add 
this feature to your program. You need reportab module to create the PDF. There 
are many options hard-coded in the program as constants (example, the page 
margin, the size the overlaps with the next page, etc.)

Original issue reported on code.google.com by ade...@gmail.com on 8 Nov 2011 at 11:39

Attachments:

GoogleCodeExporter commented 9 years ago
I see that you have multiple ideas, send me an email to heldersepu (at) 
gmail.com 
and I will add you to this project.

Original comment by heldersepu on 8 Nov 2011 at 11:43

GoogleCodeExporter commented 9 years ago
Working example added in r1172. The code uses the tileStore in the current 
configuration to access the map services. It works with every mapSource. Needs 
some integration with the GUI.

Original comment by ade...@gmail.com on 15 Nov 2011 at 1:13