Kitz Forum

Chat => Tech Chat => Topic started by: kitz on August 31, 2007, 08:14:13 PM

Title: Beta Testers needed
Post by: kitz on August 31, 2007, 08:14:13 PM
My "project" over the past couple of weeks (when Ive not been tied up with other stuff) has been coding a new adsl checker.
The aim was to do something for my site but also learn a new "language"... ( Ive been saying for years I'm gonna teach myself php).

So..  I'd appreciate if some of you would like to beta test this for me. Any bugs or errors please report back.

http://www.kitz.co.uk/adsl/adslchecker.php

(There is something that does seem to occur on my own line on occasions - I know where the bug occurs but I dont seem to be anything about it cause it goes back to the BT database - so I'll see if anyone else has the same problem - if so I'll have to take something out of the proggie :/

Any comments on the wordings/typos etc also gratefully received.

This is the basic skin and it will be prettified with CSS when I drop it into the main site.

I'll try fix any bugs/errors/implement any suggestions... but bear in mind  the past week has at times been a very steep learning curve. :comp:

[edited to update url]

Title: Re: Beta Testers needed
Post by: Astral on August 31, 2007, 08:34:52 PM
I've fallen at the first hurdle. Got an invalid verification code both times I tried.

Should you put a space in the middle of the postcode? I tried both ways to no avail.
Title: Re: Beta Testers needed
Post by: roseway on August 31, 2007, 08:36:21 PM
I just tried it, and it worked fine. It delivered wrong information about the distance by road, but that's obviously BT's error, not yours.
Just one small comment: it wasn't clear to me at first that I had to enter the verification code which was shown. That was probably me being dim, but it might be an idea to spell it out - "Enter the code above in the box below" or something like that.

[Edit] And Astral's comment has rather made the point :)
Title: Re: Beta Testers needed
Post by: Astral on August 31, 2007, 08:43:50 PM
Quote
it wasn't clear to me at first that I had to enter the verification code which was shown. That was probably me being dim

I'm dimmer than you, Eric!

I twigged the code thing as I was writing my last post.

Again the only discrepancy was the direct and road distances, but as they only varied by 2 metres and the postcode probably covers the whole estate it's not a problem.
Title: Re: Beta Testers needed
Post by: Achilles Last Stand on August 31, 2007, 08:47:39 PM
Worked first time for me - I put a space in the post code but not between the phone number and area code.  Road distance to exchange is about right (I don't really do KMs lol!).

Result - in two sections:

(https://forum.kitz.co.uk/proxy.php?request=http%3A%2F%2Fi102.photobucket.com%2Falbums%2Fm87%2Fpassionplay65%2Fmisc%2FKitztestAug081.gif&hash=9b8de1895a4c669bcf3300e6db1b29bdcaa37e29)
(https://forum.kitz.co.uk/proxy.php?request=http%3A%2F%2Fi102.photobucket.com%2Falbums%2Fm87%2Fpassionplay65%2Fmisc%2FKitztestAug082.gif&hash=ec9b59a76e04ecc647e900791cc8ffd72ad25f7d)
Title: Re: Beta Testers needed
Post by: Astral on August 31, 2007, 08:54:35 PM
It did get the exchange on the correct side of the road, which another checker did not. I'd been looking for an exchange building since I moved here a few weeks ago and concluded that it was hidden behind another building. I was walking back from the shop the other morning and saw an Openreach van on the other side of the railway (the road splits and runs, one-way, each side of the track) and solved the mystery.
Title: Re: Beta Testers needed
Post by: kitz on August 31, 2007, 09:04:14 PM
>> Should you put a space in the middle of the postcode? I tried both ways to no avail.

Ive formatted it so that it should strip spaces so it should take either..
and upper/lower case shouldnt matter either since it will convert to upper.


>> It delivered wrong information about the distance by road, but that's obviously BT's error,

It hooks up to a google maps API. 
Is it miles out?  could be a conversion error from postcode to longitude/latitude?

>> That was probably me being dim, but it might be an idea to spell it out -

Thanks :)
Having been so concentrating on the backend stuff that I missed the obvious on how it looks.

Changed it a little - was going to move the submit button into the same box - but it looked awfully lopped sided when I did that :/

Could take the verify box out and see how it goes for a while..  the captcha was kind of a "learning curve" for me :D. 

Thanks guys keep any comments coming :)
Title: Re: Beta Testers needed
Post by: Astral on August 31, 2007, 09:08:01 PM
I can verify that it is now dimwit-proof.
Title: Re: Beta Testers needed
Post by: kitz on August 31, 2007, 09:28:52 PM
>>> It did get the exchange on the correct side of the road,

Thats probably more down to luck :D
Problem is a postcode can cover a particular area.. so it plumps for the middle bit.

I have done the calculation bit a bit differently than some other sites and afaik its the only checker that is supposed to give road distance as elsewhere quotes "crow flies".
Ive seen crow flies quoted so many times that I thought it would be a good idea to put road distance which is more likely to be true rather than the other measurement.

I must admit though that I did have help with that and chris did it for me as an include whilst I did the maps and conversions to get from long/lat and pass it through... But chris must get the credit for the actual road calculation bit.

Aside from that then the rest of it blame me if it goes wrong - as chris said nowt like jumping in at the deep end for a first proggie in a new language :/

Big Credit must also go to Sam too where the database files come from and Im using his API which keeps records of which LLU providers are at which exchanges etc.  afaik other checkers use that too - they just dont make it obvious and give him the due credit.

Only thing that does bug me is sometimes acess to the BT d/base is a bit slow and it will sometimes take its time checking a phone no :/
- When it does that it sometimes produces an error code - but will still send the results back.  I think it must depend on how busy it is.
It also takes its time if its a "non BT line".. ;)
Title: Re: Beta Testers needed
Post by: Astral on August 31, 2007, 09:32:27 PM
Shall I go and pace out the road distance? ;)
Title: Re: Beta Testers needed
Post by: kitz on August 31, 2007, 09:33:46 PM
yeah go on then.

I want it accurate to the nearest foot

:hides:
Title: Re: Beta Testers needed
Post by: Astral on August 31, 2007, 09:47:45 PM
Well the 95 metres given brings you to the railway bridge. It's about 400 metres to my place. (to the nearest foot)
Title: Re: Beta Testers needed
Post by: kitz on August 31, 2007, 10:31:42 PM
lol can you imagine the attenuation youd' have at 95m? 400 meters is pretty damn close as it is :D
Full steam ahead on adsl2+ eh?
Title: Re: Beta Testers needed
Post by: Astral on August 31, 2007, 10:37:16 PM
About a year before we get that.


Correction; 2 years. :(


Switched map over to satellite. My estate is still fields!
Title: Re: Beta Testers needed
Post by: kitz on August 31, 2007, 11:22:57 PM
Are you right in the middle of dartmoor or something?
lol youre probably lucky to have an exchange
/me runs and hides.  :-X
Title: Re: Beta Testers needed
Post by: Astral on August 31, 2007, 11:28:43 PM
No railways in the middle of Dartmoor. There used to be, but now there is only a branch to a track ballast quarry on the edge of the moor.

It's just that the Google Earth photo's are years out of date.
Title: Re: Beta Testers needed
Post by: soms on September 01, 2007, 12:48:47 AM
Seems to work quite nicely kitz, brings all the info into one page.

Seems odd that my non-ADSL line might only receive 500K when the road distance is estimated 3.5Km and one ADSL line is on 1Mbps already. Anyways, it is  certainly a nice page and just as good as the other line estimators out there.
Title: Re: Beta Testers needed
Post by: roseway on September 01, 2007, 06:51:18 AM
>>> Is it miles out?  could be a conversion error from postcode to longitude/latitude?

Miles out (literally). The straight line distance is shown as 3.21 km which looks right. The road between here and the exchange is almost a straight line and I've measured it in the car as 3.5 km, but the checker shows it as 12.8 km.
Title: Re: Beta Testers needed
Post by: jazz on September 01, 2007, 09:11:09 AM
Tried it this morning and it looks spot on for me - very impressed with what you have managed to do.  I'm not sure that I would have known what to do with the code verification box the first time round if I hadn't read about it here first but I would have worked it out in the end!  The information is very clear and really well laid out.  Another winner from the Kitz site....
Title: Re: Beta Testers needed
Post by: roseway on September 01, 2007, 09:32:41 AM
Yes, definitely a winner :)
Title: Re: Beta Testers needed
Post by: Astral on September 01, 2007, 10:40:55 AM
With those recommendations I'd better get down to the bookies and put a tenner to win on it. ;)
Title: Re: Beta Testers needed
Post by: kitz on September 01, 2007, 11:16:05 AM
>>  the checker shows it as 12.8 km

ekies thats quite a lot out..  Ive just had a quick look and I cant see anything obvious which should cause that error.
However its something Im not too happy about therefore I'd like to have a look in a bit and make sure its not anything stupid that Ive done :/
Title: Re: Beta Testers needed
Post by: kitz on September 01, 2007, 02:45:50 PM
eric kindly pm'd me his details so I could test using his info and Ive found where the problem is.

His exchange is reportedly smack bang in the middle of a motorway. 
If I put the postcode in it tells me its on the eastbound side.. if I put the address of the exchange in its supposed on the westbound side.

Extra mileage is finding the nearest junction to get on or off the motorway.    :lol:
Im also rolling at the satellite view.  I think I can safely say this is a "one off" based on that particular exchange location.
Title: Re: Beta Testers needed
Post by: tickmike on September 01, 2007, 11:48:17 PM
I have broke it !.
1. The distance = 0.    each time I have tried it on different address's.

2. I use 'Firefox'      it remembers the last phone number and post code but you do not want it remembering the last 'Verification key' , can you change that at your end ?..

3.  You have  'Verfication key' should it have an i in it after r ? 'Verification key' ( I am not the worlds best speller ).

Its odd if you put the post code in for the exchange, I never got any higher than ADSL Max = 6.5Mb

The map is about right, its about 50M out ( short) . Because all our lane is the same post code it looks like the average position is used.

But other than that it's ok.   :)
Title: Re: Beta Testers needed
Post by: soms on September 02, 2007, 12:27:45 AM
Quote
I use 'Firefox'      it remembers the last phone number and post code but you do not want it remembering the last 'Verification key' , can you change that at your end ?..


Used Firefox here and it worked fine [remembers if you click in the field and displays list of former entries but does not auto-fill], perhaps its your browser settings for remembering details automatically?

I do agree that if possible this isn't desirable.
I have seen sites such as Exchange Web Access e-mail sites where it will always refuse to remember any details. How this is implemented I do not know. All the same it doesn't seem to be a major issue.

Title: Re: Beta Testers needed
Post by: kitz on September 02, 2007, 02:54:48 PM
Thank you everyone for all your comments and taking the time to test.

Some minor tweaks to the backend have been made and the page has now been "prettified"
New page is now live - Broadband availability checker (http://www.kitz.co.uk/adsl/adslchecker.php).

----------

>> I have broke it !. 1. The distance = 0.

I was updating maps last night and moving stuff around at about that time..  so could have been something I was doing.
Do you still have the same problem with the live page?  If so would you kindly pm me the postcode and I'll have a look see what I can find (don't need your phone no).

>>  it remembers the last phone number and post code but you do not want it remembering the last 'Verification key'
>> How this is implemented I do not know


It uses "sessions" and has to be able to check the code.  If you do a simple refresh of the page it will probably remember the code. If you refresh the data from the results page it will still remember it by design.  A complete reload/re-request of the page back to the input should clear it.
The captcha wasnt meant to be anything fancy - more to stop bots accessing it than humans and it was also something I put in as a learning curve to help me understand how they worked.
Theres various ways that you could do this.. and it depends on whether you wish to leave cookies behind etc.  Using "sessions" you can destroy the session at any point in the program you wish.
It should have destroyed the session on a complete reload of the page. 

>> Its odd if you put the post code in for the exchange, I never got any higher than ADSL Max = 6.5Mb

I'm afraid thats the BT database and nothing I can do about that. It does that on my line too (6.5 Mb) and I'm less than 200m from the exchange.
Postcodes cover a "general area" and arent as accurate as data obtained on the phone no, so BT have been conservative with their estimates if you dont put the phone no in.
However post codes have to be included because some of the data is only available based on your post code (eg cable providers).

Whilst it may look from the front end that its only performing one check... behind the scenes theres lots and lots of checks being made..  and to different resources.

>> Because all our lane is the same post code it looks like the average position is used

Yep thats right :)  That check is done on postcode only since theres no way of tying a phone no up with a location any closer than that... so it just picks a "mid point".

>> would have known what to do with the code verification box the first time round

I'd already decided last night that I was going to abandon it. 
Im going to see how it goes for now without one.
This project was a bit of a "jump in at the deep end" to learning a new language..  even I didnt expect it to take a few thousand lines of code when I started it.. and by implementing the captcha it helped me understand how php dealt with sessions which wasnt anythign I'd done before.
The codes there now if I want to use it..  but Ive taken onboard all your comments and if it is implemented in the future.. its more a simple case of re-designing the input form which should be easy in comparison since thats only design :D

Thanks again everyone for all your comments :)
Title: Re: Beta Testers needed
Post by: kitz on September 02, 2007, 03:11:21 PM
Quote
His exchange is reportedly smack bang in the middle of a motorway. 
If I put the postcode in it tells me its on the eastbound side.. if I put the address of the exchange in its supposed on the westbound side.

Im also rolling at the satellite view.

and to finish this off..  and explanation of why I found erics "bug" so funny.

As previously mentioned the postcode will always pick a midpoint.. and in erics particular case google maps decided that his exchange was smack bang in the middle of the M20.
-Therefore the road calculation had to take in additional distance to get off the motorway.

Anyhow I was looking at google maps longitutes/latitudes and my code with  to see if there was anything I could do about this. (My prog uses the postcode and I wanted to see if by using an address then it could narrow things down further).

Anyhow it didnt and even using the name of the road, google insisted it was on the other carriage of the motorway.  So I was having a look via sattelite to see if I could see where the exchange actually was.

Ive took a screen cap of the image..
Yellow marker is where the exchange is supposed to be according to the postcode.
Red marker is where the exchange is supposed to be according to the address.

Then I happened to notice something in the field towards the bottom right where I thought the exchange may actually be.
(see the red circle.)

(https://forum.kitz.co.uk/proxy.php?request=http%3A%2F%2Fwww.kitz.co.uk%2Ftemp%2Fexchange.jpg&hash=9c107950c0f58fe32f8b8c7ed869a28603dca2d7)


Zooming in on the image brought this up....

http://www.kitz.co.uk/temp/zoomed.jpg


Yep.. that just about summed up my feelings about how google was handling the request.

 :lol: :lol: :lol: :lol:
Title: Re: Beta Testers needed
Post by: roseway on September 02, 2007, 04:02:22 PM
 :lol: :lol: :lol:

The exchange is actually on the A20, the other side of the M20 from that 'feature'.

Anyway, you've done a very nice job on the utility. :)
Title: Re: Beta Testers needed
Post by: kitz on September 02, 2007, 04:18:50 PM
>> The exchange is actually on the A20, the other side of the M20 from that 'feature'.

lol - the BT database wasnt really much use either. 

Bet someone had fun doing that  ??? 
Wonder if the "author" realised that his handywork would be captured for world-wide viewing  :lol:
Title: Re: Beta Testers needed
Post by: tickmike on September 02, 2007, 10:08:41 PM
Just put my details in,
 Distance is still 0.

But all this came up as well.!
Hope this helps. :)


[urls removed by kitz - grabbed them tyvm] :)
Title: Re: Beta Testers needed
Post by: kitz on September 02, 2007, 10:22:33 PM
okies tyvm... leave it with me.. thanks for that - ill see if I can re-create it.

dont like the look that its in distances.inc.php..   but I'll try have a look see what I can see.

Removed all those error messages, because I dont really want those urls spidering.. but Ive taken a copy of them all  :)
Title: Re: Beta Testers needed
Post by: kitz on September 02, 2007, 10:52:32 PM
Mike

Can you do me a favour please... Im trying to narrow this down and I cant see anything why it should be doing thi.  Those error messages seem to perhaps indicate a valid address on the bt system..  but its looking like the google map API that seems to be struggling with the location.  "Trying to get property of non-object" on the error lines and url you posted is pointing towards the google database not liking either yours or the exchanges postcode.


Go here http://maps.google.com/

then hit the "Get directions tab"

In the start address put the postcode in that the checker gave you for the exchange for the start address..  then put your own postcode in for your end address.

Hit the "GEt directions button"... and let me know if it google chucks up an error too.

[The only reason you got all those error messages is I'd left it in php debug mode - I dont think it was turned on yesterday].
Title: Re: Beta Testers needed
Post by: tickmike on September 03, 2007, 12:19:09 AM
OK did that and got.

"We could not understand the location"

It could not understand the post code for the exchange, and came up with 217 results and none were the exchange.
Did the same if I just did a map search, but it was ok with my post code.
The google map that comes up on your web page is correct .

UPDATE ,
Just spoken to my wife ( who was post master in the town next to our village, were the exchange is.) she tells me all the post code were changed two years ago. !

Put new post code in to google maps and it finds it strait away with a distance of 2.61 Miles.

So is the BT data base out of date ?.   :(
Title: Re: Beta Testers needed
Post by: kitz on September 03, 2007, 12:59:50 AM
Thanks mike. - appreciated.

The bit where its going wrong isnt actually my part of the code.. and ironically its related to about the only place where I got help with the proggie.  Ive just spent the past hour or so searching around on the net to see if theres another way that I can do this so that that theres a fall over if the post-code is duff.(or at least for the exchange .  The fact that the google api has thrown up errors for both yours and erics had made me question the way of doing things.

I have an idea of what I want to do.. Ive got a very vague idea of how I could do it..  just not got it straight in my head how the heck Im going to code it :D

Jeeze I thought it was a brilliant idea to be able to bring a driving distance thing into the checker..  I thought it was going to be acheivable..

lol talk about diving in at the deep end and cracking your head on the bottom of the pool.  heh Ive certainly got a headache at all the reading Ive just been doing. ???


Title: Re: Beta Testers needed
Post by: mr_chris on September 03, 2007, 11:05:04 AM
I never really thought that the BT exchange codes could be wrong!!

As a short-term fix some validation of the output from Google maps would be an idea. If I get chance later today I'll sort something out there.

Quote
have an idea of what I want to do.. Ive got a very vague idea of how I could do it..  just not got it straight in my head how the heck Im going to code it

Sounds fun!
Title: Re: Beta Testers needed
Post by: kitz on September 03, 2007, 12:24:37 PM
I got  a test version working early this am and it seems to be ok and returning results.
but its nasty code right now and not fit to go out.

Title: Re: Beta Testers needed
Post by: kitz on September 03, 2007, 05:16:29 PM
$%*$% :comp:

When you see the code chris you'll understand the above comment and why I banged my head on the desk several times :-X

-----------------

Anyhoooooo  wanna give this one a try  mike (or anyone else)
http://www.kitz.co.uk/adsl/adslchecker.php

It seems to be running a bit slow right now but I'm hoping thats perhaps just the BT d/b thats busy rather than the additional code.

Sorry eric - couldnt do anything about yours at all - not when both the postcode and address are both pointing to being smack bang in the middle of  the M20 :(

[edit]
url updated
Title: Re: Beta Testers needed
Post by: Astral on September 03, 2007, 05:55:22 PM
I got two invalid phone number/postcode errors. The third time I did the postcode in caps with space and it worked. Only touble was it gave the distance as zero in both cases. Sorry. :(
Title: Re: Beta Testers needed
Post by: kitz on September 03, 2007, 06:16:54 PM
$%*$%

Just noticed that the "main one" is also returned the same error too - and I havent touched the code on that.
That error comes back if BT are rejecting something.  (The first stage error checking by me splits it down if youve put in an invalid postcode or invalid phone no - whilst that is BT chucking back it aint happy about something)


edit- more info
Samknows site is also playing up when I try put something in there and isnt returning the exchange data properly.
Looks like its the BT database thats playing silly beggars :(



[attachment deleted by admin]
Title: Re: Beta Testers needed
Post by: Astral on September 03, 2007, 06:18:37 PM
That's OK. As long as I didn't break it! ;)
Title: Re: Beta Testers needed
Post by: kitz on September 03, 2007, 06:22:08 PM
lol whoops chaged the pics to edit out info.. and show that even on there its saying I cant get adsl :D

Supposed I need to make that error message clearer. :/
Title: Re: Beta Testers needed
Post by: kitz on September 03, 2007, 06:26:18 PM
Seems to be working again on both sites.
Title: Re: Beta Testers needed
Post by: roseway on September 03, 2007, 06:44:01 PM
When I tried it just now, the first time I got "Phone No lookup failed" although the phone number was correct (I checked). The second time it worked normally. I don't know if it's relevant, but the first time I entered the postcode in lower case with no spaces and the second time I entered it with capitals and a space.
Title: Re: Beta Testers needed
Post by: kitz on September 03, 2007, 07:30:58 PM
>> Supposed I need to make that error message clearer. :/

Message now changed....  and moved to a more obvious place on the front page.




Thanks eric..  the "phone no lookup failed" again is an error again generated back by BT - I have seen this message displayed myself in the past when the BT system gets very busy...
The system seems to go blaaaaaah busy dont wanna do it...  oh ok then i'll send it.

From when Ive seen it  (aside from if its an LLU no they dont own in which case it wont return much at all on postcode alone) still tends to send back most of the results - but its just very slow.


I think possibly in fact that I noticed things starting to slow down about an hour ago and the oddness just now perhaps means that the BT queries are very busy for some reason. :/

looking at the server response times those that are coming back are anywhere between 2129 ms and 9779 ms.  A good response should only take around 9-15ms.

Ive also double checked that its not me sending tons of extra stuff, but that appears to be ok.

>> the first time I entered the postcode in lower case with no spaces and the second time I entered it with capitals and a space

No it shouldnt.  My proggie will grab what data you put in..  it actually strips any spaces out and will auto capitalise it before its sent out to the database.  Then when data comes back for the results page I add a space back in at this end so it dsplays nicely.  Regardless of someone putting in caps/lowercase or spaces it will send to the database as AB123(4)CD .

I let their database handle anything more than that since obviously I dont have access to a full postcode list to check against...and thats when it should send back the error that astral saw earlier.

Title: Re: Beta Testers needed
Post by: tickmike on September 03, 2007, 09:59:18 PM
Worked first time
With a distance as well  "Distance:-      Direct: 3.49 km(appx)     By Road:     4.16 km"
Map is correct.
ADSL data.
Rag test ok.
Other Broadband Technology & LLU Providers = no data  (I use Eclipse).

Great job.   :)

Also tested :-

Phone number only = worked with useful data.

Post code only = worked with useful data.

No post code or phone number = Error message.

Wrong phone number = Error message. (o instead of 0 )

Wrong post code = Error message.

Phone number with NO area code + post code = worked with useful data.

Phone number with NO area code only = Error message.

Phone number with the wrong area code for my area + my post code = worked with useful data but invalid ADSL Estimate
----------------------------------------------------------------------------

Well I think its passed me trying to break it ok.   ;D

Only mod I can think of is to say "1. Enter your Phone No : With Area code"

You said. "The aim was to do something for my site but also learn a new "language"... ( Ive been saying for years I'm gonna teach myself php)."
Well you can teach me when I'm ready to set up my own web site.   ;)

Michael.
Title: Re: Beta Testers needed
Post by: mr_chris on September 04, 2007, 12:40:04 AM
Talk about an easy(?!) first project!!  ::) Wow!

Nice one Kitz - haven't looked at the new code yet cuz I've only just got in from working, but it's the first time I've seen it 'themed' - looks brilliant, nicely presented, good useful info - definitely a winner :)

Edit, just looked at the php code, I see how you've done the different distance calculation, nice idea. Still relies on the info returned from Sam's API though, unfortunately, and if it's wrong as in Astral's case (who actually provides the exchange location data - is is BT or is it Sam's own list?). Not a lot you can do about that though, it seems like for the most part it's pretty accurate.

Also, from what I can see, there's nothing wrong with the code at all! It works, it's straightforward to follow (main thing) and it's well written. Nice one :)

ps just to let you know, I just made a slight alteration to the miles -> km driving distance conversion in the distances2.inc.php file to make it a wee bit more accurate (discovered that 1 mile isn't exactly 5/8 of 1 km!)
Title: Re: Beta Testers needed
Post by: kitz on September 04, 2007, 03:06:03 AM
Thanks for the comments guys..  will look again tomorrow and digest properly.

Not long got in and Im too tired to take anything much in  :sleep:
Title: Re: Beta Testers needed
Post by: tickmike on September 04, 2007, 10:25:53 AM
With chris's mod it is even more accurate now .

Distance:-      Direct:               3.49 km
            (appx)     By Road:     4.18 km

Which is what my car speedometer said.

Nice one.   :)
Title: Re: Beta Testers needed
Post by: Astral on September 04, 2007, 10:43:42 AM
I'm still getting zero distance, although the postcode input "problem" seems to have gone away.
Title: Re: Beta Testers needed
Post by: roseway on September 04, 2007, 10:48:39 AM
By the way, One thing I should have done earlier to try to help was let you know where my local exchange (Sellindge) really is. It's at http://maps.google.co.uk/maps?ie=UTF8&hl=en&ll=51.103667,1.00261&spn=0.001144,0.002602&t=k&z=19&om=1
and the exchange is the dark-roofed building in the middle of the image. The road is the A20, and if you go up it a short distance and take the first right you are at the far end of the road where I live.
Title: Re: Beta Testers needed
Post by: kitz on September 05, 2007, 11:39:39 AM
Sorry - didnt have chance yesterday to do anything at all :(
I'll try have a look into this later  today
Title: Re: Beta Testers needed
Post by: tonyappuk on September 06, 2007, 08:54:18 PM
Tried your program Kitz and as others have said it works well. For someone who has just got to grips with php it must be very pleasing for you and deserves lots of praise.  I have no criticisms at all constructive or otherwise, just thought to offer my three'apence worth.
Title: Re: Beta Testers needed
Post by: Astral on September 06, 2007, 09:02:44 PM
It's working as well as mapping/database information allows for me now. A small anomaly is that the direct distance is further than the road distance by 2 metres, but is probably not worth meddling with.
Title: Re: Beta Testers needed
Post by: kitz on September 06, 2007, 10:02:46 PM
ooh thank you.

I've not had time to do anything much on it for the past couple of days

>> It's working as well as mapping/database information allows for me now

lol..  that is very strange - because I havent done anything on version 1 or 2 and had started a brand new version 3 on which I was trying to sort the problem that you were seeing astral.*

Version 1 is mostly postcode based.  version 2 was soley longitude and latitude based whilst version 3 is going to be a hybrid, but I hadnt uploaded that yet (being on dial up last night made doing any testing impossible.)

*for some reason google API was nulling astrals address on long/lat
*google was nulling Mikes exchange postcode
therefore I wanted to pull something together that was a combination of the 2..  Unfortunately that part of the prog does rely soley on the info in google maps database therefore I'm a bit stuck as to what it sends me back.

It actually makes 3 data requests to google
- one for the map.
Then one for the straight line distance.
Then another for the driving distance...  the API is still apparently not fully out of development by google and they quote (http://www.google.com/apis/maps/documentation/index.html)

The API is new, so there may be bugs and slightly less than perfect documentation. Bear with us as we fill in the holes

Astral if you want to PM me your postcode (dont need your phone no) then I can have a better look first hand to see what its doing.
Title: Re: Beta Testers needed
Post by: kitz on September 07, 2007, 07:14:58 PM
Spent the afternoon looking at this..
Ive got the hybrid version up which should hopefully catch all exchanges now.

As regards to driving distances Im going to have to admit defeat on this one..  no matter what I tweak when it comes down to it, Im restricted to what info the google maps API sends back.  Its a totally different calculation to the direct distance and Im very limited to what info I can alter.

I think I've done just about all I can on it and I think the only way Im ever going to get that anywhere near perfect is by asking people to put their full addresses in... and I'd also need to send in the full address for the exchange. :/

The rest of the stuff seems to be working ok - and afaik it is only the driving distances that does seem to have the oddness on some addresses because of the area that postcodes can cover.  The main thing is that all the exchange/ line info stuff seems to be working ok
Therefore (for now) I think Im gonna just leave it in "as a guide".  :(

Thank you everyone for your feedback - most appreciated.


Title: Re: Beta Testers needed
Post by: kitz on October 06, 2007, 10:35:04 PM
Wanna give yours a try again eric?
Title: Re: Beta Testers needed
Post by: roseway on October 07, 2007, 07:32:14 AM
Fantastic! Everything looks just about right now, including the road distance. Well done. :)
Title: Re: Beta Testers needed
Post by: kitz on October 07, 2007, 09:13:00 AM
good stuff
- although I must admit that it was Sam that changed the records on that one after I'd explained to him the problem I was having with the location on your particular exchange - so I cant actually take the credit.
Title: Re: Beta Testers needed
Post by: roseway on October 07, 2007, 10:08:59 AM
You can take the credit for perseverance.
Title: Re: Beta Testers needed
Post by: Astral on October 07, 2007, 10:24:51 AM
I think I must live in the Twiglet Zone! My direct distance is still further than the road distance but they are, now, of the right order of magnitude.

Well done for having another go at cracking the problem.
Title: Re: Beta Testers needed
Post by: tickmike on October 08, 2007, 11:43:29 PM
Its looks good and works well. :)
Title: Re: Beta Testers needed
Post by: kitz on October 09, 2007, 02:14:12 PM
It's working as well as mapping/database information allows for me now. A small anomaly is that the direct distance is further than the road distance by 2 metres, but is probably not worth meddling with.

I think I must live in the Twiglet Zone! My direct distance is still further than the road distance but they are, now, of the right order of magnitude

I'm sorry but I really dont think I can take this any further the anolmality is probably due to the fact that Im now using a hyrid of both postal codes and long&lats to try and improve accuracy down to as much as google maps allows.  With Postcodes it is always going to cover a particular area and therefore there inaccuracies are going to occur because of the midpoint range.  I cant take the postcode bit out all together though obviously since thats what its working off.
I tried coding it completely off google long and lat API but that seemed to only through more problems, in the end the most accurate I could get was based off a postcode which was then converted to long and lat then which does the calculation for the driving distance.

Normally this does provide the most accurate solution (the exchange is returned as a long lat co-ord) that you can do when youre going off postcode input for the other address.  The google API has 2 interfaces and Im having to access them both to be able to get out the info I can.  like I say normally it wouldnt matter but if someone is practically next door to the exchange then I think it cant pin-point it to within a certain no of meters.  Im just over 200m and it seems to work and I know its no consolation to you because it looks odd... but if you really are very close to the exchange then I am tied by the info that the google driving distrance calculates and there could be differences of a few meters that do show up when youre so close to the exchange. :/

If I went back to just all post-codes (it is actually the easiest solution for coding), but it terms of overall output it gives the least accuracy, hence the hybrid.
The only real solution could possibly be requesting the user to input their full address inc house number into the checker and seeing how google coped with that, but at the end of the day Im still going to be totally reliant on the info that google maps returns.

At at some point in the future I may think about requesting a full address, but the other thing I do have to bear in mind is that the more info I request from the API, then the more it seems to slow things down before the results page appears..  Ive already noticed that sometimes it can be slow (it gathers the info from a few different of sources) and Im a bit hesitant (read lazy :D ) at changing things again :/
Title: Re: Beta Testers needed
Post by: Astral on October 09, 2007, 04:24:32 PM
I wouldn't worry too much, Kitz. The results are in the right area now. They were much too short, in my case, in the earlier version, but you are never going to be able to account for cable runs that don't follow roads or go by indirect routes for all sorts of reasons.

If it ain't broke; don't fix it. :)