postal-code

Search engine by distance

我只是一个虾纸丫 提交于 2019-12-11 04:35:29
问题 I am looking to make an option of my serach engine on my site so that users can search for items within a set distance, e.g. search items within 10 miles, or 20 miles etc. I was wondering how this could be done? The user would have to enter thier postcode, while i also have the postcode of the item's location and once they hit search there needs to be a away to work the distance between the two locations in miles and then display the results in order by distance; as in the closest item is the

r Regular expression for extracting UK postcode from an address is not ordered

瘦欲@ 提交于 2019-12-10 21:29:16
问题 I'm trying to extract UK postcodes from address strings in R, using the regular expression provided by the UK government here. Here is my function: address_to_postcode <- function(addresses) { # 1. Convert addresses to upper case addresses = toupper(addresses) # 2. Regular expression for UK postcodes: pcd_regex = "[Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) {0,1}[0-9][A-Za-z]{2})" # 3.

How do I utilise longitude/latitude values efficiently in Mysql?

血红的双手。 提交于 2019-12-10 09:40:20
问题 Thanks to Wikileaks, here in the UK we can now access our longitude and latitude co-ordinates for each post code wikileaks postcodes uk IMPORTANT. Do not use this data in public applications - There's concern that the data has been deliberately corrupted and you could be held as being in breach of copyright law. Try using data from an open source site like this Postcode UK site Now, it's possible to calculate distances between each point using the following calculation (originally from the

Javascript UK Postcode Validation [duplicate]

风流意气都作罢 提交于 2019-12-09 13:11:03
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: UK Postcode Regex (Comprehensive) I have the following code for validating postcodes in javascript: function valid_postcode(postcode) { postcode = postcode.replace(/\s/g, ""); var regex = /[A-Z]{1,2}[0-9]{1,2} ?[0-9][A-Z]{2}/i; return regex.test(postcode); } Tests: CF47 0HW - Passes - Correct CF47 OHW - Passes - Incorrect I have done a ton of research but can't seem to find the definitive regex for this common

php extract UK postal code and validate it

十年热恋 提交于 2019-12-09 07:14:28
问题 I have some text blocks like John+and+Co-Accountants-Hove-BN31GE-2959519 I need a function to extract the postcode "BN31GE". It may happen to not exist and have a text block without postcode so the function must also validate if the extracted text is valid postcode . John+and+Co-Accountants-Hove-2959519 回答1: Find below code to extract valid UK postal code. It return array if post code found otherwise empty. <?php $getPostcode=""; $str="John+and+Co-Accountants-Hove-BN31GE-2959519"; $getArray =

Physical Address to GeoLocation UK

Deadly 提交于 2019-12-08 19:18:34
Is there a good physical address to GeoLocation conversion database in the UK? I am trying to use this to build a globrix style search box http://www.globrix.com/ for a web application. Any pointers will be nice. I have been searching for hours. I have found several that convert UK Postcodes into Geolocation. But I need the addresses listed as on Globrix. The Google Maps API provides a geocoder webservice that you can actually use independently of Google Maps itself. You send it the address/postcode, and it responds with a lat/long plus disambiguated addresses. We use it server-side in the UK

Physical Address to GeoLocation UK

爷,独闯天下 提交于 2019-12-08 05:13:55
问题 Is there a good physical address to GeoLocation conversion database in the UK? I am trying to use this to build a globrix style search box http://www.globrix.com/ for a web application. Any pointers will be nice. I have been searching for hours. I have found several that convert UK Postcodes into Geolocation. But I need the addresses listed as on Globrix. 回答1: The Google Maps API provides a geocoder webservice that you can actually use independently of Google Maps itself. You send it the

Regular expression for UK postal codes

↘锁芯ラ 提交于 2019-12-08 02:53:52
问题 I'm making an application that asks the user to enter a postcode and outputs the postcode if it is valid. I found the following pattern, which works correctly: String pattern = "^([A-PR-UWYZ](([0-9](([0-9]|[A-HJKSTUW])?)?)|([A-HK-Y][0-9]([0-9]|[ABEHMNPRVWXY])?)) [0-9][ABD-HJLNP-UW-Z]{2})"; I don't know much about regex and it would be great if someone could talk me through this statement. I mainly don't understand the ? and use of () . 回答1: Your regex has the following: ^ and $ - anchors for

php get the first part of postcode

拥有回忆 提交于 2019-12-06 16:26:34
问题 I need to extract the first part of postcode for search calculation using a database. Any ideas?! I need this to implement a search module in the site, which looks out for some relevant information according to the post code. But the database which I am having for post code, it doesnt have second part of the postcode, only the first part is there. Its for UK postcode. So, any ideas?! 回答1: This will not cover 100% of all possible UK postcodes, but will do for like 99.999% or so :) /** * @param

HttpWebRequest: How to find a postal code at Canada Post through a WebRequest with x-www-form-enclosed?

时间秒杀一切 提交于 2019-12-06 09:35:37
问题 I'm currently writing some tests so that I may improve my skills with the Internet interaction through Windows Forms. One of those tests is to find a postal code which should be returned by Canada Post website. My default URL setting is set to: http://www.canadapost.ca/cpotools/apps/fpc/personal/findByCity?execution=e4s1 The required form fields are: streetNumber , streetName , city , province The contentType is "application/x-www-form-enclosed" EDIT: Please consider the value "application/x