NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi

Like the following manual https://wiki.openstreetmap.org/wiki/DE:Bigmap I downloaded a mkmap.pl file. With perl mkmap.pl > mymap.png I tried to create a png file.

During the download sometimes appears: http://tile.openstreetmap.org/11/1097/729.png... 500 Status read failed: Eine vorhandene Verbindung wurde vom Remotehost geschlossen.

Sometrimes appears: http://tile.openstreetmap.org/11/1095/745.png... 500 Can't connect to tile.openstreetmap.org:80 (Invalid argument)

Mostly appears: http://tile.openstreetmap.org/11/1096/748.png... 200 OK

After about 1 hour appears: <html><head> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="refresh" content="0;url=/ui/dboard"> </head></html> not found: Invalid argument at C:/Perl64/lib/GD/Image.pm line 64.

At the end, normally the png-file is empty. Once I had a png File (93MB) but with many white squares.

What do I wrong?

Thanks and best regards!

my mkmap.pl file contains:

!/usr/bin/perl

generated from http://openstreetmap.gryph.de/bigmap.cgi/

permalink for this map: http://openstreetmap.gryph.de/bigmap.cgi?xmin=1066&xmax=1121&ymin=715&ymax=751&zoom=11&scale=256&baseurl=http%3A%2F%2Ftile.openstreetmap.org%2F%21z%2F%21x%2F%21y.png

use strict; use LWP; use GD;

my $img = GD::Image->new(14336, 9472, 1); my $white = $img->colorAllocate(248,248,248); $img->filledRectangle(0,0,14336,9472,$white); my $ua = LWP::UserAgent->new(); $ua->env_proxy; for (my $x=0;$x<56;$x++) { for (my $y=0;$y<37;$y++) { my $xx = $x + 1066; my $yy = $y + 715; foreach my $base(split(/\|/, "http://tile.openstreetmap.org/11/!x/!y.png")) { my $url = $base; $url =~ s/!x/$xx/g; $url =~ s/!y/$yy/g; print STDERR "$url... "; my $resp = $ua->get($url); print STDERR $resp->status_line; print STDERR "\n"; next unless $resp->is_success; my $tile = GD::Image->new($resp->content); next if ($tile->width == 1); if ($base =~ /seamark/) { my $black=$tile->colorClosest(0,0,0); $tile->transparent($black); } $img->copy($tile, $x256,$y256,0,0,256,256); } } } binmode STDOUT; print $img->png();

This question is marked "community wiki".

asked 23 Nov '18, 22:38

test99's gravatar image

test99
21112
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×275
×14
×5

question asked: 23 Nov '18, 22:38

question was seen: 1,327 times

last updated: 23 Nov '18, 22:38

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum