diff -Nru ircmarkers-0.14/debian/changelog ircmarkers-0.15/debian/changelog --- ircmarkers-0.14/debian/changelog 2013-09-25 15:28:56.000000000 +0000 +++ ircmarkers-0.15/debian/changelog 2014-06-09 21:54:56.000000000 +0000 @@ -1,3 +1,14 @@ +ircmarkers (0.15-1) unstable; urgency=medium + + * Rename default map projection to square (equirectangular projection), + mercator projection is really something else. + * Fix sinusoidal projection to actually work. + * Add real mercator projection. + * Also draw markers where lat is 0. + * Bump to dh 9 and 3.0 (quilt). + + -- Christoph Berg Mon, 09 Jun 2014 23:54:55 +0200 + ircmarkers (0.14-3) unstable; urgency=low * Set POD encoding utf8. (Closes: #724087) diff -Nru ircmarkers-0.14/debian/compat ircmarkers-0.15/debian/compat --- ircmarkers-0.14/debian/compat 2013-09-25 15:25:18.000000000 +0000 +++ ircmarkers-0.15/debian/compat 2014-06-09 21:48:21.000000000 +0000 @@ -1 +1 @@ -5 +9 diff -Nru ircmarkers-0.14/debian/control ircmarkers-0.15/debian/control --- ircmarkers-0.14/debian/control 2013-09-25 15:25:18.000000000 +0000 +++ ircmarkers-0.15/debian/control 2014-06-09 21:48:19.000000000 +0000 @@ -2,8 +2,8 @@ Section: graphics Priority: extra Maintainer: Christoph Berg -Build-Depends: debhelper (>= 5) -Standards-Version: 3.8.1 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.5 Vcs-Browser: http://svn.df7cb.de/ircmarkers/trunk/ Vcs-Svn: http://svn.df7cb.de/ircmarkers/trunk/ Homepage: http://www.df7cb.de/projects/ircmarkers/ diff -Nru ircmarkers-0.14/debian/copyright ircmarkers-0.15/debian/copyright --- ircmarkers-0.14/debian/copyright 2013-09-25 15:25:18.000000000 +0000 +++ ircmarkers-0.15/debian/copyright 2014-06-09 21:50:48.000000000 +0000 @@ -5,7 +5,7 @@ Copyright: -Copyright (C) 2004, 2005, 2006 Christoph Berg +Copyright (C) 2004-2014 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -54,3 +54,26 @@ whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. + +The test directory contains some maps: + 1920px-Equirectangular-projection.jpg: + http://de.wikipedia.org/wiki/Plattkarte#mediaviewer/Datei:Equirectangular-projection.jpg + Public domain; original by NASA (sensor Terra/MODIS) + + 1920px-Sinusoidal_Projection_11-5-30.jpg: + http://de.wikipedia.org/wiki/Sinusoidal-Projektion#mediaviewer/Datei:Sinusoidal_Projection_11-5-30.jpg + Author: Lars H. Rohwedder (User:RokerHRO) + I, the copyright holder of this work, hereby publish it under the following + licenses: Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + + Normal_Mercator_map_85deg.jpg: + http://commons.wikimedia.org/wiki/File:Normal_Mercator_map_85deg.jpg + Author: Lars H. Rohwedder (User:RokerHRO) + I, the copyright holder of this work, hereby publish it under the following + licenses: Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. diff -Nru ircmarkers-0.14/debian/rules ircmarkers-0.15/debian/rules --- ircmarkers-0.14/debian/rules 2013-09-25 15:25:18.000000000 +0000 +++ ircmarkers-0.15/debian/rules 2014-06-09 21:47:25.000000000 +0000 @@ -1,51 +1,4 @@ #!/usr/bin/make -f -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -VERSION=$(shell dpkg-parsechangelog 2>&1|egrep ^Version|cut -d " " -f 2) - -build: build-stamp -build-stamp: - dh_testdir - $(MAKE) VERSION="ircmarkers $(VERSION)" - touch build-stamp - -clean: - dh_testdir - rm -f build-stamp configure-stamp - $(MAKE) clean - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - $(MAKE) install DESTDIR=$(CURDIR)/debian/ircmarkers - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +%: + dh $@ diff -Nru ircmarkers-0.14/debian/source/format ircmarkers-0.15/debian/source/format --- ircmarkers-0.14/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ ircmarkers-0.15/debian/source/format 2014-06-09 21:47:43.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru ircmarkers-0.14/INSTALL ircmarkers-0.15/INSTALL --- ircmarkers-0.14/INSTALL 2013-09-25 15:25:18.000000000 +0000 +++ ircmarkers-0.15/INSTALL 2014-06-09 15:04:33.000000000 +0000 @@ -35,7 +35,7 @@ Using IrcMarkers ---------------- -You need a map in mercator or sinusoidal projection. The IrcMarkers manpage +You need a map in equirectangular or sinusoidal projection. The IrcMarkers manpage contains some pointers. The example.map file contains a short config file to get started with. diff -Nru ircmarkers-0.14/ircmarkers ircmarkers-0.15/ircmarkers --- ircmarkers-0.14/ircmarkers 2013-09-25 15:28:00.000000000 +0000 +++ ircmarkers-0.15/ircmarkers 2014-06-09 21:06:37.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# Copyright (C) 2003-2008 Christoph Berg +# Copyright (C) 2003-2014 Christoph Berg # # Part of this file originate from example.pl from the MapMarker distribution: # Author : Guillaume Leclanche (Mo-Ize) @@ -20,10 +20,10 @@ use IrcMarkers::File; use IrcMarkers::Map; -my $VERSION = "0.14"; +my $VERSION = "0.15"; sub VERSION_MESSAGE { - print "IrcMarkers $VERSION (C) 2003-2008 Christoph Berg , GNU GPL.\n"; + print "IrcMarkers $VERSION (C) 2003-2014 Christoph Berg , GNU GPL.\n"; } sub HELP_MESSAGE { @@ -111,7 +111,7 @@ my $map = IrcMarkers::Map->new($config); foreach my $marker (@{$config->{markers}}) { - next unless $marker->{lat}; + next unless defined $marker->{lat}; ($marker->{x}, $marker->{y}, $marker->{visible}) = $config->coord2pixel($marker->{lat}, $marker->{lon}); next unless $marker->{visible}; if ($marker->{text} ne "") { @@ -243,7 +243,7 @@ =item -x I Declare input map dimensions. Unless specified otherwise in the config file, -the map is assumed to be in mercator projection. -y specifies the lower/upper +the map is assumed to be in equirectangular projection. -y specifies the lower/upper latitude coordinates, -x the left/right edge longitude. Per default, the map is assumed to be a world map (-y -90/90 -x -180/180). @@ -407,11 +407,11 @@ Size of output map. Default is input map, or size of part selected. -=item projection mercator|sinusoidal +=item projection square|mercator|sinusoidal =item center_lon I
-Map projection. Default is mercator. +Map projection. Default is square, which selects equirectangular projection. center_lon is only used for sinusoidal projection. There is no default for center_lon. @@ -578,7 +578,7 @@ =head1 COPYRIGHT AND LICENSE -Copyright (C) 2003-2008 Christoph Berg +Copyright (C) 2003-2014 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software diff -Nru ircmarkers-0.14/IrcMarkers/File.pm ircmarkers-0.15/IrcMarkers/File.pm --- ircmarkers-0.14/IrcMarkers/File.pm 2013-09-25 15:25:18.000000000 +0000 +++ ircmarkers-0.15/IrcMarkers/File.pm 2014-06-09 21:06:37.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2008 Christoph Berg +# Copyright (C) 2004-2014 Christoph Berg # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ sub new { my $config = { # default values - projection => 'mercator', + projection => 'square', west => -180, north => 90, east => 180, @@ -180,7 +180,7 @@ $config->{view_width} = $1; } elsif(/^view_height (.+)/) { $config->{view_height} = $1; - } elsif(/^projection (mercator|sinusoidal)/) { + } elsif(/^projection (square|mercator|sinusoidal)/) { $config->{projection} = $1; } elsif(/^center_lon (.+)/) { $config->{center_lon} = $1; diff -Nru ircmarkers-0.14/IrcMarkers/Map.pm ircmarkers-0.15/IrcMarkers/Map.pm --- ircmarkers-0.14/IrcMarkers/Map.pm 2013-09-25 15:25:18.000000000 +0000 +++ ircmarkers-0.15/IrcMarkers/Map.pm 2014-06-09 21:40:06.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2008 Christoph Berg +# Copyright (C) 2004-2014 Christoph Berg # # This file originated from the mapmarkers distribution: # @@ -111,15 +111,19 @@ } # handle projection system - if ($config->{projection} eq 'mercator') { + if ($config->{projection} eq 'square') { + # degree per pixel RESolution + $config->{xres} = ($config->{east} - $config->{west}) / $config->{w}; + $config->{yres} = ($config->{north} - $config->{south}) / $config->{h}; + } elsif ($config->{projection} eq 'mercator') { # degree per pixel RESolution $config->{xres} = ($config->{east} - $config->{west}) / $config->{w}; $config->{yres} = ($config->{north} - $config->{south}) / $config->{h}; } elsif ($config->{projection} eq 'sinusoidal') { die "center_lon must be defined for sinusoidal maps" unless defined $config->{center_lon}; # These 2 are not in pixels, but in absolute coordinates. To get pixels, they should be multiplied by $xres. - $config->{Xleft} = ($config->{west} - $config->{center_lon}) * cos($config->{north} * $degtorad); - $config->{Xright} = ($config->{east} - $config->{center_lon}) * cos($config->{south} * $degtorad); + $config->{Xleft} = ($config->{west} - $config->{center_lon}); + $config->{Xright} = ($config->{east} - $config->{center_lon}); # number of unitary graduation / pixel for x (RESolution) $config->{xres} = ($config->{Xright} - $config->{Xleft}) / $config->{w}; @@ -141,16 +145,24 @@ my($x, $y, $X0); my $vis = 1; - if ($config->{projection} eq 'mercator') { + if ($config->{projection} eq 'square') { # pixel values, sprintf rounds to nearest $x = sprintf("%d", ($lon - $config->{west}) / $config->{xres}); $y = sprintf("%d", ($config->{north} - $lat) / $config->{yres}); $vis = 0 if ($lon > $config->{east} or $lon < $config->{west} or $lat > $config->{north} or $lat < $config->{south}); + } elsif ($config->{projection} eq 'mercator') { + $x = sprintf("%d", ($lon - $config->{west}) / $config->{xres}); + $lat = 89.9 if ($lat == 90); + $lat = -89.9 if ($lat == -90); + my $yrad = $lat * $degtorad; + my $yscaled = 0.5 * log((1 + sin $yrad) / (1 - sin $yrad)); + $y = sprintf("%d", $config->{h} / 2 - ($yscaled * $radtodeg / $config->{xres})); + $vis = 0 if ($lon > $config->{east} or $lon < $config->{west} or $lat > $config->{north} or $lat < $config->{south}); } elsif ($config->{projection} eq 'sinusoidal') { # absolute X $X0 = ($lon - $config->{center_lon}) * cos($lat * $degtorad); # pixel values - $x = sprintf("%d", ($X0 - $config->{Xleft}) / $config->{xres}); + $x = sprintf("%d", ($X0 - $config->{west}) / $config->{xres}); $y = sprintf("%d", ($config->{north} - $lat) / $config->{yres}); $vis = 0 if ($X0 < $config->{Xleft} or $X0 > $config->{Xright} or $lat > $config->{north} or $lat < $config->{south}); } Binary files /tmp/34xUM3rSl0/ircmarkers-0.14/test/1920px-Equirectangular-projection.jpg and /tmp/oy8YKpELSD/ircmarkers-0.15/test/1920px-Equirectangular-projection.jpg differ Binary files /tmp/34xUM3rSl0/ircmarkers-0.14/test/1920px-Sinusoidal_Projection_11-5-30.jpg and /tmp/oy8YKpELSD/ircmarkers-0.15/test/1920px-Sinusoidal_Projection_11-5-30.jpg differ diff -Nru ircmarkers-0.14/test/Makefile ircmarkers-0.15/test/Makefile --- ircmarkers-0.14/test/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ ircmarkers-0.15/test/Makefile 2014-06-09 21:22:15.000000000 +0000 @@ -0,0 +1,16 @@ +test: square.jpg mercator.jpg sinusoidal.jpg + +test%.map: + for lat in $$(seq -90 $* 90); do for lon in $$(seq -180 $* 180); do echo $$lat $$lon \"$$lat $$lon\"; done; done > $@ + +square.jpg: test15.map ../ircmarkers ../IrcMarkers/*.pm + perl -I .. ../ircmarkers test15.map 1920px-Equirectangular-projection.jpg $@ + +mercator.jpg: test10.map mercator.map ../ircmarkers ../IrcMarkers/*.pm + perl -I .. ../ircmarkers mercator.map Normal_Mercator_map_85deg.jpg $@ + +sinusoidal.jpg: test10.map sinusoidal.map ../ircmarkers ../IrcMarkers/*.pm + perl -I .. ../ircmarkers sinusoidal.map 1920px-Sinusoidal_Projection_11-5-30.jpg $@ + +clean: + rm -f square.jpg mercator.jpg sinusoidal.jpg test*.map diff -Nru ircmarkers-0.14/test/mercator.map ircmarkers-0.15/test/mercator.map --- ircmarkers-0.14/test/mercator.map 1970-01-01 00:00:00.000000000 +0000 +++ ircmarkers-0.15/test/mercator.map 2014-06-09 21:22:00.000000000 +0000 @@ -0,0 +1,4 @@ +projection mercator +lat -85/85 + +#include "test10.map" Binary files /tmp/34xUM3rSl0/ircmarkers-0.14/test/Normal_Mercator_map_85deg.jpg and /tmp/oy8YKpELSD/ircmarkers-0.15/test/Normal_Mercator_map_85deg.jpg differ diff -Nru ircmarkers-0.14/test/README ircmarkers-0.15/test/README --- ircmarkers-0.14/test/README 1970-01-01 00:00:00.000000000 +0000 +++ ircmarkers-0.15/test/README 2014-06-09 21:46:29.000000000 +0000 @@ -0,0 +1,19 @@ +Simple test cases for ircmarker projections. To produce output, type "make". + +Source: + +1920px-Equirectangular-projection.jpg: +http://de.wikipedia.org/wiki/Plattkarte#mediaviewer/Datei:Equirectangular-projection.jpg +Public domain; original by NASA (sensor Terra/MODIS) + +1920px-Sinusoidal_Projection_11-5-30.jpg: +http://de.wikipedia.org/wiki/Sinusoidal-Projektion#mediaviewer/Datei:Sinusoidal_Projection_11-5-30.jpg +Author: Lars H. Rohwedder (User:RokerHRO) +I, the copyright holder of this work, hereby publish it under the following licenses: +Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + +Normal_Mercator_map_85deg.jpg: +http://commons.wikimedia.org/wiki/File:Normal_Mercator_map_85deg.jpg +Author: Lars H. Rohwedder (User:RokerHRO) +I, the copyright holder of this work, hereby publish it under the following licenses: +Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. diff -Nru ircmarkers-0.14/test/sinusoidal.map ircmarkers-0.15/test/sinusoidal.map --- ircmarkers-0.14/test/sinusoidal.map 1970-01-01 00:00:00.000000000 +0000 +++ ircmarkers-0.15/test/sinusoidal.map 2014-06-09 20:38:38.000000000 +0000 @@ -0,0 +1,5 @@ +projection sinusoidal +# 11°5′30″ +center_lon 11.0916666 + +#include "test10.map"