You are here: Re: location finder by typing your post code (UK) « PHP Programming Language « IT news, forums, messages
Re: location finder by typing your post code (UK)

Posted by Sanders Kaufman on 11/22/07 21:58

"Matthew" <matthew@spamkiller.com> wrote in message
news:Ifj1j.51610$c_1.27402@text.news.blueyonder.co.uk...
> Richard emailed this:

> If you're looking for an off-the-shelf solution, you should look for some
> kind of GIS (Geographic Information Software) solution, of which many
> exist but are expensive, and possibly overkill for what you are trying to
> do.

To that end, ESRI's ARCGISOnline.com is a freebie that has some interesting
stuff.
And if you're willing to pony up the bucks, they are *great* at tech
supporting you.



The web bot solution (in the appended email) was mentioned primarily
> because they guys I was advising had no budget, and is a much less
> efficient (but free) solution as the email explains.
>
> When I was doing postcode/location development, 5 years ago, there was no
> Web Service that provided UK postcode to location data. I would be
> surprised if that did not now exist, but in what form I know not and there
> may be no such service that will work for you. I just did a web service
> search and this may be a winner!! The service details are as follows, url
> at bottom.
>
> -----
> Get UK Postcode,Town,County and Validate UK Address
>
> The following operations are supported. For a formal definition, please
> review the Service Description.
>
> * GetUKLocationByCounty
> Get UK town,Postcode and County by full /partial County
>
> * ValidateUKAddress
> Validate UK address,Use First Section of Poscode for Postcode atribute
>
> * GetUKLocationByPostCode
> Get UK town,Postcode and County by Postcode(First Section of Post Code)
>
> * GetUKLocationByTown
> Get UK town,Postcode and County by full /partial Town
>
> See this URL:
> http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=28
> -----
>
> Other more appropriate newsgroups you could get help from are:
>
> Newsgroups:
> comp.infosystems
> comp.infosystems.gis
>
> There is also a dedicated UK postcode discussion mailing list, but I no
> longer have the details and a quick web search did not find it. If you can
> find it with a web search, it would be a valuable info. resource from
> people who do this kind of thing professionally. Key words that might
> source it are: postcode gis geography (and synonyms) mailing list, etc..
> People in the newsgroups above may know the subscribe details.
>
> I'll gladly answer more questions if you have any. Post an email address
> and I'll contact you by email.
>
> Email appended below.
>
> HTH,
>
> Matthew
>
> Richard Note: If you can, it would probably best to use UK OS coordinates.
> You'll need to be doing distances between locations, and with UK OS coords
> you can just use Pythagoras (contact me for more info.), long/lat is a
> more complex calculation.
>
>
> Advise on postcode to cinema location project.
>
> Firstly I should say I am unsure exactly what you want to achieve, so had
> better spell out the impression I've got, which is:
>
> In order to tell which cinema is nearest to a particular user, you want to
> get their long/lat from their postcode so that you can determine which is
> their nearest cinema. Alf also said you had tried using Google Maps but
> that it was unreliable when doing this. Is that correct?
>
> Here are some notes and methods that will hopefully help.
>
> The data can be bought in the form of a massive csv file, called the
> 'Postcode Address File' but known as the PAF, url below (though a web
> search will provide you with more info.). UK wide coverage is pretty
> expensive. I have a copy (from an old project) which is 5 years out of
> date, and I no longer have a license for it. The PAF has way more info.
> than just coordinate data, but that includes UK OS (Ordinance Survey)
> coordinates and long/lat coordinates. For the data I needed which was just
> the OS coords and street names for each unique postcode, I added just that
> data to a database table (initially PostGreSQL, later MySql). This method
> of looking up OS coords for a specific postcode was very quick, very
> effective, and highly reliable.
>
> Note: I just looked at the field names of the PAF data from the URL below
> and coordinate data is not listed, also the number of fields is very few
> in comparison to the file I had, so the product I had may have been
> changed into *maybe* several different products. BUT I am certain the
> Royal Mail's 'postcode to location coordinates' data will be for sale in a
> way that allows it to be added to your own database.
>
> Look here...
> http://xyzmaps.com/acatalog/Postcode_Maps.html
> but search the web too.
>
> However I understand the budget may not be up to buying the data and that
> you were unsatisfied with Google Maps. I've not used/played with Google
> Maps but understand it has an API available. Were you using the API to
> retrieve coordinate data from UK postcodes?
>
> One method that the UK OS and long/lat data could be retrieved for free
> would be by writing a web bot to get the data from a UK website called
> StreetMap.
>
> http://www.streetmap.co.uk/
>
> I have experience of writing such a bot, and have just had a play with the
> site capturing all data in and out of my network adapter with WinDump (a
> bit of free software you'll need if writing a bot like this). Here's how
> it could be done.
>
> i) Simulate a web request on streetmap by sending the site a POST (not
> GET) header with the postcode you require in the form and all formatted as
> if someone had just entered the postcode in the site's search form.
>
> ii) streetmap will respond by returning to you a webpage. The header of
> this has a field called 'location', which is how a site tells a browser
> what location to display in the 'location bar'. In streetmap's case this
> actually has the UK Ordinance Survey coordinates in it. Here's the
> location header data I got back from the query on my own postcode 'EC1V
> 4JY':
>
> newmap.srf?x=531681&y=182358&z=0&sv=EC1V+4JY&st=2&pc=EC1V+4JY&mapp=newmap.srf&searchp=newsearch.srf
>
> Near the start you can see 'x=531681&y=182358' which is the OS coords of
> my flat. NOTE: UK OS coordinates can be 7 figures which is accurate to 10
> metres. The data above is 6 figures, accurate to 100 metres. This is
> because a UK postcode may reference as many as 10 addresses, which could
> be along a street, so it can not be made accurate enough to warrant the
> use of 7 figured OS coords.
>
> If you use UK OS coords, you've now got the data.
>
> iii). If you need long/lat, you can do the following to get it from
> streetmap. However algorithms for converting UK OS coords to long/lat
> coords exist, but I believe these to be quite complex.
>
> On the web page that streetmap returns from a postcode search, there is a
> link, labeled as "Click here to convert/measure coordinates". This link
> can be retrieved from the webpage returned by your original 'POST'
> request. You just need to 'GET' that URL, in another simulated webpage
> request, and streetmap will return a webpage with all the coordinate data
> you could want for the postcode. Click the URL below to see the results
> for my postcode.
>
> http://www.streetmap.co.uk/streetmap.dll?GridConvert?name=531681,182358&type=OSGrid
>
> Nice huh !!
>
> iv) Finally you just need to write a small parser to retrieve whatever
> coordinate data you want (presumably lat/long) from that page.
>
> This web bot method for your needs is quite sweet I think, but has one
> flaw. If streetmap.co.uk goes down so does your ability to get the data.
> However I've been using streetmap regularly for 8 years and don't ever
> remember it going down.
>
> When I was writing bots to get web data, I used a bit of open source
> software called HTML Tidy. Any web pages returned to me I ran through
> Tidy, which converted the pages from HTML to XML (even very badly
> formatted HTML pages). Then I used XSLT queries to extract whatever data I
> wanted from the XML version of the webpages, resulting in nice XML
> outputting for the data I needed.
>
> You could write a Web Service to get the coordinate data from streetmap
> for any postcode that you supply the web service as input. This could be
> quite an effective way of doing it, especially as you can probably host
> the web service on the same server that hosts your database.
>
>
> Please give me some feedback on all this, with details of exactly what you
> want to achieve, I may have other helpful info. that hadn't occurred to me
> when writing this. Hope this helps.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация