From 8a536f6969e81e2956dc2fd0b9c085780625675e Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Mon, 3 Oct 2016 13:30:03 -0600 Subject: [PATCH] Fix legend mismatch, make sure type is always an int --- terrain.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terrain.php b/terrain.php index fcc1fc0..21e6770 100644 --- a/terrain.php +++ b/terrain.php @@ -53,13 +53,14 @@ $terrainstrings = [ 10 => "Grassland", 11 => "Cropland", 12 => "Bare Ground", - 13 => "Urban and Built" + 13 => "Urban and Built", + 14 => "Urban and Built" ]; if ($failtowater) { $terrainid = 0; } else { - $terrainid = $database->select('terrain', 'type', ["AND" => ["latitude" => $finallat, "longitude" => $finallong]])[0]; + $terrainid = (int) $database->select('terrain', 'type', ["AND" => ["latitude" => $finallat, "longitude" => $finallong]])[0]; } $out = ["status" => "OK", "type" => $terrainid, "latitude" => $finallat, "longitude" => $finallong, "name" => $terrainstrings[$terrainid]]; echo json_encode($out);