From ef813cec91d53d859c7eae6c5988dde0c9c2c195 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 15 Oct 2014 09:13:23 +0200 Subject: [PATCH] added proper copyright notice to OSM tiles presented at the search result page --- htroot/osm.java | 40 +++++++++++++++++---- source/net/yacy/peers/graphics/OSMTile.java | 2 +- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/htroot/osm.java b/htroot/osm.java index 3728904be..2624d72be 100644 --- a/htroot/osm.java +++ b/htroot/osm.java @@ -1,14 +1,30 @@ -// -//$LastChangedDate$ -//$LastChangedRevision$ -//$LastChangedBy$ -// +/** + * osm + * Copyright 2008 by Michael Peter Christen + * First released 13.02.2011 at http://yacy.net + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program in the file lgpl21.txt + * If not, see . + */ import net.yacy.cora.protocol.RequestHeader; import net.yacy.peers.graphics.OSMTile; import net.yacy.server.serverObjects; import net.yacy.server.serverSwitch; +import net.yacy.visualization.PrintTool; import net.yacy.visualization.RasterPlotter; +import net.yacy.visualization.RasterPlotter.DrawMode; public class osm { @@ -29,7 +45,19 @@ public class osm { } final OSMTile.tileCoordinates coord = new OSMTile.tileCoordinates(lat, lon, zoom); - return OSMTile.getCombinedTiles(coord, width, height); + RasterPlotter map = OSMTile.getCombinedTiles(coord, width, height); + map.setDrawMode(DrawMode.MODE_SUB); + map.setColor(0xffffff); + /* + * copyright notice on OSM Tiles + * According to http://www.openstreetmap.org/copyright/ the (C) of the map tiles is (CC BY-SA) + * while the OpenStreetMap raw data is licensed with (ODbL) http://opendatacommons.org/licenses/odbl/ + * Map tiles shall be underlined with the statement "(C) OpenStreetMap contributors". In our 5-dot character + * set the lowercase letters do not look good, so we use uppercase only. + * The (C) symbol is not available in our font, so we use the letters (C) instead. + */ + PrintTool.print(map, map.getWidth() - 6, map.getHeight() - 6, 0, "(C) OPENSTREETMAP CONTRIBUTORS", 1); + return map; } } \ No newline at end of file diff --git a/source/net/yacy/peers/graphics/OSMTile.java b/source/net/yacy/peers/graphics/OSMTile.java index 49381b77a..ba8152e32 100644 --- a/source/net/yacy/peers/graphics/OSMTile.java +++ b/source/net/yacy/peers/graphics/OSMTile.java @@ -148,7 +148,7 @@ public class OSMTile { } public String url(final int retry) { - // see http://wiki.openstreetmap.org/wiki/Public_Domain_Map + // see http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames final int hash = (this.xtile + 7 * this.ytile + 13 * this.zoom + retry) % 4; final String host = (hash == 3) ? "tile.openstreetmap.org" : ((char) ('a' + hash)) + ".tile.openstreetmap.org"; final String url = "http://" + host + "/" + this.zoom + "/" + this.xtile + "/" + this.ytile + ".png";