Changeset 295 for tools

Show
Ignore:
Timestamp:
04/15/09 14:50:04 (17 months ago)
Author:
anton
Message:

KML support for catch and route services added

Location:
tools/routingservice/branches/wrs-2.0
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • tools/routingservice/branches/wrs-2.0/data/resources.xml

    r294 r295  
    44        <resource type="database" name="pgrouting" 
    55                title="pgRouting instance on Dumbo server"> 
    6                 <description>My test profile I use for testing</description> 
     6                <description>pgRouting 1.0.1, PostGIS 1.11, PostgreSQL 8.1</description> 
    77                <parameters> 
    88                        <parameter name="srid" type="integer" key="srid" value="4326" /> 
  • tools/routingservice/branches/wrs-2.0/data/services.xml

    r294 r295  
    66                <templates> 
    77                        <template name="gml" format="xml" url="./data/templates/route/route_gml.st"/> 
     8                        <template name="kml" format="xml" url="./data/templates/route/route_kml.st"/> 
    89                </templates> 
    910                <in> 
     
    2223                <description>Returns a polygon representing a catchment area for going from point A within distance D</description> 
    2324                <templates> 
    24                         <template name="kml" format="xml" url="./data/templates/route/route_kml.st"/> 
     25                        <template name="kml" format="xml" url="./data/templates/catch/catch_kml.st"/> 
    2526                </templates> 
    2627                <in> 
  • tools/routingservice/branches/wrs-2.0/data/templates/catch/catch_kml.st

    r284 r295  
    2323                        <description></description> 
    2424                        <styleUrl>#polygonStyle</styleUrl> 
    25                          
     25 
     26$parameters:{ p |                        
    2627                        <Polygon> 
    2728                                <tessellate>1</tessellate> 
     
    2930                                <outerBoundaryIs> 
    3031                                        <LinearRing> 
    31                                                 <coordinates>$poly$</coordinates> 
     32                                                <coordinates> 
     33                                                $p.polygon$ 
     34                                                </coordinates> 
    3235                                        </LinearRing> 
    3336                                </outerBoundaryIs> 
    3437                        </Polygon> 
    35                          
     38}$                       
    3639                        <ExtendedData> 
    3740                                <wrs:status> 
  • tools/routingservice/branches/wrs-2.0/data/templates/route/route_kml.st

    r284 r295  
    2020                         
    2121                        <MultiGeometry> 
    22 $edges:{ e | 
    23                                 <LineString id="$e.id$"> 
     22$parameters:{ p | 
     23                                <LineString id="$p.id$"> 
    2424                                        <tessellate>1</tessellate> 
    2525                                        <altitudeMode>clampToGround</altitudeMode>  
    2626                                        <coordinates> 
    27                                                 $e.points:{ p |$p.x$,$p.y$,0};separator=" "$ 
     27                                                $p.line$ 
    2828                                        </coordinates> 
    2929                                </LineString> 
  • tools/routingservice/branches/wrs-2.0/src/WRS.java

    r294 r295  
    212212                                                } 
    213213                                        } 
    214  
     214                                         
     215                                        String templateType = serviceRequest.getTemplate().getFormat(); 
     216                                        response.setEntity(result, MIMETypes.valueOf( 
     217                                                        templateType.toUpperCase()).getType()); 
    215218                                } 
    216219                                catch (InvalidVersionException e) 
     
    244247                                        response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); 
    245248                                } 
    246  
    247                                 String templateType = serviceRequest.getTemplate().getFormat(); 
    248                                 response.setEntity(result, MIMETypes.valueOf( 
    249                                                 templateType.toUpperCase()).getType()); 
     249                                catch (NullPointerException e) 
     250                                { 
     251                                        log.logger 
     252                                                        .warning("Invalid URL. Reqest can't be processed."); 
     253                                        response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); 
     254                                } 
     255 
    250256                        } 
    251257                }; 
  • tools/routingservice/branches/wrs-2.0/src/util/format/FillerFactory.java

    r294 r295  
    66        public static enum Fillers 
    77        { 
    8                 JSON(null), GEOJSON(null), KML(null), GML(GMLTemplateFiller.class), XLS( 
    9                                 null), GEORSS(null), GPX(null); 
     8                JSON(null), GEOJSON(null), KML(KMLTemplateFiller.class), GML( 
     9                                GMLTemplateFiller.class), XLS(null), GEORSS(null), GPX(null); 
    1010 
    1111                private Class<? extends TemplateFiller> fillerType;