jmiglesias / gmapcatcher

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

Mass download tiles from a path (GPX) instead of only a location or region #289

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What new or enhanced feature are you proposing?
To be able to download a series of tiles from a given path provided in a GPX 
file.

What goal would this enhancement help you achieve?

The download command line tool is useful when you want to download "the map" of 
a city for example (and then copy it to your phone to have it in a country 
where you don't have 3G). But sometimes you travel along a route, and you will 
like to download all the tiles in your planed path. This is sometimes difficult 
to define as simply a rectangular region.

I modified the current SVN version (r1168) with the attached patch to achieve 
this. The "download.py" tool takes an argument "gpx" with the gpx file. The GPX 
parsing is done in the download.py file (you will probably want to move those 
functions somewhere else). The code is just a suggestion, and you could use it 
freely and modify it. The GPX parsing is made with lxml.etree . I'm using GPX 
files from Google Maps using the gm2gpx "extension" so I can define the path 
freely and the obtain the gpx.
Please also note that the "arround" parameter (the amount of _tiles_ downloaded 
around the path) should be in some way specified using the interface (with the 
--width parameter perhaps?). I left it in the default=2.

Good work!

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

Attachments:

GoogleCodeExporter commented 8 years ago
Great! patch applied see r1169 

A request like this I will normally ignore it, we got plenty of headaches with 
the Mass download, but you went the extra mile an code it yourself.

If you have more ideas let me know I can add your email to the list of 
Committer in that way to can add your ideas.

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

GoogleCodeExporter commented 8 years ago
http://code.google.com/p/gmapcatcher/source/diff?spec=svn1169&r=1169&format=side
&path=/trunk/download.py

the line 26 in the for loop I guess that was unintended, right?

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

GoogleCodeExporter commented 8 years ago
Oh, yes. I saw that line in the diff but I though that the change was a space 
at the end of the line or something like that since my editor loves to remove 
those things. But no, I made other changes that I manually revert before 
creating this diff and it seems that I broke that line =). Rollback that line 
please.

Original comment by ade...@gmail.com on 8 Nov 2011 at 11:45

GoogleCodeExporter commented 8 years ago
1-download.py
Download tiles from a path GPX Failure in routes that include long straights 
(should intuit the intermediate points on the straights routes). Works well 
with curved routes with many points.

2-download.exe
Does not work for download tiles from a path (GPX). 

Original comment by madelein...@gmail.com on 18 Dec 2011 at 4:02

GoogleCodeExporter commented 8 years ago
Hi!
That part of the code is more or less experimental. If remember well, I wrote 
it in a way that takes into account those long straight lines... but it could 
be wrong. Please, could you provide me an example GPX failing?

2 - download.exe
No idea. I use this in linux =) never tried it in windows... but seems to be a 
dependence problem.

Original comment by ade...@gmail.com on 19 Dec 2011 at 6:52

GoogleCodeExporter commented 8 years ago
1 - Attached file "long_straight.zip" Converted of KML to GPX
    with two different programs.
    I intend to download only 1 km. around the route.

2 - I have a installed "lxml-2.3.win32-py2.7.exe" and
    "download.py" works but fails with all the straights and
    "download.exe" no work with gpx (lxml dependency fails).

    madeleinesobradi@gmail.com

Original comment by madelein...@gmail.com on 20 Dec 2011 at 7:52

Attachments:

GoogleCodeExporter commented 8 years ago
Instead of lxml we should use xml.dom.minidom, take a look at xmlUtils i'm 
already using it there:
http://code.google.com/p/gmapcatcher/source/browse/trunk/gmapcatcher/xmlUtils.py

Original comment by heldersepu on 20 Dec 2011 at 1:12

GoogleCodeExporter commented 8 years ago
Hi!
I moved the function load_gpx_coords() to xmlUtils.py and changed it to use 
minidom as suggested. The problem wasn't the "straight lines" but the format of 
the gpx file. Now it just looks for waypoints and doesn't really looks at the 
structure of the file (that could have several tracks). So, don't use it with 
more than one track per file!

BTW, the "width" command line parameter doesn't work for this. I putted this in 
the default of 3 tiles around the path for every zoom level (this means that 
for deeper zooms the range (in km) is smaller, but 3 tiles around the path 
seems to be enough if you want to find a way to recover the path if you took 
the wrong turn ;-).

I'm open to suggestions about a good command line interface for this parameter.

Original comment by ade...@gmail.com on 20 Dec 2011 at 4:57

GoogleCodeExporter commented 8 years ago

Original comment by heldersepu on 27 Feb 2012 at 2:00