if ($featCollVal == "true") { array_push($geo, buildFeature(json_decode($geojson), $minutesCount)); } if ($featCollVal == "false") { array_push($geo, json_decode($geojson)->coordinates); } } else { //echo "mind 2"; $postgis_diff = "\r\n UPDATE\r\n temp_reach_hull\r\n SET\r\n diff = (\r\n SELECT\r\n st_multi(\r\n ST_SymDifference(t1.the_geom, t2.the_geom)\r\n ) AS diff\r\n FROM\r\n (\r\n SELECT\r\n the_geom\r\n FROM\r\n temp_reach_hull\r\n WHERE\r\n id=" . $ids[$intervall - $i - 1] . "\r\n ) AS t1,\r\n (\r\n SELECT\r\n the_geom\r\n FROM\r\n temp_reach_hull\r\n WHERE\r\n id=" . $ids[$intervall - $i] . "\r\n ) AS t2\r\n )\r\n WHERE\r\n id=" . $ids[$intervall - $i - 1] . "\r\n RETURNING\r\n ST_AsGeoJSON(diff)\r\n "; //echo $postgis_diff.'<br>'; $result_geojson = pg_query($db_conn, $postgis_diff); $row_geojson = pg_fetch_array($result_geojson); $geojson = $row_geojson[0]; //echo "geojson Nr. ".$i." :".print_r(json_decode($geojson)->coordinates)."<br>"; if ($featCollVal == "true") { array_push($geo, buildFeature(json_decode($geojson), $minutesCount)); } if ($featCollVal == "false") { array_push($geo, json_decode($geojson)->coordinates); } } } } //X. delete temp hulls from PostGIS db foreach ($ids as $id) { clearEntry($id, $schema, "temp_reach_hull"); } //baue FeatureCollection oder MultiPolygon mit den HullPolygonen im Array $geo und gebe am Ende das Ergebnis als GeoJSON aus if ($featCollVal == "true") { $json_output = buildFeatureCollection($geo); }
case "BELL ALIANT COMMUNICATIONS RÉGIONAL": case "BELL ALIANT REGIONAL COMM. INC.": case "BELL MOBILITY INC.": case "Bell AWS LTE Atlantic": case "Bell Canada": case "Bell Mobility Inc.": case "Bell Mobility Inc. Atlantic CDMA": case "Bell Mobility Inc. Atlantic HSPA": case "BELL ALIANT REGIONAL COMM. INC.": $list = array_merge($list, buildFeature($account, "Bell", "#1E7BC0")); break; case "TELUS Communications Company": $list = array_merge($list, buildFeature($account, "Telus", "#66CB00")); break; case "Rogers Communications Partnership": $list = array_merge($list, buildFeature($account, "Rogers", "#DD2735")); break; } } /* Convert the resulting array into JSON */ $json = json_encode(array("type" => "FeatureCollection", "features" => $list)); /* Dump the JSON file of the results. */ $fp = fopen("../www/data/towers.geojson", "w"); fwrite($fp, $json); fclose($fp); /* Convert latitude and longitude in format DDMMSS or DDDMMSS to decimal degrees */ function DMStoDEC($ddmmss) { if (strlen($ddmmss) == 7) { $deg = substr($ddmmss, 0, 3);