-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathtools-geoid.php
74 lines (67 loc) · 2.83 KB
/
tools-geoid.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
require_once('require/class.Connection.php');
require_once('require/class.GeoidHeight.php');
require_once('require/class.Language.php');
try {
$GeoidHeight = new GeoidHeight();
} catch (Exception $e) {
echo $e;
}
$title = _("Geoid Height Calculator");
require_once('header.php');
$page_url = $globalURL.'/tools-geoid';
$latitude = filter_input(INPUT_POST,'latitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
$longitude = filter_input(INPUT_POST,'longitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
$altitude = filter_input(INPUT_POST,'altitude',FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
print '<div class="info column">';
print '<h1>'._("Geoid Height Calculator").'</h1>';
print '</div>';
print '<div class="table column">';
print '<p>'._("Calculate geoid at a point. GPS use a theoretical sea level estimated by a World Geodetic System (WGS84), Earth Gravity Model is better.").'</p>';
print '<div class="pagination">';
print '<form method="post" class="form-horizontal">';
print '<div class="form-group">';
print '<label class="control-label col-sm-2" for="latitude">'._("Latitude").'</label>';
print '<div class="col-sm-10">';
print '<input type="text" class="form-control" name="latitude" id="latitude" value="'.$latitude.'">';
print '</div>';
print '</div>';
print '<div class="form-group">';
print '<label class="control-label col-sm-2" for="longitude">'._("Longitude").'</label>';
print '<div class="col-sm-10">';
print '<input type="text" class="form-control" name="longitude" id="longitude" value="'.$longitude.'">';
print '</div>';
print '</div>';
print '<div class="form-group">';
print '<label class="control-label col-sm-2" for="altitude">'._("GPS Elevation").'</label>';
print '<div class="col-sm-10">';
print '<input type="text" class="form-control" name="altitude" id="altitude" value="'.$altitude.'">';
print '</div>';
print '</div>';
print '<div class="form-group">';
print '<div class="col-sm-offset-1 col-sm-10">';
print '<button type="submit" class="btn btn-primary">Submit</button>';
print '</div>';
print '</div>';
print '</form>';
if ($latitude != '' && $longitude != '') {
$globalDebug = FALSE;
$geoid = $GeoidHeight->get($latitude,$longitude);
print '<div class="row">';
print '<div class="col-md-3 col-md-offset-5">';
print '<div class="col-sm-6"><b>Geoid</b></div>';
print '<div class="col-sm-6">'.$geoid.'</div>';
if ($altitude != '') {
print '<div class="col-sm-6"><b>AMSL Elevation</b></div>';
print '<div class="col-sm-6">'.round($altitude-$geoid,3).'</div>';
}
print '<div class="col-sm-6"><b>Earth Gravity Model</b></div>';
if (isset($globalGeoidSource) && $globalGeoidSource != '') $geoidsource = $globalGeoidSource;
else $geoidsource = 'EGM96-15';
print '<div class="col-sm-6">'.$geoidsource.'</div>';
print '</div>';
}
print '</div>';
print '</div>';
require_once('footer.php');
?>