From 89d813c8c4339b21f97d54775f77e8e8f722dc18 Mon Sep 17 00:00:00 2001 From: following Date: Mon, 18 Jan 2016 14:11:53 +0100 Subject: [PATCH] started a gc2oc wp translation api (for cmanager) --- htdocs/api/gc2oc.php | 33 ++++++++++++++++++++++++++++ htdocs/config2/settings-dist.inc.php | 1 + 2 files changed, 34 insertions(+) create mode 100644 htdocs/api/gc2oc.php diff --git a/htdocs/api/gc2oc.php b/htdocs/api/gc2oc.php new file mode 100644 index 000000000..a15e11a11 --- /dev/null +++ b/htdocs/api/gc2oc.php @@ -0,0 +1,33 @@ + OC waypoint translation table, if available + ***************************************************************************/ + + $opt['rootpath'] = '../'; + require($opt['rootpath'] . 'lib2/web.inc.php'); + + header('Content-type: text/html; charset=utf-8'); + + /* + * caches.wp_gc_maintained is intended for map and search filtering and + * therefore e.g. does not contain WPs of active OC listings that are + * archived at GC. So it is not useful for GC->OC translation. + * If a better external source is available, we can use data from there. + * + * This may be refined by combining different sources and/or internal data. + * Also, it should be optimized by caching the list contents and allowing + * to request a single GC code or a list of GC codes. + * + * Note that it is not possible to create a 100% reliable translation table. + * There are many wrong GC wps in listings, and maintained tables always + * are incomplete. DO NOT RELY ON THE CORRECTNESS OF SUCH DATA! + */ + + if ($opt['cron']['gcwp']['fulllist']) + echo @file_get_contents($opt['cron']['gcwp']['fulllist']); + +?> \ No newline at end of file diff --git a/htdocs/config2/settings-dist.inc.php b/htdocs/config2/settings-dist.inc.php index d8986d6b8..3cf2d8a50 100644 --- a/htdocs/config2/settings-dist.inc.php +++ b/htdocs/config2/settings-dist.inc.php @@ -423,6 +423,7 @@ $opt['cron']['geokrety']['xml_archive'] = false; $opt['cron']['autoarchive']['run'] = false; $opt['cron']['gcwp']['sources'] = array(); + $opt['cron']['gcwp']['fulllist'] = ''; /* E-Mail settings *