$deg,"min"=>$min,"sec"=>$sec); } if (isset($_GET['lat'])){ $lat=$_GET['lat']; $long=$_GET['long']; $DMSLat=DECtoDMS($lat); $DMSLong=DECtoDMS($long); //echo $DMSLat['deg'].$DMSLat['min'].$DMSLat['sec']; // echo strlen($DMSLat['min']); //if (strlen($DMSLat['min'] == '1')){ // echo 'hi'; // $DMSLat['min']='0'.$DMSLat['min']; // } // echo $DMSLat['min']; $lat=$DMSLat['deg'].$DMSLat['min'].$DMSLat['sec']; //echo strlen($lat); while (strlen($lat) <8){ $lat=$lat.'0'; } $long=$DMSLong['deg'].$DMSLong['min'].$DMSLong['sec']; if ($DMSLong['deg'] > -100){ $long=(str_replace("-","0",$long)); } else { $long=(str_replace("-","",$long)); } echo '->'.$DMSLong['deg'].'<-'; while (strlen($long) < 9){ $long=$long.'0'; } //$lat=(str_replace(".","",$lat)).'0000'; //$long=(str_replace("-","0",$long)).'0000'; //$long=str_replace(".","",$long); //echo "^".$lat1."^".$long1."^
"; echo "^".$lat."^".$long; //$url = 'http://ocs-vs-webd1:10104/m/geo/getChartsWPoint.php?lat='.$lat.'&lng='.$long; //$url = 'http://nauticalcharts.noaa.gov/m/geo/getChartsWPoint.php?lat='.$lat.'&lng='.$long; //$url= "getChartsWPoint.php?lat=38.99&lng=-77.03"; //$content = file_get_contents($url); //if (file_get_contents($url) === false){ // echo "Can't get file"; //} //$json = json_decode($content, true); $myFile = "/chapp/Chapp.csv"; $fh = fopen($myFile, 'r'); //$theData = fread($fh, filesize($myFile)); $headerjunk=fgets($fh,4096); $explodedHeader=explode(',',$headerjunk); $counter=0; foreach ($explodedHeader as $value){ //echo $counter.'. '.$value.'
'; $counter++; } $theData=fgets($fh,4096); while ($theData){ $lineArray=explode(',', $theData); //echo $theData.'
'; $gpCounter=0; for ($i =32;$i<64;$i++){ if ($lineArray[$i] != ""){ //echo $lineArray[$i]; $temp=explode('W',$lineArray[$i]); $currentLongs[$gpCounter]=$temp[1]; $currentLats[$gpCounter]=substr($temp[0],1); $gpCounter++; //echo ' lat:'.$currentLats; //echo ' long:'.$currentLongs; //echo '
'; } } if ($lat min($currentLats)){ if ($longmin($currentLongs)){ //echo 'INSIDE '; //echo max($currentLats).'
'; //echo ' lat:'.$lat." "; //echo min($currentLats)."
"; echo $lineArray[4].'*'; $charts[$chartCounter] = $lineArray[4]; $title[$chartCounter]= $lineArray[10]; //echo sizeof($charts); $chartCounter++; //echo ' long:'.$long; } else { //echo "$$$$$$$$$"; } } //echo max($currentLats); //echo min($currentLats); //echo min($currentLongs); unset($currentLats); unset($currentLongs); $theData=fgets($fh,4096); } fclose($fh); } ?> Coast Survey Mobile
flag
Note: Some information that is linked to on this website may belong to other offices at NOAA.

Note: Downloads of information may take a long time using a 3G connection or worse. 4G or WiFi connection is recommended, but not necessary.