Kaynağa Gözat

dodaly sie kable

a.binder 9 yıl önce
ebeveyn
işleme
034bb98179

+ 172 - 0
SE/dev/php-cli/biale_put_Cables_to_PE.php

@@ -0,0 +1,172 @@
+<?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");
+
+
+
+function init_sh_check() {
+    //check if run from bash
+    if(isset($_SERVER["argv"])) {
+        if(@$_SERVER["argv"][1]=='--help') {
+            echo "
+                Options are:
+                php ".$_SERVER["argv"][0]." --check   - control if we have needed tables/data
+                
+                .EOF
+            ";
+        } else if(@$_SERVER["argv"][1]=='--check') { 
+            check();
+        } else echo " bad option, try:
+            php ".$_SERVER["argv"][0]." --help
+            
+            .EOF
+            ";
+    } else {
+        echo "<br> this script could be run from bash e.g. php biale_plamy.php --help <br>" ;
+        check();
+    }
+}
+
+
+
+function check() {
+	echo "<br>\n i run check()";
+    //todo to set arguments to rebuild tables etc:
+    $check_tbls=array('Rozdzielcza_test_bzyk_drogi','Rozdzielcza_test_bzyk_joins','Rozdzielcza_test_bzyk_przylacza_HIST',
+                    'Rozdzielcza_test_bzyk_przylacza','Rozdzielcza_test_bzyk_punkty_adresowe','Rozdzielcza_test_bzyk_ways');
+
+    //$tables =  DB::getPDO()->list_tables();
+    foreach($check_tbls as $tbl) {
+        $query = "select ID from ".$tbl." limit 1 ";
+        echo "<br>\nresult chk for tbl:".$tbl." ;";
+        
+        try{
+            $result = DB::getPDO()->fetchall($query);
+        } catch(Exception $exception) {
+            // return $exception;
+            echo "<br>\n jest blad z tbl:".$tbl." i get sample table structure with data from ../sql/".$tbl.".sql  - it should be manually replaced by correct/newer!";
+            $sql = file_get_contents('../sql/'.$tbl.'.sql');
+            
+            try{
+                $result = DB::getPDO()->fetchall($sql);
+            } catch(Exception $exception2) {
+                echo "<br>\n jest blad dump dla tbl:".$tbl;
+            }
+        } 
+        //	print_r($exception);
+        print_r($result);
+    }
+}
+
+init_sh_check();   
+
+
+$cables_from_joins_to_PE=simplexml_load_file("cables_from_joins_to_PE.xml");
+$cables_from_joins_to_PE->registerXPathNamespace('bp', 'https://procesy5.pl/biale_plamy-schema.xsd');
+/*
+	
+	<?xml version="1.0" encoding="UTF-8"?>
+	<cables_from_joins_to_PE xmlns:bp="https://procesy5.pl/biale_plamy-schema.xsd">
+	<cable_to_PE_to_be_calculated ID_Way="3"
+                                 Joins="4"
+                                 Join_X="18.7896425"
+                                 Join_Y="51.698063399083">
+		      <not_found Pos="1"
+		                 X="18.636657356658"
+		                 Y="51.253416226324"
+		                 srch_X="18.7896425"
+		                 srch_Y="51.698063399083"
+		                 diff_X="0.15298514334200064"
+		                 diff_Y="0.444647172758998"/>
+        <found_in_path_in_edge_joins_filled_path diff_X="-0.00006424369499669069"
+                                               diff_Y="0.0013892901829990478"
+                                               position="5">
+         <bp:Path_Point Pos="5" X="18.960657743695" Y="51.612137008899"/>
+         <detect_next_PE Pos_found="5"
+                         Next_PE_Pos="20"
+                         Prev_PE_Pos=""
+                         Going_to_next="20">
+            <bp:Path_Point Pos="5" X="18.960657743695" Y="51.612137008899"/>
+            <bp:Path_Point Pos="6" X="18.960110541501" Y="51.612105643896"/>
+            <bp:Path_Point Pos="7" X="18.959774447246" Y="51.612086379359"/>
+            <bp:Path_Point Pos="8" X="18.959754322927" Y="51.612085225856"/>
+            <bp:Path_Point Pos="9" X="18.959645426785" Y="51.612078984054"/>
+            <bp:Path_Point Pos="10" X="18.959455431877" Y="51.612068093763"/>
+            <bp:Path_Point Pos="11" X="18.959126615445" Y="51.612049246382"/>
+            <bp:Path_Point Pos="12" X="18.958655233785" Y="51.612022227326"/>
+            <bp:Path_Point Pos="13" X="18.958386790309" Y="51.612006840454"/>
+            <bp:Path_Point Pos="14" X="18.957723493448" Y="51.611968821038"/>
+            <bp:Path_Point Pos="15" X="18.957421446031" Y="51.611951508026"/>
+            <bp:Path_Point Pos="16" X="18.9573044" Y="51.611944799082"/>
+            <bp:Path_Point Pos="17" X="18.956794400864" Y="51.611932376808"/>
+            <bp:Path_Point Pos="18" X="18.9566352" Y="51.611928499082"/>
+            <bp:Path_Point Pos="19" X="18.955813488168" Y="51.611951817689"/>
+            <bp:Path_Point Pos="20" X="18.955739759724" Y="51.611953909961"/>
+            <LINESTRING>LINESTRING (18.960657743695 51.612137008899, 18.960110541501 51.612105643896, 18.959774447246 51.612086379359, 18.959754322927 51.612085225856, 18.959645426785 51.612078984054, 18.959455431877 51.612068093763, 18.959126615445 51.612049246382, 18.958655233785 51.612022227326, 18.958386790309 51.612006840454, 18.957723493448 51.611968821038, 18.957421446031 51.611951508026, 18.9573044 51.611944799082, 18.956794400864 51.611932376808, 18.9566352 51.611928499082, 18.955813488168 51.611951817689, 18.955739759724 51.611953909961)</LINESTRING>
+         </detect_next_PE>
+         
+                          
+	
+	 */
+//print_r($edge_joins);
+$cables_from_joins_to_PE_arr=array();
+$id_j=0;
+foreach($cables_from_joins_to_PE->xpath('cable_to_PE_to_be_calculated') 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_Way') $ID_Way=$b[0];
+		    if($a=='Joins') $Joins=$b[0];
+		   //if($a=='Count') $Count=$b[0];
+	   }
+	  //echo $child->getName() . ": " . " ID_Way: ".$ID_Way. " : ";
+	   settype($ID_Way, "integer");
+	   settype($Joins, "integer");
+
+	   foreach($child->xpath('found_in_path_in_edge_joins_filled_path') as $Path_Point_xml)  {
+		//   detect_next_PE/LINESTRING
+			
+		   $id_j++;
+		   $LINESTRING=$Path_Point_xml->xpath('detect_next_PE/LINESTRING/text()');
+		   $LINESTRING=$LINESTRING[0];
+		   settype($LINESTRING, "string");
+		   $cables_from_joins_to_PE_arr[$id_j]['LINESTRING']=$LINESTRING;
+		   $cables_from_joins_to_PE_arr[$id_j]['Joins']=$Joins;
+		   $cables_from_joins_to_PE_arr[$id_j]['ID_Way']=$ID_Way;
+
+
+	   }
+}
+
+echo "\n<br>#150 cables_from_joins_to_PE_arr";
+print_r($cables_from_joins_to_PE_arr);
+
+
+ DB::getPDO()->query("truncate table Rozdzielcza_test_bzyk_Cables_to_PE");
+
+unset($ID_Way);
+
+foreach($cables_from_joins_to_PE_arr as $id_j=>$Path_Point_val) {
+		
+		$sql_Path_Point_val="insert into Rozdzielcza_test_bzyk_Cables_to_PE (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)
+		      DB::getPDO()->query($sql_Path_Point_val);
+		    //else echo "#296 path nie wygenerowalo sie !! dla ".$ID_Way." i pkt ".$pkt_A." , ".$pkt_B." \n";
+			
+	
+}
+
+
+

+ 107 - 8
SE/dev/php-cli/cables_from_joins_to_PE.xsl

@@ -12,6 +12,7 @@
     <xsl:variable name="PE_candidates_dump" select="doc('edge_paths_with_PE.xml')"/>
     <xsl:variable name="joins_asText" select="doc('joins_asText.xml')"/>
     <xsl:variable name="edge_joins_filled_paths" select="doc('edge_joins_filled_paths.xml') "/>
+    
     <!-- <joins_asText>
         <item id="0">POINT (18.7909 51.701067999083)</item>-->
     <xsl:template match="joins2ways_z_ID_Way">
@@ -19,14 +20,14 @@
         <xsl:variable name="joins_asText_Path_Point">
             <xsl:apply-templates select="$joins_asText" mode="joins_asText"/>
         </xsl:variable>
-            <joins_asText_Path_Point>
-                <xsl:copy-of select="$joins_asText_Path_Point"/>
-            </joins_asText_Path_Point>
+            
+         <!--<xsl:copy-of select="$joins_asText_Path_Point"/>-->
+            
         <xsl:variable name="edge_joins_filled_paths">
             <xsl:apply-templates select="$edge_joins_filled_paths" mode="edge_joins_filled_paths"/>
         </xsl:variable>
             
-                <xsl:copy-of select="$edge_joins_filled_paths"/>
+                <!--<xsl:copy-of select="$edge_joins_filled_paths"/>-->
             
             
         <!-- jedziemy po joins2ways_z_ID_Way, sprawdzamy czy jest dla niego PE_candidates_dump , jak tak, to szukamy jego PE i liczymy sciezke 
@@ -35,8 +36,8 @@
             <xsl:choose>
                 <xsl:when test="$PE_candidates_dump/PE_candidates_dump/LINESTRING[@ID_Way=current()/@ID_Way]">
                     <cable_to_PE_to_be_calculated>
-                        <xsl:attribute name="Joins" select="@id"/>
                         <xsl:attribute name="ID_Way" select="@ID_Way"/>
+                        <xsl:attribute name="Joins" select="@id"/>
                         <xsl:variable name="ID_Way" select="@ID_Way"/>
                         <xsl:variable name="Joins" select="@ID_Way"/>
                         
@@ -44,13 +45,31 @@
                         <xsl:variable name="Join_X" select="$joins_asText_Path_Point/joins_asText/item[@id=$Joins]/As_POINT_to_xml/@X"/>
                         <xsl:variable name="Join_Y" select="$joins_asText_Path_Point/joins_asText/item[@id=$Joins]/As_POINT_to_xml/@Y"/>
                         <xsl:attribute name="Join_X" select="$Join_X"/><xsl:attribute name="Join_Y" select="$Join_Y"/>
-                        <xsl:for-each select="$edge_joins_filled_paths/edge_joins_filled_paths[@id=$ID_Way]/item/bp:Path_Point">
+                        <xsl:for-each select="$edge_joins_filled_paths/edge_joins_filled_paths/item[@id=$ID_Way]/bp:Path_Point">
+                            <xsl:variable name="diff_X" select=" number($Join_X)- number(@X)"/><xsl:variable name="diff_Y" select=" number($Join_Y)- number(@Y)"/>
+                            <xsl:variable name="bp:Path_Point" select="."/>
                             <xsl:choose>
-                                <xsl:when test="@X=$Join_Y and @Y=$Join_Y">
+                                <xsl:when test="(abs($diff_X)&lt;0.0001 and abs($diff_X)&lt;0.0001) or ( @X=$Join_X and @Y=$Join_Y )">
                                     <found_in_path_in_edge_joins_filled_path>
+                                        <xsl:attribute name="diff_X" select="$diff_X"/><xsl:attribute name="diff_Y" select="$diff_Y"/>
+                                        <xsl:attribute name="position" select="position()"/>
                                         <xsl:copy-of select="."/>
+                                        <xsl:call-template name="detect_next_PE">
+                                            <xsl:with-param name="bp:Path_Point" select="$bp:Path_Point"/>
+                                            <xsl:with-param name="ID_Way" select="$ID_Way"/>
+                                            <xsl:with-param name="Pos_found" select="position()"/>
+                                            <xsl:with-param name="edge_joins_filled_paths" select="$edge_joins_filled_paths"/>
+                                        </xsl:call-template>
                                     </found_in_path_in_edge_joins_filled_path>
                                 </xsl:when>
+                                <xsl:otherwise>
+                                    <not_found>
+                                        <xsl:attribute name="Pos" select="position()"/>
+                                        <xsl:attribute name="X" select="@X"/><xsl:attribute name="Y" select="@Y"/>
+                                        <xsl:attribute name="srch_X" select="$Join_X"/><xsl:attribute name="srch_Y" select="$Join_Y"/>
+                                        <xsl:attribute name="diff_X" select="$diff_X"/><xsl:attribute name="diff_Y" select="$diff_Y"/>
+                                    </not_found>
+                                </xsl:otherwise>
                             </xsl:choose>
                         </xsl:for-each>
                     </cable_to_PE_to_be_calculated>
@@ -60,6 +79,76 @@
         </cables_from_joins_to_PE>
     </xsl:template>
     
+        <!-- na podstawie Joins jade do PE raz z przodudrugi raz z tylu -->
+       <xsl:template name="detect_next_PE">
+           <xsl:param name="bp:Path_Point" required="yes"/>
+           <xsl:param name="Pos_found" required="yes"/>
+           <xsl:param name="ID_Way" required="yes"/>
+           <xsl:param name="edge_joins_filled_paths" required="yes"/>
+           <!--<w_gore><xsl:attribute name="Pos_found" select="$Pos_found"/>
+               <xsl:for-each select="$edge_joins_filled_paths/edge_joins_filled_paths/item[@id=$ID_Way]/bp:Path_Point">
+                    
+                </xsl:for-each>
+            </w_gore>-->
+           
+           <xsl:variable name="Next_PE_Pos" select="min($PE_candidates_dump/PE_candidates_dump/LINESTRING[@ID_Way=$ID_Way]/bp:Path_Point[number(@Pos)&gt;number($Pos_found)]/@Pos)"/>
+           <xsl:variable name="Prev_PE_Pos" select="max($PE_candidates_dump/PE_candidates_dump/LINESTRING[@ID_Way=$ID_Way]/bp:Path_Point[number(@Pos)&lt;=number($Pos_found)]/@Pos)"/>
+           <detect_next_PE>
+               <xsl:attribute name="Pos_found" select="$Pos_found"/>
+               <!--<xsl:copy-of select="$PE_candidates_dump/PE_candidates_dump/LINESTRING[@ID_Way=$ID_Way]/bp:Path_Point[number(@Pos)&gt;number($Pos_found)]/@Pos"/>--> <!--[number(@Pos)&gt;number($Pos_found)]-->
+               <xsl:attribute name="Next_PE_Pos" select="$Next_PE_Pos"/>
+               <xsl:attribute name="Prev_PE_Pos" select="$Prev_PE_Pos"/>
+               <xsl:choose>
+                   <xsl:when test="( abs($Pos_found - $Next_PE_Pos)&lt;=abs($Pos_found - $Prev_PE_Pos)) or ( not($Prev_PE_Pos) and $Next_PE_Pos )">
+                       <xsl:attribute name="Going_to_next" select="$Next_PE_Pos"/>
+                       <xsl:variable name="Path_Point">
+                            <xsl:for-each select="$edge_joins_filled_paths/edge_joins_filled_paths/item[@id=$ID_Way]/bp:Path_Point[ position()&gt;=$Pos_found and position()&lt;=$Next_PE_Pos ]">
+                                <xsl:copy-of select="."/>
+                            </xsl:for-each>
+                       </xsl:variable>
+                       <xsl:copy-of select="$Path_Point"/>
+                       <xsl:call-template name="To_LINESTRING">
+                           <xsl:with-param name="Path_Point" select="$Path_Point"/>
+                       </xsl:call-template>
+                   </xsl:when>
+                   <xsl:when test="(abs($Pos_found - $Next_PE_Pos)&gt;abs($Pos_found - $Prev_PE_Pos)) or ( $Prev_PE_Pos and not($Next_PE_Pos) )">
+                       <xsl:attribute name="Going_to_prev" select="$Prev_PE_Pos"/>
+                       <xsl:variable name="Path_Point">
+                           <xsl:for-each select="$edge_joins_filled_paths/edge_joins_filled_paths/item[@id=$ID_Way]/bp:Path_Point[ position()&lt;=$Pos_found and position()&gt;=$Prev_PE_Pos ]">
+                            <xsl:copy-of select="."/>
+                        </xsl:for-each>
+                       </xsl:variable>
+                       <xsl:copy-of select="$Path_Point"/>
+                       <xsl:call-template name="To_LINESTRING">
+                           <xsl:with-param name="Path_Point" select="$Path_Point"/>
+                       </xsl:call-template>
+                   </xsl:when>
+                   
+                   <xsl:otherwise><xsl:message terminate="yes">#Error 111 - nie moze byc innego wyjatku
+                       Pos_found=<xsl:value-of select="$Pos_found"/>;
+                       $Next_PE_Pos=<xsl:value-of select="$Next_PE_Pos"/>;
+                       $Prev_PE_Pos=<xsl:value-of select="$Prev_PE_Pos"/>;
+                       abs($Pos_found - $Next_PE_Pos)=<xsl:value-of select="abs($Pos_found - $Next_PE_Pos)"/>
+                       abs($Pos_found - $Prev_PE_Pos)=<xsl:value-of select="abs($Pos_found - $Prev_PE_Pos)"/>
+                   </xsl:message></xsl:otherwise>
+               </xsl:choose>
+           </detect_next_PE>
+           
+       </xsl:template>
+    
+    
+    
+        <xsl:template name="To_LINESTRING">
+            <xsl:param name="Path_Point" required="yes"/>
+            <LINESTRING>
+                <xsl:value-of select="'LINESTRING ('"/>
+            <xsl:for-each select="$Path_Point/bp:Path_Point">
+                <xsl:value-of select="concat(@X,' ',@Y)"/>
+                <xsl:if test="position()!=last()"><xsl:value-of select="', '"/></xsl:if>
+            </xsl:for-each>
+                <xsl:value-of select="')'"/>
+            </LINESTRING>
+        </xsl:template>
     
         <xsl:template match="edge_joins_filled_paths" mode="edge_joins_filled_paths">
             <edge_joins_filled_paths>
@@ -71,7 +160,16 @@
         <item>
             <xsl:copy-of select="@*"/>
             <xsl:copy-of select="tried"/>
-            <xsl:apply-templates/>
+                <xsl:variable name="Path_Point">
+                <xsl:apply-templates/>
+                </xsl:variable>
+            <xsl:copy-of select="$Path_Point/tried"/>
+            <xsl:for-each select="$Path_Point/bp:Path_Point">
+                <bp:Path_Point>
+                    <xsl:attribute name="Pos" select="position()"/>
+                    <xsl:copy-of select="@*"/>
+                </bp:Path_Point>
+            </xsl:for-each>
         </item>
     </xsl:template>
     
@@ -108,6 +206,7 @@
             <xsl:attribute name="Y" select="$As_POINT_pos/pos[@pos=2]"/>
         </As_POINT_to_xml>
     </xsl:template>
+    <xsl:template match="*"/>
     
     
 </xsl:stylesheet>

+ 80 - 8
SE/dev/php-cli/edge_joins_filled_paths.xsl

@@ -22,25 +22,97 @@
                 <LINESTRING>
                     <xsl:attribute name="Count" select="count(*)"/>
                     <xsl:copy-of select="@*"/>
-                    <xsl:copy-of select="test1"/>
+                    <!--<xsl:copy-of select="test1"/>-->
                     <xsl:for-each select="bp:Path_Point">
                     <bp:Path_Point>
                         <xsl:copy-of select="@*"/>
                          <xsl:attribute name="Pos" select="position()"/>
-                         <xsl:copy-of select="."/>
+                         <xsl:attribute name="X" select="pos[@pos=2]"/>
+                         <xsl:attribute name="Y" select="pos[@pos=3]"/>
                     </bp:Path_Point>
                     </xsl:for-each>
                 </LINESTRING>
             </xsl:for-each>
         </xsl:variable>
-        <edge_paths_with_PE>
+        <!--<edge_paths_with_PE>-->
             <!--<PE_track>
                 <xsl:copy-of select="$PE_track"/>
             </PE_track>-->
+            <!--<SRC>
             <xsl:copy-of select="$PE_track"/>
-        </edge_paths_with_PE>
+            </SRC>-->
+            <PE_candidates_dump>
+                <xsl:call-template name="PE_candidates_dump">
+                    <xsl:with-param name="edge_paths_with_PE" select="$PE_track"/>
+                </xsl:call-template>
+            </PE_candidates_dump>
+        <!--</edge_paths_with_PE>-->
     </xsl:template>
 
+
+    <xsl:template name="dumb_frequency">
+        <xsl:param name="Count"/>
+        <xsl:param name="distance"/>
+        <xsl:choose>
+            <xsl:when test="$Count&lt;2">
+                <xsl:value-of select="2"/>
+            </xsl:when>
+            <xsl:when test="$Count&lt;3">
+                <xsl:value-of select="2"/>
+            </xsl:when>
+            <xsl:when test="$Count&lt;10">
+                <xsl:value-of select="3"/>
+            </xsl:when>
+            <xsl:when test="$Count&lt;15">
+                <xsl:value-of select="5"/>
+            </xsl:when>
+            <xsl:when test="$Count&lt;20">
+                <xsl:value-of select="10"/>
+            </xsl:when>
+            <xsl:when test="$Count&lt;30">
+                <xsl:value-of select="15"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select="20"/>
+            </xsl:otherwise>
+        </xsl:choose>        
+        
+        
+    </xsl:template>
+    
+    <xsl:template name="PE_candidates_dump">
+        <xsl:param name="edge_paths_with_PE" required="yes"/>
+        <xsl:param name="dumb_frequency" select="20"/>
+        <!--<PE_candidates_dump>-->
+            <xsl:attribute name="desc" select="'brakuje ominiecia punktow ways tylko do przylaczy i analizy dlugosci'"/>
+            <xsl:for-each select="$edge_paths_with_PE/LINESTRING">
+                <LINESTRING>
+                <xsl:variable name="Count" select="@Count"/>
+                <xsl:variable name="ID_Way" select="@ID_Way"/>
+                <xsl:variable name="distance" select="@distance"/>
+                <xsl:variable name="dumb_frequency">
+                    <xsl:call-template name="dumb_frequency">
+                        <xsl:with-param name="Count" select="$Count"/>
+                        <xsl:with-param name="distance" select="$distance"/>
+                    </xsl:call-template>
+                </xsl:variable>
+                <xsl:attribute name="ID_Way" select="$ID_Way"/>
+                <xsl:copy-of select="@*"/>
+                 
+                 <xsl:attribute name="dumb_frequency" select="$dumb_frequency"/>
+                    
+                    <xsl:for-each select="bp:Path_Point">
+                        <xsl:choose>
+                            <xsl:when test="@Pos mod $dumb_frequency = 0">
+                                <xsl:copy-of select="."/>
+                            </xsl:when>
+                        </xsl:choose>
+                    </xsl:for-each>
+                </LINESTRING>
+            </xsl:for-each>
+        <!--</PE_candidates_dump>-->
+        
+    </xsl:template>
     
     <xsl:template match="item">
         <xsl:choose>
@@ -67,11 +139,11 @@
         51.257032799079, 18.6449346 51.25849289908, 18.6467805 51.25926169908, 18.64743915153
         51.259545049387)</asText>-->
     <xsl:template match="asText">
-        <xsl:variable name="LINESTRING" select=" substring-before( substring-after(.,'LINESTRING (') , ')')  "/>
-            <test1><xsl:copy-of select="$LINESTRING"/></test1>
-            <xsl:for-each select="tokenize($LINESTRING,', ')">
+        <xsl:variable name="LINESTRING" select=" substring-before( substring-after(normalize-space(.),'LINESTRING (') , ')')  "/>
+            <!--<test1><xsl:copy-of select="$LINESTRING"/></test1>-->
+            <xsl:for-each select="tokenize($LINESTRING,',')">
                 <bp:Path_Point>
-                 <test2><xsl:copy-of select="."/></test2>
+                 <!--<test2><xsl:copy-of select="."/></test2>-->
                 <xsl:for-each select="tokenize(.,' ')">
                     <pos>
                         <xsl:attribute name="pos" select="position()"/>