Changeset 314 for tools

Show
Ignore:
Timestamp:
04/28/09 16:58:32 (11 months ago)
Author:
anton
Message:

First raw version of geocode service implemented

Location:
tools/routingservice/branches/wrs-2.0
Files:
2 added
16 modified
1 moved

Legend:

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

    r312 r314  
    66                <description>My test profile I use for testing</description> 
    77                <parameters> 
    8                         <parameter name="srid_in" type="integer" key="srid" value="4326" /> 
     8                        <parameter name="srid_in" type="integer" key="srid" value="EPSG:4326" /> 
    99                </parameters> 
    1010                <resources> 
    1111                        <rref ref="pgrouting" enabled="true" /> 
     12                        <rref ref="geocoder" enabled="true" /> 
    1213                </resources> 
    1314        </profile> 
     
    1617                <description>My test profile I use for testing</description> 
    1718                <parameters> 
    18                         <parameter name="srid_in" type="integer" key="srid" value="4326" /> 
     19                        <parameter name="srid_in" type="integer" key="srid" value="EPSG:4326" /> 
    1920                        <parameter name="table" type="string" key="table" value="_hcc_algo_shooting_pedestrian" /> 
    2021                </parameters> 
     
    2728                <description>My test profile I use for testing</description> 
    2829                <parameters> 
    29                         <parameter name="srid_in" type="integer" key="srid" value="4326" /> 
     30                        <parameter name="srid_in" type="integer" key="srid" value="EPSG:4326" /> 
    3031                        <parameter name="table" type="string" key="table" value="_hcc_algo_shooting_tollfree" /> 
    3132                </parameters> 
  • tools/routingservice/branches/wrs-2.0/data/resources.xml

    r312 r314  
    3737                </query> 
    3838        </resource> 
     39         
     40        <resource type="database" name="geocoder" 
     41                title="Geocoder Dumbo server"> 
     42                <description>PostgreSQL 8.1</description> 
     43                <parameters> 
     44                        <parameter name="srid" constant="true" type="integer" key="srid" value="EPSG:4326" /> 
     45                        <parameter name="units" constant="true" type="string" key="units" value="dd" /> 
     46                                 
     47                        <parameter name="precision" type="integer" key="code"/> 
     48                        <parameter name="x1" type="double" key="x"/> 
     49                        <parameter name="y1" type="double" key="y"/> 
     50                        <parameter name="address" type="string" key="address"/>                                                  
     51                </parameters> 
     52                <services> 
     53                        <sref ref="geocode" enabled="true" /> 
     54                </services> 
     55                <url>jdbc:postgresql://192.168.20.177:5432/geocoder</url> 
     56                <user>postgres</user> 
     57                <password></password> 
     58                <query> 
     59                        SELECT $output$ FROM $function$($input$) 
     60                </query> 
     61        </resource>      
    3962 
    4063</resources> 
  • tools/routingservice/branches/wrs-2.0/data/services.xml

    r305 r314  
    4242                </out> 
    4343        </service> 
    44  
     44        <service name="geocode" title="Geocoder"> 
     45                <description>Geocode a point to an address</description> 
     46                <templates> 
     47                        <template name="kml" format="xml" url="./data/templates/geocode/geocode_kml.st"/> 
     48                        <template name="geojson" format="json" url="./data/templates/geocode/geocode_geojson.st"/> 
     49                        <template name="xls" format="xml" url="./data/templates/geocode/geocode_xls.st"/> 
     50                </templates> 
     51                <in> 
     52                        <parameter key="address" type="string" name="address" /> 
     53                </in> 
     54                <out> 
     55                        <parameter key="x1" type="double" name="x1" /> 
     56                        <parameter key="y1" type="double" name="y1" /> 
     57                        <parameter key="address" type="string" name="address" /> 
     58                        <parameter key="precision" type="double" name="precision" /> 
     59                </out> 
     60        </service> 
     61                <service name="locate" title="Locator"> 
     62                <description>Locates an address by the given point</description> 
     63                <templates> 
     64                        <template name="kml" format="xml" url="./data/templates/locate/locate_kml.st"/> 
     65                        <template name="geojson" format="json" url="./data/templates/locate/locate_geojson.st"/> 
     66                        <template name="xls" format="xml" url="./data/templates/locate/locate_xls.st"/> 
     67                </templates> 
     68                <in> 
     69                        <parameter key="x1" type="double" name="x1" /> 
     70                        <parameter key="y1" type="double" name="y1" /> 
     71                </in> 
     72                <out> 
     73                        <parameter key="x1" type="double" name="x1" /> 
     74                        <parameter key="y1" type="double" name="y1" /> 
     75                        <parameter key="address" type="string" name="address" /> 
     76                        <parameter key="precision" type="double" name="precision" /> 
     77                </out> 
     78        </service> 
    4579</services> 
  • tools/routingservice/branches/wrs-2.0/data/templates/geocode/geocode_geojson.st

    r313 r314  
    11{ "type": "FeatureCollection", 
    22        "features": [ 
    3                 { "type": "Feature", 
    4                         "geometry": { 
     3$parameters:{ p |        
     4                \{ "type": "Feature", 
     5                        "geometry": \{ 
    56                                "type": "Point",  
    6                                 "coordinates": [ $point$ ] 
    7                         }, 
    8                         "crs": { 
     7                                "coordinates": [ $p.x1$ $p.y1$ ] 
     8                        \}, 
     9                        "crs": \{ 
    910                                "type": "EPSG", 
    10                                 "properties": {"code": "$srid$"} 
    11                         }, 
    12                         "properties": { 
    13                                 "address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA", 
    14                                 "AddressDetails": { 
    15                                         "Country": { 
    16                                                 "CountryNameCode": "US", 
    17                                                 "AdministrativeArea": { 
    18                                                         "AdministrativeAreaName": "CA", 
    19                                                         "SubAdministrativeArea": { 
    20                                                                 "SubAdministrativeAreaName": "Santa Clara", 
    21                                                                 "Locality": { 
    22                                                                         "LocalityName": "Mountain View", 
    23                                                                         "Thoroughfare": { 
    24                                                                                 "ThoroughfareName": "1600 Amphitheatre Pkwy" 
    25                                                                         }, 
    26                                                                         "PostalCode": { 
    27                                                                                 "PostalCodeNumber": "94043" 
    28                                                                         } 
    29                                                                 } 
    30                                                         } 
    31                                                 } 
    32                                         }, 
    33                                         "Accuracy": 8 
    34                                 }                        
    35                         } 
    36                 } 
     11                                "properties": \{"code": "$p.srid$"\} 
     12                        \}, 
     13                        "properties": \{         
     14                                "address": "$p.address$", 
     15                                "AddressDetails": \{ 
     16                                        "Country": \{ 
     17                                                "CountryNameCode": "$p.country$", 
     18                                                "AdministrativeArea": \{ 
     19                                                        "AdministrativeAreaName": "$p.area$", 
     20                                                        "SubAdministrativeArea": \{ 
     21                                                                "SubAdministrativeAreaName": "$p.subarea$", 
     22                                                                "Locality": \{ 
     23                                                                        "LocalityName": "$p.locality$", 
     24                                                                        "Thoroughfare": \{ 
     25                                                                                "ThoroughfareName": "$p.thouroughfare$" 
     26                                                                        \}, 
     27                                                                        "PostalCode": \{ 
     28                                                                                "PostalCodeNumber": "$p.postal$" 
     29                                                                        \} 
     30                                                                \} 
     31                                                        \} 
     32                                                \} 
     33                                        \}, 
     34                                        "Accuracy": "$p.precision$" 
     35                                \}                       
     36                        \} 
     37                \} 
     38};separator=","$                 
    3739        ], 
    3840        "status": { 
     
    4143        }, 
    4244        "user": { 
    43                 "request_id": "$request_id$" 
     45                "request_id": "$p.request_id$" 
    4446        }, 
    4547} 
  • tools/routingservice/branches/wrs-2.0/data/templates/geocode/geocode_georss_gml.st

    r313 r314  
    1414        </author> 
    1515        <id>http://this-request-url</id> 
    16          
     16 
     17$parameters:{ p |        
    1718        <entry> 
    1819                <title></title> 
    19                 <link href="http://this-request-url"/> 
    20                 <id>http://this-request-url</id> 
     20                <link href="$p.url$"/> 
     21                <id>$p.url$</id> 
    2122                <updated>2005-08-17T07:02:32Z</updated> 
    22                 <summary></summary> 
     23                <summary>$p.address$</summary> 
    2324                 
    2425                <georss:where> 
    25                         <gml:Point gml:id="p21" srsName="EPSG:$srid$"> 
    26                                 <gml:pos dimension="2">45.256 -71.92</gml:pos> 
     26                        <gml:Point gml:id="p21" srsName="EPSG:$p.srid$"> 
     27                                <gml:pos dimension="2">$p.x1$ $p.y1$</gml:pos> 
    2728                        </gml:Point> 
    2829                </georss:where> 
    2930        </entry> 
     31}$ 
    3032</feed> 
  • tools/routingservice/branches/wrs-2.0/data/templates/geocode/geocode_kml.st

    r313 r314  
    1515                </Style> 
    1616 
     17$parameters:{ p | 
    1718                <Placemark> 
    1819                        <name></name> 
    19                         <address>1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA</address> 
     20                        <address>$p.address$</address> 
    2021                        <description></description> 
    2122                        <styleUrl>#pointStyle</styleUrl> 
     
    2324                        <Point> 
    2425                                <altitudeMode>clampToGround</altitudeMode>  
    25                                 <coordinates>$point$</coordinates> 
     26                                <coordinates>$p.x1$,$p.y1$</coordinates> 
    2627                        </Point> 
    2728 
    2829                        <AddressDetails Accuracy="8"> 
    2930                                <Country> 
    30                                         <CountryNameCode>US</CountryNameCode> 
     31                                        <CountryNameCode>$p.country$</CountryNameCode> 
    3132                                        <AdministrativeArea> 
    32                                                 <AdministrativeAreaName>CA</AdministrativeAreaName> 
     33                                                <AdministrativeAreaName>$p.area$</AdministrativeAreaName> 
    3334                                                <SubAdministrativeArea> 
    34                                                         <SubAdministrativeAreaName>Santa Clara</SubAdministrativeAreaName> 
     35                                                        <SubAdministrativeAreaName>$p.subarea$</SubAdministrativeAreaName> 
    3536                                                        <Locality> 
    36                                                                 <LocalityName>Mountain View</LocalityName> 
     37                                                                <LocalityName>$p.locality$</LocalityName> 
    3738                                                                <Thoroughfare> 
    38                                                                         <ThoroughfareName>1600 Amphitheatre Pkwy</ThoroughfareName> 
     39                                                                        <ThoroughfareName>$p.thouroghfare$</ThoroughfareName> 
    3940                                                                </Thoroughfare> 
    4041                                                                <PostalCode> 
    41                                                                         <PostalCodeNumber>94043</PostalCodeNumber> 
     42                                                                        <PostalCodeNumber>$p.postal$</PostalCodeNumber> 
    4243                                                                </PostalCode> 
    4344                                                        </Locality> 
     
    4647                                </Country> 
    4748                        </AddressDetails> 
     49}$                               
    4850                         
    4951                        <ExtendedData xmlns:wrs="http://pgrouting.postlbs.org/wrs/1.1.0"> 
     
    5355                                </wrs:status> 
    5456                                <wrs:user> 
    55                                         <wrs:request_id>$request_id$</wrs:request_id> 
     57                                        <wrs:request_id>$p.request_id$</wrs:request_id> 
    5658                                </wrs:user> 
    5759                        </ExtendedData> 
  • tools/routingservice/branches/wrs-2.0/data/templates/geocode/geocode_xls.st

    r284 r314  
    44        xmlns:gml="http://www.opengis.net/gml"  
    55        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    6                          
     6 
     7$parameters:{ p |                        
    78        <xls:ResponseHeader sessionID=""/> 
    8         <xls:Response version="1.2" requestID="$request_id$" numberOfResponses="1"> 
     9        <xls:Response version="1.2" requestID="$p.request_id$" numberOfResponses="1"> 
    910                <xls:GeocodeResponse> 
    1011                        <xls:GeocodeResponseList numberOfGeocodedAddresses="1"> 
    1112                                <xls:GeocodedAddress> 
    1213                                        <gml:Point srsName="EPSG:4236"> 
    13                                                 <gml:pos dimension="2">40.123 139.456</gml:pos> 
     14                                                <gml:pos dimension="2">$p.y1$ $p.x1$</gml:pos> 
    1415                                        </gml:Point> 
    15                                         <xls:Address countryCode="" addressee=""> 
    16                                                 <xls:StreetAddress> 
    17                                                         <xls:Building number=""  
    18                                                                                 subdivision=""  
    19                                                                                 buildingName=""/> 
    20                                                         <xls:Street typePrefix=""  
    21                                                                                 typeSuffix=""  
    22                                                                                 officialName="" 
    23                                                                                 directionalPrefix="" 
    24                                                                                 muniOctant="gml:CompassPointEnumeration" 
    25                                                                                 /> 
    26                                                 </xls:StreetAddress> 
    27                                                 <xls:Place type="CountrySubdivision">神奈川県</xls:Place> 
    28                                                 <xls:Place type="CountrySecondarySubdivision"></xls:Place> 
    29                                                 <xls:Place type="Municipality">暪浜垂</xls:Place> 
    30                                                 <xls:Place type="MunicipalitySubdivision">䞭区</xls:Place> 
    31                                                 <xls:Place type="choume-banchi-go">1−−</xls:Place> 
    32                                                 <xls:PostalCode>245-0001</xls:PostalCode> 
    33                                         </xls:Address> 
    34                                         <xls:GeocodeMatchCode accuracy="0.0" matchType="go"/> 
    35                                         <!--  
    36                                                 or  
    37                                         --> 
     16 
    3817                                        <xls:Address countryCode="JA">           
    39                                                 <xls:freeFormAddress>神奈川県暪浜垂䞭区1䞁目</xls:freeFormAddress> 
     18                                                <xls:freeFormAddress>$p.address$</xls:freeFormAddress> 
    4019                                        </xls:Address>   
    41                                         <xls:GeocodeMatchCode accuracy="0.0" matchType="choume"/> 
     20                                        <xls:GeocodeMatchCode accuracy="$p.precision$" matchType="$p.match_type$"/> 
    4221                                </xls:GeocodedAddress> 
    4322                        </xls:GeocodeResponseList> 
    4423                </xls:GeocodeResponse> 
    4524        </xls:Response> 
     25}$       
    4626</xls:XLS> 
    4727 
  • tools/routingservice/branches/wrs-2.0/src/WRS.java

    r312 r314  
    291291        } 
    292292 
     293        /** 
     294         * Parses the url. 
     295         *  
     296         * @param req 
     297         *            the request to the restlet 
     298         *  
     299         * @return the service request 
     300         *  
     301         * @throws ArrayIndexOutOfBoundsException 
     302         *             the array index out of bounds exception 
     303         * @throws InvalidVersionException 
     304         *             the invalid version exception 
     305         * @throws InvalidProfileException 
     306         *             the invalid profile exception 
     307         * @throws InvalidServiceException 
     308         *             the invalid service exception 
     309         * @throws InvalidTemplateException 
     310         *             the invalid template exception 
     311         */ 
    293312        public ServiceRequest parseURL(Request req) 
    294313                        throws ArrayIndexOutOfBoundsException, InvalidVersionException, 
     
    339358                findResource(request); 
    340359 
    341                 // TODO parse and pass parameters 
    342  
    343360                // Pass parameters from resource to service request 
    344361                addParameters(request.getParameters(), request.getResource() 
     
    410427        } 
    411428 
     429        /** 
     430         * Adds the parameters. 
     431         *  
     432         * @param parameters 
     433         *            the parameters map 
     434         * @param toAdd 
     435         *            the map to add to parameters map 
     436         * @param source 
     437         *            the source of the parameters to add (URL, resource or profile) 
     438         */ 
    412439        private void addParameters(HashMap<String, Parameter> parameters, 
    413440                        HashMap<String, Parameter> toAdd, String source) 
    414441        { 
    415                 // TODO check for ability to override parameters 
    416  
    417442                Iterator<String> it = toAdd.keySet().iterator(); 
    418443                while (it.hasNext()) 
     
    467492        } 
    468493 
     494        /** 
     495         * Read configuration XML file. 
     496         *  
     497         * @param url 
     498         *            the URL of a configuration file 
     499         *  
     500         * @return the configuration 
     501         */ 
    469502        public Configuration readConfig(String url) 
    470503        { 
     
    517550        } 
    518551         
     552        /** 
     553         * Reads resources configuration file. 
     554         *  
     555         * @param url 
     556         *            the URL of a configuration file 
     557         */ 
    519558        private void readResources(String url) 
    520559        { 
     
    582621        } 
    583622 
     623        /** 
     624         * Reads profiles configuration file. 
     625         *  
     626         * @param url 
     627         *            the URL of a configuration file 
     628         */ 
    584629        private void readProfiles(String url) 
    585630        { 
     
    675720        } 
    676721 
     722        /** 
     723         * Reads templates configuration file. 
     724         *  
     725         * @param url 
     726         *            the URL of a configuration file 
     727         */ 
    677728        private Template readTemplate(util.service.Template temp) 
    678729        { 
     
    694745        } 
    695746 
     747        /** 
     748         * Reads services configuration file. 
     749         *  
     750         * @param url 
     751         *            the URL of a configuration file 
     752         */ 
    696753        private void readServices(String url) 
    697754        { 
     
    766823        } 
    767824 
     825        /** 
     826         * Find resource by service request. 
     827         *  
     828         * @param serviceRequest 
     829         *            the service request 
     830         */ 
    768831        private void findResource(ServiceRequest serviceRequest) 
    769832        { 
  • tools/routingservice/branches/wrs-2.0/src/handler/DatabaseHandler.java

    • Property svn:mergeinfo set to
    r312 r314  
    4949import com.vividsolutions.jts.io.ParseException; 
    5050 
    51 public class PgRoutingHandler extends ResourceHandler 
     51public class DatabaseHandler extends ResourceHandler 
    5252{ 
    5353        private Resource resource; 
     
    8181                                return new ArrayList(Arrays.asList(p)); 
    8282                        } 
     83                }, 
     84                GEOCODE 
     85                { 
     86                        ArrayList getParameters() 
     87                        { 
     88                                String[] p = { "address" }; 
     89                                return new ArrayList(Arrays.asList(p)); 
     90                        } 
    8391                }; 
    8492 
     
    8694        } 
    8795 
    88         public PgRoutingHandler() 
     96        public DatabaseHandler() 
    8997        { 
    9098                // TODO implement reading functions mapping from a config file 
     
    93101                this.functions.put("travel", "tsp_astar_directed_smart"); 
    94102                this.functions.put("catch", "driving_distance"); 
     103                this.functions.put("geocode", "geocode"); 
    95104        } 
    96105 
     
    139148                                                out.add(paraMap); 
    140149                                        } 
    141  
    142150                                } 
    143151                                catch (SQLException e) 
  • tools/routingservice/branches/wrs-2.0/src/handler/HandlerFactory.java

    r306 r314  
    2222        public static enum Handler 
    2323        { 
    24                 DATABASE(PgRoutingHandler.class); 
     24                DATABASE(DatabaseHandler.class); 
    2525 
    26                 private Class<? extends ResourceHandler> mappedClass; 
     26                private Class< ? extends ResourceHandler> mappedClass; 
    2727 
    28                 private Handler(Class<? extends ResourceHandler> h) 
     28                private Handler(Class< ? extends ResourceHandler> h) 
    2929                { 
    3030                        mappedClass = h; 
  • tools/routingservice/branches/wrs-2.0/src/handler/ResourceHandler.java

    r312 r314  
    8989                 
    9090                Geometry point = new WKTReader().read("POINT ("+x+" "+y+")"); 
    91                 Geometry targetPoint = JTS.transform( point, transform); 
     91                Geometry targetPoint = JTS.transform(point, transform); 
    9292                 
    9393                String[] result = {IOHelper.FORMATTER.format(targetPoint.getCoordinate().x), IOHelper.FORMATTER.format(targetPoint.getCoordinate().y)}; 
  • tools/routingservice/branches/wrs-2.0/src/model/Resource.java

    r298 r314  
    1919 
    2020import handler.HandlerFactory; 
    21 import handler.PgRoutingHandler; 
     21import handler.DatabaseHandler; 
    2222import handler.ResourceHandler; 
    2323 
     
    5252                DATABASE(JDBCConnectionPool.class); 
    5353 
    54                 private Class<? extends ObjectPool> poolType; 
    55  
    56                 PoolTypes(Class<? extends ObjectPool> p) 
     54                private Class< ? extends ObjectPool> poolType; 
     55 
     56                PoolTypes(Class< ? extends ObjectPool> p) 
    5757                { 
    5858                        this.poolType = p; 
     
    6363                                IllegalArgumentException, SecurityException, 
    6464                                InvocationTargetException 
    65                 {                        
     65                { 
    6666                        return (ObjectPool) poolType.getConstructors()[0] 
    6767                                        .newInstance(new Object[] { url, user, password }); 
     
    7171        private ObjectPool pool; 
    7272 
    73         public Resource(String name, String type, String url, String user, String password, String query) 
     73        public Resource(String name, String type, String url, String user, 
     74                        String password, String query) 
    7475        { 
    7576                super(); 
     
    8384                try 
    8485                { 
    85                         this.pool = PoolTypes.valueOf(type.toUpperCase()).getInstance(url, user, password); 
     86                        this.pool = PoolTypes.valueOf(type.toUpperCase()).getInstance(url, 
     87                                        user, password); 
    8688                } 
    8789                // TODO process the error more carefully 
  • tools/routingservice/branches/wrs-2.0/src/util/format/FillerFactory.java

    r305 r314  
    3131                GPX(GPXTemplateFiller.class); 
    3232 
    33                 private Class<? extends TemplateFiller> fillerType; 
     33                private Class< ? extends TemplateFiller> fillerType; 
    3434 
    35                 Fillers(Class<? extends TemplateFiller> p) 
     35                Fillers(Class< ? extends TemplateFiller> p) 
    3636                { 
    3737                        this.fillerType = p; 
  • tools/routingservice/branches/wrs-2.0/src/util/format/FormatParser.java

    r298 r314  
    2929        protected enum DataTypes 
    3030        { 
    31                 POINTS, LINES, ADDRESSES, DISTANCE, UOM, LOCALE, CRS, REQUEST_ID, CREDENTIALS; 
     31                POINTS, LINES, ADDRESS, DISTANCE, UOM, LOCALE, CRS, REQUEST_ID, CREDENTIALS; 
    3232        } 
    3333 
  • tools/routingservice/branches/wrs-2.0/src/util/format/JSONParser.java

    r306 r314  
    8686                                        String crs = json.getString(key); 
    8787                                        StringTokenizer crsst = new StringTokenizer(crs, ","); 
    88                                          
     88 
    8989                                        Parameter in = new Parameter(); 
    9090                                        in.setName("srid_in"); 
     
    9494 
    9595                                        params.add(in); 
    96                                          
     96 
    9797                                        if (crsst.hasMoreTokens()) 
    9898                                        { 
     
    105105                                                params.add(out); 
    106106                                        } 
     107                                        break; 
     108                                case ADDRESS: 
     109                                        String address = json.getString(key).trim(); 
     110                                        Parameter addr = new Parameter(); 
     111                                        addr.setName("address"); 
     112                                        addr.setSource("url"); 
     113                                        addr.setValue(address); 
     114                                        addr.setType(ResourceHandler.STRING); 
     115                                        params.add(addr); 
    107116                                        break; 
    108117                                } 
  • tools/routingservice/branches/wrs-2.0/src/util/format/ParserFactory.java

    r298 r314  
    2525                                null), GPX(null); 
    2626 
    27                 private Class<? extends FormatParser> parserType; 
     27                private Class< ? extends FormatParser> parserType; 
    2828 
    29                 Formats(Class<? extends FormatParser> p) 
     29                Formats(Class< ? extends FormatParser> p) 
    3030                { 
    3131                        this.parserType = p; 
  • tools/routingservice/branches/wrs-2.0/src/util/format/TemplateFiller.java

    r312 r314  
    6767                        HashMap<String, Parameter> paraMap = it.next(); 
    6868                        HashMap<String, String> stringMap = new HashMap<String, String>(); 
    69                         Iterator<String> keys = paraMap.keySet().iterator(); 
    70                         while (keys.hasNext()) 
     69                        Iterator<Parameter> params = paraMap.values().iterator(); 
     70                        while (params.hasNext()) 
    7171                        { 
    72                                 String key = keys.next(); 
    73                                 Parameter p = paraMap.get(key); 
     72                                Parameter p = params.next(); 
    7473                                String value = p.getValue(); 
    7574                                // Geometry string needs to be handled in a special way 
     
    132131                                        value = getGeometryString(points); 
    133132                                } 
    134                                 stringMap.put(key, value); 
     133                                stringMap.put(p.getName(), value); 
    135134                        } 
    136135                        out.add(stringMap);