From: Pierre-Luc Beaudoin Date: Tue, 3 Mar 2009 21:14:35 +0000 (+0200) Subject: Remove dead code X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=152138fe060346d9c46708e8e9623979ded75bfb;p=libchamplain Remove dead code --- diff --git a/champlain/sources/mffrelief.c b/champlain/sources/mffrelief.c deleted file mode 100644 index 8f7c3ee..0000000 --- a/champlain/sources/mffrelief.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2008 Pierre-Luc Beaudoin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sources/mffrelief.h" - -#include "champlain-map.h" - -#include -#include - - -//http://wiki.openstreetmap.org/index.php/Slippy_map_tilenames#C.2FC.2B.2B - -guint mff_relief_row_count(Map *map, guint zoom_level); -guint mff_relief_column_count(Map *map, guint zoom_level); -ChamplainTile *mff_relief_get_tile (Map *map, guint zoom_level, guint x, guint y); - -gint mff_relief_longitude_to_x (Map *map, gdouble longitude, guint zoom_level); -gint mff_relief_latitude_to_y (Map *map, gdouble latitude, guint zoom_level); -gdouble mff_relief_x_to_longitude (Map *map, gint x, guint zoom_level); -gdouble mff_relief_y_to_latitude (Map *map, gint y, guint zoom_level); - -gchar *mff_relief_get_tile_filename(Map *map, ChamplainTile *tile); -gchar *mff_relief_get_tile_uri(Map *map, ChamplainTile *tile); - -void -mff_relief_init(Map *map) -{ - map->name = "Maps For Free Relief"; - map->license = "Map data available under GNU Free Documentation license, Version 1.2 or later"; - map->license_uri = "http://www.gnu.org/copyleft/fdl.html"; - map->zoom_levels = 11; - map->tile_size = 256; - - map->get_row_count = mff_relief_row_count; - map->get_column_count = mff_relief_column_count; - - map->longitude_to_x = mff_relief_longitude_to_x; - map->latitude_to_y = mff_relief_latitude_to_y; - map->x_to_longitude = mff_relief_x_to_longitude; - map->y_to_latitude = mff_relief_y_to_latitude; - - map->get_tile_filename = mff_relief_get_tile_filename; - map->get_tile_uri = mff_relief_get_tile_uri; -} - -guint mff_relief_row_count(Map *map, guint zoom_level) -{ - return pow (2, zoom_level); -} - -guint -mff_relief_column_count(Map *map, guint zoom_level) -{ - return pow (2, zoom_level); -} - -gint -mff_relief_longitude_to_x (Map *map, gdouble longitude, guint zoom_level) -{ - return ((longitude + 180.0) / 360.0 * pow(2.0, zoom_level)) * map->tile_size; -} - -gint -mff_relief_latitude_to_y (Map *map, gdouble latitude, guint zoom_level) -{ - return ((1.0 - log( tan(latitude * M_PI/180.0) + 1.0 / cos(latitude * M_PI/180.0)) / M_PI) / 2.0 * pow(2.0, zoom_level)) * map->tile_size; -} - -gdouble -mff_relief_x_to_longitude (Map *map, gint x, guint zoom_level) -{ - gdouble dx = (float)x / map->tile_size; - return dx / pow(2.0, zoom_level) * 360.0 - 180; -} - -gdouble -mff_relief_y_to_latitude (Map *map, gint y, guint zoom_level) -{ - gdouble dy = (float)y / map->tile_size; - double n = M_PI - 2.0 * M_PI * dy / pow(2.0, zoom_level); - return 180.0 / M_PI * atan(0.5 * (exp(n) - exp(-n))); -} - -gchar *mff_relief_get_tile_filename(Map *map, ChamplainTile *tile) -{ - gint x, y, level; - g_object_get (G_OBJECT (tile), "x", &x, "y", &y, "zoom-level", &level, NULL); - return g_build_filename (g_strdup_printf("%d_%d_%d.png", level, y, x), NULL); -} - -gchar *mff_relief_get_tile_uri(Map *map, ChamplainTile *tile) -{ - gint x, y, level; - g_object_get (G_OBJECT (tile), "x", &x, "y", &y, "zoom-level", &level, NULL); - return g_strdup_printf("http://maps-for-free.com/layer/relief/z%d/row%d/%d_%d-%d.jpg", level, y, level, x, y); -} diff --git a/champlain/sources/mffrelief.h b/champlain/sources/mffrelief.h deleted file mode 100644 index 196dbfe..0000000 --- a/champlain/sources/mffrelief.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2008 Pierre-Luc Beaudoin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef MFF_RELIEF_H -#define MFF_RELIEF_H - -#include "champlain-map.h" - -void mff_relief_init(Map* map); - -#endif diff --git a/champlain/sources/oam.c b/champlain/sources/oam.c deleted file mode 100644 index 0c8bb97..0000000 --- a/champlain/sources/oam.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2008 Pierre-Luc Beaudoin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sources/oam.h" - -#include "champlain-map.h" - -#include -#include - -guint oam_row_count(Map *map, guint zoom_level); -guint oam_column_count(Map *map, guint zoom_level); -ChamplainTile *oam_get_tile (Map *map, guint zoom_level, guint x, guint y); - -gint oam_longitude_to_x (Map *map, gdouble longitude, guint zoom_level); -gint oam_latitude_to_y (Map *map, gdouble latitude, guint zoom_level); -gdouble oam_x_to_longitude (Map *map, gint x, guint zoom_level); -gdouble oam_y_to_latitude (Map *map, gint y, guint zoom_level); - -gchar *oam_get_tile_filename(Map *map, ChamplainTile *tile); -gchar *oam_get_tile_uri(Map *map, ChamplainTile *tile); - -void -oam_init(Map *map) -{ - map->name = "OpenArialMap"; - map->license = "Map data is CC BY 3.0 by OpenArialMap Contributors"; - map->license_uri = "http://creativecommons.org/licenses/by/3.0/"; - map->zoom_levels = 17; - map->tile_size = 256; - - map->get_row_count = oam_row_count; - map->get_column_count = oam_column_count; - - map->longitude_to_x = oam_longitude_to_x; - map->latitude_to_y = oam_latitude_to_y; - map->x_to_longitude = oam_x_to_longitude; - map->y_to_latitude = oam_y_to_latitude; - - map->get_tile_filename = oam_get_tile_filename; - map->get_tile_uri = oam_get_tile_uri; -} - -guint oam_row_count(Map *map, guint zoom_level) -{ - return pow (2, zoom_level); -} - -guint -oam_column_count(Map *map, guint zoom_level) -{ - return pow (2, zoom_level); -} - -gint -oam_longitude_to_x (Map *map, gdouble longitude, guint zoom_level) -{ - return ((longitude + 180.0) / 360.0 * pow(2.0, zoom_level)) * map->tile_size; -} - -gint -oam_latitude_to_y (Map *map, gdouble latitude, guint zoom_level) -{ - return ((1.0 - log( tan(latitude * M_PI/180.0) + 1.0 / cos(latitude * M_PI/180.0)) / M_PI) / 2.0 * pow(2.0, zoom_level)) * map->tile_size; -} - -gdouble -oam_x_to_longitude (Map *map, gint x, guint zoom_level) -{ - gdouble dx = (float)x / map->tile_size; - return dx / pow(2.0, zoom_level) * 360.0 - 180; -} - -gdouble -oam_y_to_latitude (Map *map, gint y, guint zoom_level) -{ - gdouble dy = (float)y / map->tile_size; - double n = M_PI - 2.0 * M_PI * dy / pow(2.0, zoom_level); - return 180.0 / M_PI * atan(0.5 * (exp(n) - exp(-n))); -} - -gchar *oam_get_tile_filename(Map *map, ChamplainTile *tile) -{ - gint x, y, level; - g_object_get (G_OBJECT (tile), "x", &x, "y", &y, "zoom-level", &level, NULL); - return g_build_filename (g_strdup_printf("%d_%d_%d.png", level, y, x), NULL); -} - -gchar *oam_get_tile_uri(Map *map, ChamplainTile *tile) -{ - gint x, y, level; - g_object_get (G_OBJECT (tile), "x", &x, "y", &y, "zoom-level", &level, NULL); - return g_strdup_printf("http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/%d/%d/%d.jpg", level, x, y); -} diff --git a/champlain/sources/oam.h b/champlain/sources/oam.h deleted file mode 100644 index c3650d7..0000000 --- a/champlain/sources/oam.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2008 Pierre-Luc Beaudoin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef OAM_H -#define OAM_H - -#include "champlain-map.h" - -void oam_init(Map* map); - -#endif diff --git a/champlain/sources/osmmapnik.c b/champlain/sources/osmmapnik.c deleted file mode 100644 index 51f7588..0000000 --- a/champlain/sources/osmmapnik.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2008 Pierre-Luc Beaudoin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "sources/osmmapnik.h" - -#include "champlain-map.h" - -#include -#include - - -//http://wiki.openstreetmap.org/index.php/Slippy_map_tilenames#C.2FC.2B.2B - -guint osm_mapnik_row_count(Map *map, guint zoom_level); -guint osm_mapnik_column_count(Map *map, guint zoom_level); -ChamplainTile *osm_mapnik_get_tile (Map *map, guint zoom_level, guint x, guint y); - -gint osm_mapnik_longitude_to_x (Map *map, gdouble longitude, guint zoom_level); -gint osm_mapnik_latitude_to_y (Map *map, gdouble latitude, guint zoom_level); -gdouble osm_mapnik_x_to_longitude (Map *map, gint x, guint zoom_level); -gdouble osm_mapnik_y_to_latitude (Map *map, gint y, guint zoom_level); - -gchar *osm_mapnik_get_tile_filename(Map *map, ChamplainTile *tile); -gchar *osm_mapnik_get_tile_uri(Map *map, ChamplainTile *tile); - -void -osm_mapnik_init(Map *map) -{ - map->name = "OpenStreetMap"; - map->license = "Map data is CC BY-SA 2.0 by OpenStreetMap Contributors"; - map->license_uri = "http://creativecommons.org/licenses/by-sa/2.0/"; - map->zoom_levels = 18; - map->tile_size = 256; - - map->get_row_count = osm_mapnik_row_count; - map->get_column_count = osm_mapnik_column_count; - - map->longitude_to_x = osm_mapnik_longitude_to_x; - map->latitude_to_y = osm_mapnik_latitude_to_y; - map->x_to_longitude = osm_mapnik_x_to_longitude; - map->y_to_latitude = osm_mapnik_y_to_latitude; - - map->get_tile_filename = osm_mapnik_get_tile_filename; - map->get_tile_uri = osm_mapnik_get_tile_uri; -} - -guint osm_mapnik_row_count(Map *map, guint zoom_level) -{ - return pow (2, zoom_level); -} - -guint -osm_mapnik_column_count(Map *map, guint zoom_level) -{ - return pow (2, zoom_level); -} - -gint -osm_mapnik_longitude_to_x (Map *map, gdouble longitude, guint zoom_level) -{ - return ((longitude + 180.0) / 360.0 * pow(2.0, zoom_level)) * map->tile_size; -} - -gint -osm_mapnik_latitude_to_y (Map *map, gdouble latitude, guint zoom_level) -{ - return ((1.0 - log( tan(latitude * M_PI/180.0) + 1.0 / cos(latitude * M_PI/180.0)) / M_PI) / 2.0 * pow(2.0, zoom_level)) * map->tile_size; -} - -gdouble -osm_mapnik_x_to_longitude (Map *map, gint x, guint zoom_level) -{ - gdouble dx = (float)x / map->tile_size; - return dx / pow(2.0, zoom_level) * 360.0 - 180; -} - -gdouble -osm_mapnik_y_to_latitude (Map *map, gint y, guint zoom_level) -{ - gdouble dy = (float)y / map->tile_size; - double n = M_PI - 2.0 * M_PI * dy / pow(2.0, zoom_level); - return 180.0 / M_PI * atan(0.5 * (exp(n) - exp(-n))); -} - -gchar *osm_mapnik_get_tile_filename(Map *map, ChamplainTile *tile) -{ - gint x, y, level; - g_object_get (G_OBJECT (tile), "x", &x, "y", &y, "zoom-level", &level, NULL); - return g_build_filename (g_strdup_printf("%d_%d_%d.png", level, y, x), NULL); -} - -gchar *osm_mapnik_get_tile_uri(Map *map, ChamplainTile *tile) -{ - gint x, y, level; - g_object_get (G_OBJECT (tile), "x", &x, "y", &y, "zoom-level", &level, NULL); - return g_strdup_printf("http://tile.openstreetmap.org/%d/%d/%d.png", level, x, y); -} diff --git a/champlain/sources/osmmapnik.h b/champlain/sources/osmmapnik.h deleted file mode 100644 index 25af08b..0000000 --- a/champlain/sources/osmmapnik.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2008 Pierre-Luc Beaudoin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef OSM_MAPNIK_H -#define OSM_MAPNIK_H - -#include "champlain-map.h" - -void osm_mapnik_init(Map* map); - -#endif