Bienvenue sur PostGIS.fr

Bienvenue sur PostGIS.fr , le site de la communauté des utilisateurs francophones de PostGIS.

PostGIS ajoute le support d'objets géographique à la base de données PostgreSQL. En effet, PostGIS "spatialise" le serverur PostgreSQL, ce qui permet de l'utiliser comme une base de données SIG.

Maintenu à jour, en fonction de nos disponibilités et des diverses sorties des outils que nous testons, nous vous proposons l'ensemble de nos travaux publiés en langue française.


Ignore:
Timestamp:
02/04/2012 02:38:35 (12 years ago)
Author:
djay
Message:

Fix language in the code

Location:
trunk/workshop-routing-foss4g/web
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/workshop-routing-foss4g/web/php/pgrouting.php

    r76 r80  
    11<?php 
    22 
    3    // Database connection settings 
     3   // Paramétrage de la connexion à la base de données 
    44   define("PG_DB"  , "routing"); 
    55   define("PG_HOST", "localhost");  
     
    88   define("TABLE",   "ways"); 
    99 
    10    // Retrieve start point 
     10   // Récupérer le point de départ 
    1111   $start = split(' ',$_REQUEST['startpoint']); 
    1212   $startPoint = array($start[0], $start[1]); 
    1313 
    14    // Retrieve end point 
     14   // Récupérer le point d'arrivée 
    1515   $end = split(' ',$_REQUEST['finalpoint']); 
    1616   $endPoint = array($end[0], $end[1]); 
     
    2020<?php 
    2121 
    22    // Find the nearest edge 
     22   // Trouver le tronçon le plus proche 
    2323   $startEdge = findNearestEdge($startPoint); 
    2424   $endEdge   = findNearestEdge($endPoint); 
    2525 
    26    // FUNCTION findNearestEdge 
     26   // FONCTION findNearestEdge 
    2727   function findNearestEdge($lonlat) { 
    2828 
    29       // Connect to database 
     29      // Connexion à la base de données 
    3030      $con = pg_connect("dbname=".PG_DB." host=".PG_HOST." user=".PG_USER); 
    3131 
     
    4848      $edge['the_geom'] = pg_fetch_result($query, 0, 3);   
    4949 
    50       // Close database connection 
     50      // Fermer la connexion 
    5151      pg_close($con); 
    5252 
     
    5858<?php 
    5959 
    60    // Select the routing algorithm 
     60   // Choisir un algorithme de parcours 
    6161   switch($_REQUEST['method']) { 
    6262 
     
    106106        break;    
    107107 
    108    } // close switch 
     108   } // fin switch 
    109109 
    110    // Connect to database 
     110   // Connexion à la base de données 
    111111   $dbcon = pg_connect("dbname=".PG_DB." host=".PG_HOST." user=".PG_USER); 
    112112 
    113    // Perform database query 
     113   // Exécuter une requête 
    114114   $query = pg_query($dbcon,$sql);  
    115115    
     
    118118<?php 
    119119 
    120    // Return route as GeoJSON 
     120   // Renvoit un chemin au format GeoJSON 
    121121   $geojson = array( 
    122122      'type'      => 'FeatureCollection', 
     
    124124   );  
    125125   
    126    // Add edges to GeoJSON array 
     126   // Ajouter un tronçon au tableau GeoJSON 
    127127   while($edge=pg_fetch_assoc($query)) {   
    128128 
     
    140140      ); 
    141141       
    142       // Add feature array to feature collection array 
     142      // Ajouter un tableau d'éléments au tableau de collection d'éléments 
    143143      array_push($geojson['features'], $feature); 
    144144   } 
    145145 
    146146         
    147    // Close database connection 
     147   // Fermeture de la connexion 
    148148   pg_close($dbcon); 
    149149 
    150    // Return routing result 
     150   // Renvoyer le résultat 
    151151   header('Content-type: application/json',true); 
    152152   echo json_encode($geojson); 
  • trunk/workshop-routing-foss4g/web/routing-0.html

    r76 r80  
    22<head> 
    33 
    4 <title>A Basic GeoExt Page</title> 
     4<title>Une page GeoExt de base</title> 
    55<script src="ext/adapter/ext/ext-base.js" type="text/javascript"></script> 
    66<script src="ext/ext-all.js"  type="text/javascript"></script> 
  • trunk/workshop-routing-foss4g/web/routing-final.html

    r76 r80  
    22<head> 
    33 
    4 <title>A Basic GeoExt Page</title> 
     4<title>Une page GeoExt de base</title> 
    55<script src="ext/adapter/ext/ext-base.js" type="text/javascript"></script> 
    66<script src="ext/ext-all.js"  type="text/javascript"></script> 
     
    1717<script type="text/javascript"> 
    1818 
    19      // global projection objects (uses the proj4js lib) 
     19     // Objets globaux projection (utilise la librairie proj4js) 
    2020     var epsg_4326 = new OpenLayers.Projection("EPSG:4326"), 
    2121         epsg_900913 = new OpenLayers.Projection("EPSG:900913"); 
     
    2323     function pgrouting(store, layer, method) { 
    2424         if (layer.features.length == 2) { 
    25              // erase the previous route 
     25             // Effacer le chemin précédent 
    2626             store.removeAll(); 
    2727 
    28              // transform the two geometries from EPSG:900913 to EPSG:4326 
     28             // Re-projÚte les deux géométries de EPSG:900913 et EPSG:4326 
    2929             var startpoint = layer.features[0].geometry.clone(); 
    3030             startpoint.transform(epsg_900913, epsg_4326); 
     
    3232             finalpoint.transform(epsg_900913, epsg_4326); 
    3333 
    34              // load to route 
     34             // Charge le chemin 
    3535             store.load({ 
    3636                 params: { 
     
    4444 
    4545    Ext.onReady(function() { 
    46         // create the map panel 
     46        // Création du paneau carte 
    4747        var panel = new GeoExt.MapPanel({ 
    4848            renderTo: "gxmap", 
     
    5858        var map = panel.map; 
    5959 
    60         // create the layer where the route will be drawn 
     60        // Création de la couche où le chemin sera dessiné 
    6161        var route_layer = new OpenLayers.Layer.Vector("route", { 
    6262            styleMap: new OpenLayers.StyleMap(new OpenLayers.Style({ 
     
    6666        }); 
    6767 
    68         // create the layer where the start and final points will be drawn 
     68        // Création de la couche où le point de départ et d'arrivée sront dessinés 
    6969        var points_layer = new OpenLayers.Layer.Vector("points"); 
    7070 
    71         // when a new point is added to the layer, call the pgrouting function 
     71        // Lorsqu'un nouveau point est ajouté à la couche, appeler la fonction pgrouting 
    7272        points_layer.events.on({ 
    7373            featureadded: function() { 
     
    7676        }); 
    7777 
    78         // add the layers to the map 
     78        // Ajouter la couche à la carte 
    7979        map.addLayers([points_layer, route_layer]); 
    8080 
    81         // create the control to draw the points (see the DrawPoints.js file) 
     81        // Création du control pour dessiner les point (voir le fichier DrawPoints.js) 
    8282        var draw_points = new DrawPoints(points_layer); 
    8383 
    84         // create the control to move the points 
     84        // Création du control pour déplacer les points 
    8585        var drag_points = new OpenLayers.Control.DragFeature(points_layer, { 
    8686            autoActivate: true 
    8787        }); 
    8888 
    89         // when a point is moved, call the pgrouting function 
     89        // Lorsqu'un point est déplacé, appeler la fonction pgrouting 
    9090        drag_points.onComplete = function() { 
    9191              pgrouting(store, points_layer, method.getValue()); 
    9292        }; 
    9393 
    94         // add the controls to the map 
     94        // Ajouter les controls à la carte 
    9595        map.addControls([draw_points, drag_points]); 
    9696 
    97         // create the store to query the web service 
     97        // Création du store pour interroger le service web 
    9898        var store = new GeoExt.data.FeatureStore({ 
    9999            layer: route_layer, 
     
    112112        }); 
    113113 
    114         // create the method combo box 
     114        // Création de la liste déroulante 
    115115        var method = new Ext.form.ComboBox({ 
    116116            renderTo: "method", 
     
    129129            } 
    130130        }); 
    131         // default method is Shortest Path Dijkstra 
     131        // Définir Disjkstra comme méthode par défaut 
    132132        method.setValue("SPD"); 
    133133    }); 
Note: See TracChangeset for help on using the changeset viewer.