Changeset 305 for tools

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

GeoJSON template fixed for catch service

Location:
tools/routingservice/branches/wrs-2.0
Files:
10 modified

Legend:

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

    r298 r305  
    88                        <parameter name="srid" type="integer" key="srid" value="4326" /> 
    99                        <parameter name="units" type="string" key="units" value="dd" /> 
    10                         <parameter name="box" type="double" key="box" value="0.1" /> 
     10                        <parameter name="rbox" type="double" key="box" value="0.1" /> 
     11                        <parameter name="box" type="double" key="box" value="0.01" /> 
    1112                        <parameter name="cost_value" type="string" key="cost_value" value="length" /> 
    1213                        <parameter name="reverse_cost_value" type="string" key="reverse_cost_value" value="reverse_cost" /> 
  • tools/routingservice/branches/wrs-2.0/data/services.xml

    r302 r305  
    3131                        <template name="gml" format="xml" url="./data/templates/catch/catch_gml.st"/> 
    3232                        <template name="ol" format="html" url="./data/templates/catch/catch_openlayers.st"/> 
     33                        <template name="geojson" format="json" url="./data/templates/catch/catch_geojson.st"/> 
    3334                </templates> 
    3435                <in> 
  • tools/routingservice/branches/wrs-2.0/data/templates/catch/catch_geojson.st

    r284 r305  
    11{ "type": "FeatureCollection", 
    22        "features": [ 
    3                 { "type": "Feature", 
    4                         "geometry": { 
     3$parameters:{ p | 
     4                \{ "type": "Feature", 
     5                        "geometry": \{ 
    56                                "type": "Polygon", 
    6                                 "coordinates": [[ $poly$ ]] 
    7                         }, 
    8                         "crs": { 
     7                                "coordinates": [ 
     8                                        [$p.polygon$] 
     9                                ] 
     10                        \}, 
     11                        "crs": \{ 
    912                                "type": "EPSG", 
    10                                 "properties": {"code": "srid"} 
    11                         }, 
    12                         "properties": {} 
    13                 } 
     13                                "properties": \{"code": "srid"\} 
     14                        \}, 
     15                        "properties": \{ 
     16                                "id": "$p.id$" 
     17                        \} 
     18                \} 
     19};separator=","$ 
    1420        ], 
    1521        "status": { 
    1622                "code": 200, 
    17                 "request": "catch" 
     23                "request": "route" 
    1824        }, 
    1925        "user": { 
  • tools/routingservice/branches/wrs-2.0/data/templates/catch/catch_openlayers.st

    r304 r305  
    88    <script type="text/javascript"> 
    99        var map; 
    10                 var geojson = { "type": "FeatureCollection", 
    11                                                 "features": [ 
    12                                                         { "type": "Feature", 
    13                                                                 "geometry": { 
    14                                                                         "type": "Polygon", 
    15                                                                         "coordinates": [[ $poly$ ]] 
    16                                                                 }, 
    17                                                                 "crs": { 
    18                                                                         "type": "EPSG", 
    19                                                                         "properties": {"code": "srid"} 
    20                                                                 }, 
    21                                                                 "properties": {} 
    22                                                         } 
    23                                                 ], 
    24                                                 "status": { 
    25                                                         "code": 200, 
    26                                                         "request": "catch" 
    27                                                 }, 
    28                                                 "user": { 
    29                                                         "request_id": "$request_id$" 
    30                                                 } 
    31                                         }; 
     10                var geojson =  
     11                 
     12                        { "type": "FeatureCollection", 
     13                                "features": [ 
     14                        $parameters:{ p | 
     15                                        \{ "type": "Feature", 
     16                                                "geometry": \{ 
     17                                                        "type": "Polygon", 
     18                                                        "coordinates": [ 
     19                                                                [$p.polygon$] 
     20                                                        ] 
     21                                                \}, 
     22                                                "crs": \{ 
     23                                                        "type": "EPSG", 
     24                                                        "properties": \{"code": "srid"\} 
     25                                                \}, 
     26                                                "properties": \{ 
     27                                                        "id": "$p.id$" 
     28                                                \} 
     29                                        \} 
     30                        };separator=","$ 
     31                                ], 
     32                                "status": { 
     33                                        "code": 200, 
     34                                        "request": "route" 
     35                                }, 
     36                                "user": { 
     37                                        "request_id": "$request_id$" 
     38                                } 
     39                        }; 
    3240 
    3341        function init() { 
  • tools/routingservice/branches/wrs-2.0/data/templates/route/route_xls.st

    r297 r305  
    99                <xls:DetermineRouteResponse> 
    1010                        <xls:RouteSummary> 
    11                                 <xls:TotalTime>PT13M7.000S</xls:TotalTime> 
     11                                <xls:TotalTime></xls:TotalTime> 
    1212                                <xls:TotalDistance uom="M" value="14.88" accuracy=""/> 
    1313                                <xls:BoundingBox srsName="EPSG:4326"> 
     
    2727                        <xls:RouteInstructionsList xls:lang="en" format="text/plain"> 
    2828$parameters:{ p | 
    29                                 <xls:RouteInstruction duration="PT12.000S" description=""> 
     29                                <xls:RouteInstruction duration="" description=""> 
    3030                                        <xls:Instruction></xls:Instruction> 
    3131                                        <xls:distance uom="M" value="$p.rlength$" accuracy=""/> 
  • tools/routingservice/branches/wrs-2.0/lib/org/json/JSONArray.java

    r290 r305  
    7979 
    8080 * @author JSON.org 
    81  * @version 2009-02-09 
     81 * @version 2008-02-09 
    8282 */ 
    8383public class JSONArray { 
  • tools/routingservice/branches/wrs-2.0/lib/org/json/JSONObject.java

    r290 r305  
    8585 * </ul> 
    8686 * @author JSON.org 
    87  * @version 2009-03-06 
     87 * @version 2008-03-06 
    8888 */ 
    8989public class JSONObject { 
  • tools/routingservice/branches/wrs-2.0/src/WRS.java

    r298 r305  
    108108                        { 
    109109                                return MediaType.TEXT_JAVASCRIPT; 
     110                        } 
     111                }, 
     112                HTML 
     113                { 
     114                        MediaType getType() 
     115                        { 
     116                                return MediaType.TEXT_HTML; 
    110117                        } 
    111118                }, 
  • tools/routingservice/branches/wrs-2.0/src/handler/PgRoutingHandler.java

    r298 r305  
    7171                        ArrayList getParameters() 
    7272                        { 
    73                                 String[] p = { "table", "x1", "y1", "distance", "box", "cost_value", 
     73                                String[] p = { "table", "x1", "y1", "distance", "rbox", "cost_value", 
    7474                                                "reverse_cost_value", "directed", "hasrc" }; 
    7575                                return new ArrayList(Arrays.asList(p)); 
  • tools/routingservice/branches/wrs-2.0/src/util/format/FillerFactory.java

    r298 r305  
    2828                XLS(XLSTemplateFiller.class), 
    2929                GEORSS(null), 
     30                OL(GeoJSONTemplateFiller.class), 
    3031                GPX(GPXTemplateFiller.class); 
    3132