Пример #1
0
function process_survey($survey, $submission_id)
{
    global $mysqli;
    $poly = get_buffer_polygone_for_point_ql($survey->geolocation->longitude, $survey->geolocation->latitude, 100);
    $url_base = "http://overpass.osm.rambler.ru/cgi/interpreter?data=";
    $query = urlencode("[out:json];(node{$poly};<<;);out;");
    $json = file_get_contents($url_base . $query);
    $json_data = $mysqli->real_escape_string($json);
    $sql = "INSERT INTO `au_osm_nodes` (`submission_id`, `raw`)\n            VALUES ({$submission_id}, '{$json_data}')\n            ON DUPLICATE KEY UPDATE `raw` = '{$json_data}';\n    ";
    $mysqli->query($sql);
    error_log($mysqli->error);
    if (isset($_GET['print'])) {
        include_once '../lib/osm_nodes_tag_cloud.php';
        osm_nodes_tag_cloud($json);
    }
}
Пример #2
0
    exit;
}
?>
<div class="tenbreaths-survey-info">
    <div class="tenbreaths-survey-info-float">
    
<?php 
if ($photo) {
    echo '<img src="/data/' . $photo . '" />';
}
// the OSM tag cloud
$response = $mysqli->query("SELECT * FROM au_osm_nodes WHERE submission_id = {$submission_id}");
if ($response->num_rows == 1) {
    include_once 'lib/osm_nodes_tag_cloud.php';
    $row = $response->fetch_assoc();
    osm_nodes_tag_cloud($row['raw']);
}
?>
    </div>
    
<h3>Survey Information</h3>
<p style="color: orange;">This is work in progress!</p>
<p>
    <?php 
echo $survey->geolocation->display_string;
// var_dump($survey);
?>
</p>

<h3>OpenStreetMap</h3>
<p><strong>Address: </strong>