|
@@ -94,17 +94,22 @@ foreach ($result as $row) {
|
|
|
$points2ID_Way[$row['ID']] = $row['ID_Way'] ;
|
|
$points2ID_Way[$row['ID']] = $row['ID_Way'] ;
|
|
|
$points_asText[$row['ID']] = $points[$row['ID']]->asText();
|
|
$points_asText[$row['ID']] = $points[$row['ID']]->asText();
|
|
|
$xpoint = Vendor_Geophp::load($row['xpoint'], 'wkt');
|
|
$xpoint = Vendor_Geophp::load($row['xpoint'], 'wkt');
|
|
|
- if (!($key = array_search($xpoint->asText(), $xpoints))) $key = array_push($xpoints, $xpoint->asText())-1;
|
|
|
|
|
- $xpoints2points[$key][] = $row['ID'];
|
|
|
|
|
- $points2xpoints[$row['ID']] = $key;
|
|
|
|
|
-
|
|
|
|
|
- $way = Vendor_Geophp::load($row['way'], 'wkt');
|
|
|
|
|
-
|
|
|
|
|
- if (!(in_array($xpoint->asText(), $joins_asText))) {
|
|
|
|
|
- if (@!in_array($key, $ways2cut[array_search($way->asText(), $ways_asText)])) {
|
|
|
|
|
- $ways2cut[array_search($way->asText(), $ways_asText)][] = array('key'=>$key,'ID_Way'=>$row['ID_Way']);
|
|
|
|
|
- } else echo ".";
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ //blad dziwny sqix
|
|
|
|
|
+ if($xpoints) {
|
|
|
|
|
+ if (!($key = array_search($xpoint->asText(), $xpoints))) $key = array_push($xpoints, $xpoint->asText())-1;
|
|
|
|
|
+ $xpoints2points[$key][] = $row['ID'];
|
|
|
|
|
+ $points2xpoints[$row['ID']] = $key;
|
|
|
|
|
+
|
|
|
|
|
+ $way = Vendor_Geophp::load($row['way'], 'wkt');
|
|
|
|
|
+ }
|
|
|
|
|
+ //errory sieje z die
|
|
|
|
|
+ if($xpoint) {
|
|
|
|
|
+ if (!(in_array($xpoint->asText(), $joins_asText))) {
|
|
|
|
|
+ if (@!in_array($key, $ways2cut[array_search($way->asText(), $ways_asText)])) {
|
|
|
|
|
+ $ways2cut[array_search($way->asText(), $ways_asText)][] = array('key'=>$key,'ID_Way'=>$row['ID_Way']);
|
|
|
|
|
+ } else echo ".";
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function pointsDistance($a, $b) {
|
|
function pointsDistance($a, $b) {
|
|
@@ -117,15 +122,20 @@ foreach ($ways2cut as $way_key => $xpoint_keys) {
|
|
|
//$xpoint_keys=$value_arr['key'];
|
|
//$xpoint_keys=$value_arr['key'];
|
|
|
$way = Vendor_Geophp::load($ways_asText[$way_key], 'wkt');
|
|
$way = Vendor_Geophp::load($ways_asText[$way_key], 'wkt');
|
|
|
foreach ($xpoint_keys as $xpoint_key_arr) {
|
|
foreach ($xpoint_keys as $xpoint_key_arr) {
|
|
|
|
|
+
|
|
|
|
|
+ if($joins_asText ) {
|
|
|
$xpoint_key=$xpoint_key_arr['key'];
|
|
$xpoint_key=$xpoint_key_arr['key'];
|
|
|
$ID_Way=$xpoint_key_arr['ID_Way'];
|
|
$ID_Way=$xpoint_key_arr['ID_Way'];
|
|
|
$xpoint = Vendor_Geophp::load($xpoints[$xpoint_key], 'wkt');
|
|
$xpoint = Vendor_Geophp::load($xpoints[$xpoint_key], 'wkt');
|
|
|
- $key = array_push($joins_asText, $xpoint->asText())-1;
|
|
|
|
|
- foreach ($xpoints2points[$xpoint_key] as $point_key) {
|
|
|
|
|
- $points2joins[$point_key] = $key;
|
|
|
|
|
|
|
+ if($xpoint) { ///sypie errorem
|
|
|
|
|
+ $key = array_push($joins_asText, $xpoint->asText())-1; //blad
|
|
|
|
|
+ foreach ($xpoints2points[$xpoint_key] as $point_key) {
|
|
|
|
|
+ $points2joins[$point_key] = $key;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
$distances[$xpoint_key] = pointsDistance($way->startPoint(), $xpoint);
|
|
$distances[$xpoint_key] = pointsDistance($way->startPoint(), $xpoint);
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
asort($distances);
|
|
asort($distances);
|
|
|
|
|
|
|
|
$sub_xpoints = array();
|
|
$sub_xpoints = array();
|