Changeset 404
- Timestamp:
- Dec 3, 2006, 5:47:37 PM (14 years ago)
- Location:
- trunk/npemap.org.uk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/npemap.org.uk/cgi/geocoder.fcgi
r403 r404 93 93 94 94 # What postcode were they asking about? 95 if(defined $cgi->param("postcode") ) {95 if(defined $cgi->param("postcode") && $cgi->param("postcode")) { 96 96 $limit_results = 1; 97 97 $request{type} = "location"; … … 105 105 next REQUEST; 106 106 } 107 } elsif(defined $cgi->param("easting") && defined $cgi->param("northing")) { 107 } elsif(defined $cgi->param("easting") && $cgi->param("easting") && 108 defined $cgi->param("northing") && $cgi->param("northing")) { 108 109 $request{type} = "postcode"; 109 110 $request{easting} = $cgi->param("easting"); -
trunk/npemap.org.uk/static/api/geocoder.shtml
r379 r404 8 8 <h4>Geocoder</h4> 9 9 10 <p>The geocoder supports various methods for turning postcodes into 11 locations, or locations into postcodes, using our collected data.</p> 12 13 <h5>Postcode -> Location</h5> 10 14 <p>Look up the location that we have for a postcode. If we don't have an exact 11 15 match for the postcode you request, then we will do our best. If we don't have 12 an exact match, we will return #s where we don't have exact matches. 13 </p> 16 an exact match, we will return #s where we don't have exact matches.</p> 14 17 15 <p> If you request the response with the format of 'js', then you can specify 18 <h5>Location -> Postcode</h5> 19 <p>Look up the nearest postcode for a location. You can optionally get the 20 n nearest postcodes to a location.</p> 21 22 <h5>Location -> Postcode Areas</h5> 23 <p>Look up the nearest postcode area (eg 'OX2') for a location. You can 24 optionally get the n nearest postcode areas to a location.</p> 25 26 <h4>Result Formats</h4> 27 <p>The results can be returned as plain text (csv with header), XML, or 28 javascript / javascript callback.</p> 29 30 <p>If you request the response with the format of 'js', then you can specify 16 31 the name of a funtion call to wrap around the JSON response. This will call 17 32 that method with the JSON as a parameter. </p> … … 23 38 <h4>Arguments</h4> 24 39 <dl> 25 <dt>postcode (required)</dt> 26 <dd>The postcode that you wish the location of. You can enter just the outward part if you wish.</dd> 40 <dt>postcode (required, unless easting and northing given)</dt> 41 <dd>The postcode that you wish the location of. You can enter just the 42 outward part if you wish.</dd> 43 44 <dt>easting (required, unless postcode given)</dt> 45 <dd>The easting part of the location, to find nearby postcodes or postcode 46 areas. If given, 'northing' must also be supplied.</dd> 47 48 <dt>northing (required, unless postcode given)</dt> 49 <dd>The northing part of the location, to find nearby postcodes or postcode 50 areas. If given, 'easting' must also be supplied.</dd> 51 52 <dt>format (optional)</dt> 53 <dd>The format to return the results in. Can be 'text', 'js' or 'xml'. The 54 default is plain text.</dd> 55 56 <dt>results (optional)</dt> 57 <dd>The number of results to return. The default is 1. (postcode to location 58 searching always returns one result).</dd> 59 60 <dt>areas (optional)</dt> 61 <dd>If searching by easting and northing, should postcodes be returned, or 62 should postcode areas be returned? The default is to return postcodes.</dd> 27 63 28 64 </dl> … … 42 78 43 79 <p> 44 postcode: <input type="text" name="postcode" value="" size="30"> <br/> 80 postcode: <input type="text" name="postcode" value="" size="30" /> 81 <i>or</i><br/> 82 easting: <input type="text" name="easting" value="" size="10" /> 83 northing: <input type="text" name="northing" value="" size="10" /> 84 </p> 85 <p> 86 number of results: <input type="text" name="results" value="1" size="30" /> 87 <br /> 88 format: 89 <input id="format_text" type="radio" name="format" value="text"> <label for="format_text">Text</label> 90 <input id="format_js" type="radio" name="format" value="js" checked> <label for="format_js">JS</label> 91 <input id="format_xml" type="radio" name="format" value="xml"> <label for="format_xml">XML</label> 45 92 46 format: 47 <input id="format_text" type="radio" name="format" value="text"> <label for="format_text">Text</label> 48 <input id="format_js" type="radio" name="format" value="js" checked> <label for="format_js">JS</label> 49 <input id="format_xml" type="radio" name="format" value="xml"> <label for="format_xml">XML</label 50 51 <input type="submit" value="Go" /> 93 <input type="submit" value="Go" /> 52 94 </p> 53 95 </form>
Note: See TracChangeset
for help on using the changeset viewer.