Skip to content

Commit

Permalink
started a gc2oc wp translation api (for cmanager)
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Jan 18, 2016
1 parent 35ba834 commit 89d813c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions htdocs/api/gc2oc.php
@@ -0,0 +1,33 @@
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
*
* returns GC -> 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']);

?>
1 change: 1 addition & 0 deletions htdocs/config2/settings-dist.inc.php
Expand Up @@ -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
*
Expand Down

0 comments on commit 89d813c

Please sign in to comment.