pgRouting

Changeset 166

Show
Ignore:
Timestamp:
05/08/08 12:41:58 (7 months ago)
Author:
anton
Message:

Some code cleaning

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/routingservice/src/jp/co/orkney/restlet/util/Configuration.java

    r164 r166  
    5959{ 
    6060    public static final String API_KEY = "api_key"; 
    61  
    6261    public static final String SIGNATURE = "signature"; 
    63  
    6462    public static final String CLIENT_ID = "id"; 
    6563 
    6664    private String urlConfigurationFile = "./configuration.xml"; 
    67  
    6865    private String urlXMLTemplateQuery = "./pool.xml"; 
    69  
    7066    private String commandCapabilities = "capabilities"; 
    71  
    7267    private String versionNumber = "1.0.0"; 
    73  
    7468    private String port; 
    75  
    7669    private String urlLog; 
    77  
    7870    private int modeLog; 
    79  
    8071    private String localhost; 
    81  
    8272    private String urlCss; 
    83  
    8473    public Vector<Provider> providers; 
    85  
    8674    private int askCapabilities; // -1 by default, 0 host capabilities, 1 
    8775 
     
    8977 
    9078    private Provider provider; 
    91  
    9279    private Service service; 
    93  
    9480    private Format formatIn; 
    95  
    9681    private Format formatOut; 
    97  
    9882    private int iProvider = 0; 
    99  
    10083    private int iService = 0; 
    101  
    10284    private int iFormat = 0; 
    10385 
     
    171153            Vector<Service> services = new Vector<Service>(); 
    172154 
    173             // TODO Replace it with proper constructor 
    174155            while (itService.hasNext()) 
    175156            { 
     
    189170                service.setDataProjection(currentService.getChild("projection") 
    190171                        .getAttributeValue("srid")); 
     172                 
    191173                // TODO read units from the configuration 
    192                 // probably it is better to create Projection class 
     174                // probably it is better to create Projection class     
    193175                try 
    194176                { 
     
    338320        if ((iService = isService(urlSplit[3].split("\\.")[0])) != -1) 
    339321        { 
    340             // TODO Why not just assign service = 
    341             // provider.getServices().get(iService) ? 
     322            /* 
    342323            Service tmpService = provider.getServices().get(iService); 
    343324            service = new Service(tmpService.getName(), tmpService 
     
    345326                    .isEnable(), tmpService.getParameters(), null, tmpService 
    346327                    .getDatabaseConfiguration(), tmpService.getLimit()); 
     328                    */ 
     329            service = provider.getServices().get(iService); 
    347330        } 
    348331        else 
  • branches/routingservice/src/jp/co/orkney/restlet/WebRouting.java

    r149 r166  
    7474public class WebRouting 
    7575{ 
    76         private String result = ""; 
     76        static final String CLOSEST_EDGE = "closest_edge"; 
     77        static final String SHORTEST_PATH = "shortest_path"; 
     78        static final String DRIVING_DISTANCE = "driving_distance"; 
     79        static final String TSP = "traveling_sales_person"; 
     80     
     81        private String result = ""; 
    7782        private MediaType resultFormat; 
    7883        private Log log; 
     
    224229                                                                GeoAction action = null; 
    225230 
    226                                                                 // APPEL DES FONCTIONS --> 
    227                                                                 if (configuration.getService().getName().equals("closest_edge")) 
     231                                                                // Choosing an action --> 
     232                                                                if (configuration.getService().getName().equals(CLOSEST_EDGE)) 
    228233                                                                        action = new ClosestEdge(configuration, connection, ioHelper, log); 
    229                                                                 else if (configuration.getService().getName().equals("shortest_path")) 
     234                                                                else if (configuration.getService().getName().equals(SHORTEST_PATH)) 
    230235                                                                        action = new ShortestPath(configuration, connection, ioHelper, log); 
    231                                                                 else if (configuration.getService().getName().equals("driving_distance")) 
     236                                                                else if (configuration.getService().getName().equals(DRIVING_DISTANCE)) 
    232237                                                                        action = new DrivingDistance(configuration, connection, ioHelper, log); 
    233                                                                 else if (configuration.getService().getName().equals("traveling_sales_person")) 
     238                                                                else if (configuration.getService().getName().equals(TSP)) 
    234239                                                                        action = new TravelingSalesPerson(configuration, connection, ioHelper, log); 
    235240                                                                try