function createKMLfile($lineColor = "ff0000", $exaggeration = 1, $lineWidth = 2, $extendedInfo = 0) { global $takeoffRadious, $landingRadious; global $moduleRelPath, $baseInstallationPath; global $langEncodings, $currentlang, $CONF_use_utf; $exaggeration = 1; //if (file_exists($this->getKMLFilename())) return; $getFlightKML = $this->getFlightKML() . "&c={$lineColor}&w={$lineWidth}&an={$extendedInfo}"; //UTF-8 or //".$langEncodings[$currentlang]." $kml_file_contents = "<?xml version='1.0' encoding='UTF-8'?>\n" . "<kml xmlns=\"http://earth.google.com/kml/2.1\">\n<Document>\n<name>" . $this->filename . "</name>" . $this->kmlGetDescription($extendedInfo, $getFlightKML) . "\n<open>1</open>"; /*<LookAt> <longitude>-3.10135108046447</longitude> <latitude>52.9733850011146</latitude> <range>3000</range> <tilt>65</tilt> <heading>227.735584972338</heading> </LookAt>*/ $kml_file_contents .= $this->kmlGetTrack($lineColor, $exaggeration, $lineWidth, $extendedInfo); // create the start and finish points $kml_file_contents .= makeWaypointPlacemark($this->takeoffID); if ($this->takeoffID != $this->landingID) { $kml_file_contents .= makeWaypointPlacemark($this->landingID); } // create the XC task $kml_file_contents .= $this->kmlGetTask(); $kml_file_contents .= "</Document>\n</kml>"; if (!$CONF_use_utf) { require_once dirname(__FILE__) . "/lib/ConvertCharset/ConvertCharset.class.php"; $NewEncoding = new ConvertCharset(); $FromCharset = $langEncodings[$currentlang]; $kml_file_contents = $NewEncoding->Convert($kml_file_contents, $FromCharset, "utf-8", $Entities); } return $kml_file_contents; }
if ($cameraAlt > 100000) { $incWaypoints = 0; } if ($incWaypoints) { $query = "SELECT * FROM {$waypointsTable} WHERE \n\t\t\t\t type=1000 AND\n\t\t\t\t lat>={$south} AND lat<={$north} AND \n\t\t\t\t lon<=" . -$west . " AND lon>=" . -$east . " ORDER BY ID"; //echo $query; $res = $db->sql_query($query); if ($res <= 0) { echo "<H3> Error in query! {$query} </H3>\n"; exit; } require_once dirname(__FILE__) . '/FN_waypoint.php'; $i = 0; $wpStr = ''; while ($row = mysql_fetch_assoc($res)) { $wpStr .= makeWaypointPlacemark($row['ID'], 0, 0, 0, "#marker_takeoff"); $i++; } $wpNum = $i; } $i = 0; $photoStr = ''; $query = "SELECT * FROM {$photosTable} WHERE \n\t\t\t lat>={$south} AND lat<={$north} AND \n\t\t\t lon>=" . $west . " AND lon<=" . $east . " ORDER BY ID"; //echo $query; $res = $db->sql_query($query); if ($res <= 0) { echo "<H3> Error in query! {$query} </H3>\n"; exit; } require_once dirname(__FILE__) . '/CL_flightPhotos.php'; require_once dirname(__FILE__) . '/FN_output.php';
function makeKMLwaypoint($waypointID) { global $langEncodings, $currentlang, $CONF_use_utf; $placemarkString = makeWaypointPlacemark($waypointID); // $xml_text='<?xml version="1.0" encoding="'.$langEncodings[$currentlang].'"? >'. $xml_text = '<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"> ' . $placemarkString . ' </kml> '; if (!$CONF_use_utf) { require_once dirname(__FILE__) . "/lib/ConvertCharset/ConvertCharset.class.php"; $NewEncoding = new ConvertCharset(); $FromCharset = $langEncodings[$currentlang]; $xml_text = $NewEncoding->Convert($xml_text, $FromCharset, "utf-8", $Entities); } return $xml_text; }