Add terrain type names
This commit is contained in:
parent
551174d757
commit
c7e0d07fc3
19
terrain.php
19
terrain.php
@ -43,6 +43,23 @@ if ($database->has('terrain', ["AND" => ["latitude" => $lat, "longitude" => $lon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$terrainstrings = [
|
||||||
|
0 => "Water",
|
||||||
|
1 => "Evergreen Needleleaf Forest",
|
||||||
|
2 => "Evergreen Broadleaf Forest",
|
||||||
|
3 => "Deciduous Needleleaf Forest",
|
||||||
|
4 => "Deciduous Broadleaf Forest",
|
||||||
|
5 => "Mixed Forest",
|
||||||
|
6 => "Woodland",
|
||||||
|
7 => "Wooded Grassland",
|
||||||
|
8 => "Closed Shrubland",
|
||||||
|
9 => "Open Shrubland",
|
||||||
|
10 => "Grassland",
|
||||||
|
11 => "Cropland",
|
||||||
|
12 => "Bare Ground",
|
||||||
|
13 => "Urban and Built"
|
||||||
|
];
|
||||||
|
|
||||||
$terrainid = $database->select('terrain', 'type', ["AND" => ["latitude" => $finallat, "longitude" => $finallong]])[0];
|
$terrainid = $database->select('terrain', 'type', ["AND" => ["latitude" => $finallat, "longitude" => $finallong]])[0];
|
||||||
$out = ["status" => "OK", "type" => $terrainid, "latitude" => $finallat, "longitude" => $finallong];
|
$out = ["status" => "OK", "type" => $terrainid, "latitude" => $finallat, "longitude" => $finallong, "name" => $terrainstrings[$terrainid]];
|
||||||
echo json_encode($out);
|
echo json_encode($out);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user