[OSM-talk] Huge batch of 1hz Mexico/Central America data
Richard Fairhurst
richard at systemeD.net
Sat May 10 10:44:41 BST 2008
Beau Gunderson wrote:
> I've driven to Belize City from Seattle with a 1hz GPS logger and
> am wondering the best way to upload the data to OSM.
>
> You can see the route here:
>
> http://www.bylandandsea.org/map
>
> I've got it in GPX files that are each a day's drive long and also
> as one giant GPX (180mb or so at current count).
>
> Should I use the web upload feature or is there an easier way to do
> batch uploads? Upload the gigantic file or all of the small ones?
Looks great.
Agreed with Lauri that you should avoid uploading the gigantic file
because it'll block the server for others.
You can certainly use the batch upload scripts that DT pointed to.
However, it would be kind to only upload five or so at a time, and
wait for them to finish before uploading any more. Uploading a lot at
once blocks the queue for others and can make you very unpopular when
everyone is trying to upload their weekend's work!
If you don't mind a bit of Perl, you can upload a GPX to OSM like this:
use HTTP::Request::Common;
use LWP::UserAgent;
$ua=LWP::UserAgent->new;
$ua->credentials('www.openstreetmap.org:80','Web Password',
$yourusername, $yourpassword);
$response=$ua->request(POST 'http://www.openstreetmap.org/api/0.5/
gpx/create',
Content_Type => 'form-data',
Content => [ file =>[$filename],
description=>$description,
tags =>$tags,
public =>"1" ] );
if ($response->code==200) {
# yay, success
} else {
# boo, failure
}
...from which a batch uploader (again, perhaps pausing every so
often) can be very easily constructed.
cheers
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20080510/9ac56f9c/attachment.html>
More information about the talk
mailing list