<commit_before><?php  
 /**********************************************************************
 *
 * purpose: a connector r.los GRASS function
 *
 * authors: <NAME> (...) and <NAME> (<EMAIL>)
 *
 * TODO:
 *   - a lot...
 * 
 **********************************************************************
 *
 * Copyright (C) 2006 ominiverdi.org
 *  
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 **********************************************************************/


 include('../include/config.php');
 
        $map = ms_newMapObj($map_path.$map_file);
    
    
	$maxradius = 3000;

if ($_POST['radius'] > $maxradius) {
      die ("In this example, radius can't be greater of $maxradius.Please use suggested value.");
   
   } elseif ($_POST['x']  < 589435 ||  $_POST['y']  < 4914010 || $_POST['x']  > 609527 ||  $_POST['y'] >  4928060) {
     die("The point it's outside the extent. Please use suggested value.");
     
     }else
   {
      
//Crea il file contenente le coordinate
        
	$input_id = sprintf("%0.6d",rand(0,999999));
        $input_name = "input".$input_id.".txt";
        $input_url=$img_path.$input_name;
  	$x=$_POST['x'];
	$y=$_POST['y'];
        $array_cord = array($x,$y);
        $coord = implode(",", $array_cord);
	file_put_contents($input_url,$coord);

//Crea la richiesta per pywps
    
   $stringa_query = $cgi_executable."?service=wps&version=0.4.0&request=Execute&Identifier=buffer&";
    $array = array('point',$input_url,'radius',$_POST['radius']);
    $comma_separated = implode(",", $array);
    $stringa_query .= "datainputs=";
    $stringa_query .= $comma_separated;
    $stringa_query .= "&status=true&store=true";

//L'indirizzo completo è terminato, estraggo il nome del file    
//TODO: questa parte va debuggata cos com' fa un po' acqua
    $dom = new DOMDocument();
    $dom->load($stringa_query);
    $CVR = $dom->getElementsByTagName('ComplexValueReference');
    $nodo = $CVR->item(0)->getAttribute('reference');
    <commit_msg>embrio updating<commit_after><?php  
 /**********************************************************************
 *
 * purpose: a connector r.los GRASS function
 *
 * authors: <NAME> (...) and <NAME> (<EMAIL>)
 *
 * TODO:
 *   - a lot...
 * 
 **********************************************************************
 *
 * Copyright (C) 2006 ominiverdi.org
 *  
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 **********************************************************************/


 include('../include/config.php');
 
        $map = ms_newMapObj($map_path.$map_file);
    
    
	$maxradius = 3000;

if ($_POST['radius'] > $maxradius) {
      die ("In this example, radius can't be greater of $maxradius.Please use suggested value.");
   
   /*} 
   elseif ($_POST['x']  < 589435 ||  $_POST['y']  < 4914010 || $_POST['x']  > 609527 ||  $_POST['y'] >  4928060) {
     die("The point it's outside the extent. Please use suggested value.");
     */
     }else
   {
      
//Crea il file contenente le coordinate
        
	$input_id = sprintf("%0.6d",rand(0,999999));
        $input_name = "input".$input_id.".txt";
        $input_url=$img_path.$input_name;
  	$x=$_POST['x'];
	$y=$_POST['y'];
        $array_cord = array($x,$y);
        $coord = implode(",", $array_cord);
	file_put_contents($input_url,$coord);

//Crea la richiesta per pywps
    
   $stringa_query = $cgi_executable."?service=wps&version=0.4.0&request=Execute&Identifier=buffer&";
    $array = array('point',$input_url,'radius',$_POST['radius']);
    $comma_separated = implode(",", $array);
    $stringa_query .= "datainputs=";
    $stringa_query .= $comma_separated;
    $stringa_query .= "&status=true&store=true";

//L'indirizzo completo è terminato, estraggo il nome del file    
//TODO: questa parte va debuggata cos com' fa un po' acqua
    $dom = new DOMDocument();
    $dom->load($stringa_query);
    $CVR = $dom->getElementsByTagName('ComplexValueReference');
    $nodo = $CVR->item(0)->getAttribute('reference');
    
{'fraction_non_alphanumeric': 0.21044720030063885, 'fraction_numerical': 0.022172115745960164, 'mean_word_length': 3.7442067736185383, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2129825', 'n_tokens_mistral': 1694, 'n_tokens_neox': 1586, 'n_words': 477}