| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- $_SERVER['SERVER_NAME'] = 'biuro.biall-net.pl';
- //when used in /Library/Server/Web/Data/Sites/bzyk-biale-plamy-php-temp/SE/dev on biuro.biall-net.pl
- if( file_exists ( "../../se-lib/bootstrap.php"))
- require("../../se-lib/bootstrap.php");
- //when used in in native SE
- else require("../../../../SE-production-git/SE/se-lib/bootstrap.php");
- Lib::loadClass("Vendor_Geophp");
- $edge_joins_filled_paths=simplexml_load_file("edge_joins_filled_paths.xml");
- $edge_joins_filled_paths->registerXPathNamespace('bp', 'https://procesy5.pl/biale_plamy-schema.xsd');
- /*
-
- <edge_joins_filled_paths xmlns:bp="https://procesy5.pl/biale_plamy-schema.xsd"
- stylesheet="edge_joins_filled_paths_make.xsl">
- <item id="2">
- <asText>LINESTRING (18.790514117706 51.700138816022, 18.7903688 51.699788899083, 18.7899844 51.698863599083, 18.789749976023 51.698314941387, 18.7896425 51.698063399083)</asText>
- </item>
- <item id="2455">
- <asText>LINESTRING (18.790997607425 51.701120838567, 18.7910173 51.701131499083, 18.79317413083 51.702132885188)</asText>
- </item>
- <item id="942">
- <asText>LINESTRING (18.790530029952 51.70115561083, 18.7904414 51.701176599083, 18.79027600256 51.701214515103, 18.7887794 51.701557599083, 18.7872441 51.701940699083, 18.786484482364 51.702153259364, 18.786343005068 51.7021928483, 18.785719823413 51.702367230332, 18.7852743 51.702491899083, 18.784845538677 51.702585186344, 18.784713108635 51.702613999661, 18.7846313 51.702631799083, 18.784590853131 51.702636246594, 18.784552554616 51.702640457874, 18.784210643159 51.702678054236, 18.7841393 51.702685899083, 18.784026192072 51.70269243303, 18.783774852044 51.702706952283, 18.783543623669 51.702720309738, 18.783506464301 51.702722456337, 18.7834988 51.702722899083, 18.7831768 51.702722199083, 18.78292120924 51.702710534637, 18.7828284 51.702706299083, 18.7826414 51.702686599083, 18.782610843732 51.70268336882, 18.782286949114 51.702649128226, 18.782036 51.702622599083, 18.781328126127 51.702521320434, 18.781171638439 51.702498931048, 18.7810498 51.702481499083, 18.780894247707 51.702472582786, 18.780361963382 51.702442072112, 18.780293331237 51.7024381381, 18.7799385 51.702417799083, 18.778999965071 51.702440677827, 18.778959579516 51.702441662309, 18.778727936562 51.702447309088, 18.778695292922 51.702448104845, 18.778626996545 51.702449769711, 18.778162047508 51.702461103813, 18.778091119968 51.702462832819, 18.777657182815 51.702473410941, 18.777249036399 51.70248336036, 18.776860827223 51.702492823768, 18.776788 51.702494599083, 18.776481458465 51.702501358943, 18.776407189811 51.702502996717, 18.776238355239 51.70250671986, 18.776005674517 51.70251185094, 18.77586176655 51.702515024401, 18.775498355528 51.702523038348, 18.774992417487 51.702534195304, 18.774932171725 51.702535523845, 18.774612158587 51.702542580781, 18.77451328326 51.702544761182, 18.774164284218 51.702552457316, 18.774106823316 51.702553724445, 18.773413770139 51.702569007668, 18.773009874384 51.702577914385, 18.7728972 51.702580399083, 18.7720237 51.702600099083, 18.771581908783 51.702610065467)</asText>
- </item>
- <item id="2870">
- <asText>LINESTRING (18.78976686511 51.699901521208, 18.789654277615 51.699922586349, 18.789629512362 51.699927219932, 18.789233927052 51.700001234014, 18.788996939055 51.70004557451, 18.7888525 51.700072599083)</asText>
- </item>
- <item id="3">
- <asText>LINESTRING (18.6366871 51.253538999079, 18.6367062 51.253605499079, 18.636784038985 51.253941026293, 18.6368933 51.25441199908, 18.6369493 51.254670399079, 18.6370223 51.254905799079, 18.6370965 51.255053899079, 18.6371814 51.255153699079, 18.637252 51.255236599079, 18.63765 51.255476599079, 18.6386978 51.255913099079, 18.6414059 51.257032799079, 18.641446948214 51.257049783946, 18.641569720158 51.25710058433, 18.641883540093 51.257230436255, 18.642076913883 51.257310450161, 18.642264251415 51.257387966394, 18.642369128624 51.257431362322, 18.642519099954 51.257493417226, 18.642755458286 51.257591217209, 18.643010282677 51.257696658049, 18.643016312766 51.25769915317, 18.643218878283 51.257782970415, 18.643320505077 51.257825021392, 18.643458763351 51.257882229686, 18.643640337123 51.257957360999, 18.643805770635 51.258025813821, 18.643857876104 51.258047373941, 18.643970939633 51.258094157192, 18.644281668729 51.258222730194, 18.644411468184 51.258276438411, 18.644414736575 51.258277790801, 18.644616803382 51.25836140169, 18.6449346 51.25849289908, 18.644971762701 51.258508376996, 18.645016030826 51.258526814254, 18.645343820108 51.258663335409, 18.645658808769 51.258794525226, 18.646105470467 51.258980555625, 18.646158721705 51.259002734265, 18.646378297 51.259094185311, 18.6467805 51.25926169908, 18.646823670225 51.259280270807, 18.647217107271 51.25944952648, 18.64743915153 51.259545049387)</asText>
- </item>
- <item id="842">
- <asText>LINESTRING (18.6374258 51.254722699079, 18.6379791 51.254173299079, 18.6381368 51.253935199079, 18.6382378 51.253782699079, 18.638335344283 51.253615106227)</asText>
- </item>
- <item id="146">
- <asText>LINESTRING (18.63717
-
- */
- //print_r($edge_joins);
- $edge_joins_filled_paths_arr=array();
- $id_j=0;
- foreach($edge_joins_filled_paths->xpath('item') as $child) { //cable_to_PE_to_be_calculated
- // echo "\n<br>";
- //$attrs=$child->attributes("ID_Way");
- foreach($child->attributes() as $a=>$b) {
- // echo "#87Child";print_r($b[0]);
- if($a=='id') $ID_Way=$b[0];
- //if($a=='Count') $Count=$b[0];
- }
- //echo $child->getName() . ": " . " ID_Way: ".$ID_Way. " : ";
- settype($ID_Way, "integer");
- // settype($Joins, "integer");
- //settype($ID_Point, "integer");
- foreach($child->xpath('asText') as $Path_Point_xml) {
- // detect_next_PE/LINESTRING
-
- $id_j++;
- $LINESTRING=$Path_Point_xml->xpath('text()');
- $LINESTRING=$LINESTRING[0];
- settype($LINESTRING, "string");
- $edge_joins_filled_paths_arr[$id_j]['LINESTRING']=$LINESTRING;
- $edge_joins_filled_paths_arr[$id_j]['ID_Way']=$ID_Way;
- }
- }
- echo "\n<br>#150 edge_joins_filled_paths_arr";
- print_r($edge_joins_filled_paths_arr);
- DB::getPDO()->query("truncate table Rozdzielcza_test_bzyk_paths");
- unset($ID_Way);
- foreach($edge_joins_filled_paths_arr as $id_j=>$Path_Point_val) {
-
- $sql_Path_Point_val="insert into Rozdzielcza_test_bzyk_paths (the_geom,ID_Way)
- values (ST_GeomFromText('".$Path_Point_val['LINESTRING']."'),'".$Path_Point_val['ID_Way']."'
- ) ";
- echo "#216Query path ins:: ".$sql_Path_Point_val." ";
- //if(strlen($edge_joins_filled_paths[$ID_Way]['asText'])>2)
- if(strlen($Path_Point_val['LINESTRING'])>1)
- DB::getPDO()->query($sql_Path_Point_val);
- else echo "ERROR wspolrzednych!!! brak - blad danych!";
- //else echo "#296 path nie wygenerowalo sie !! dla ".$ID_Way." i pkt ".$pkt_A." , ".$pkt_B." \n";
-
-
- }
|