Map geeks: 25K on S...
 

[Closed] Map geeks: 25K on Streetmap

Posts: 0
Free Member
Topic starter
 

I've just noticed Streetmap now has 25K ordnance maps too - and not skewed like Multimap ๐Ÿ™‚

[url= http://www.streetmap.co.uk/map.srf?X=413250&Y=473450&A=Y&Z=115 ]** see here **[/url]

now if they'd just allow us to draw onto the maps like Google...

PS sorry if someone has already pointed this out ๐Ÿ˜


 
Posted : 12/03/2009 5:16 pm
Posts: 11937
Free Member
 

draggable too. Nice.


 
Posted : 12/03/2009 5:19 pm
Posts: 45993
Free Member
 

It changed a couple of months back ๐Ÿ™„

Yes, I want an OS map, combined with Bikeley...


 
Posted : 12/03/2009 5:34 pm
Posts: 0
Free Member
 

Pity they're not making them available for OS Openspace ๐Ÿ™

Displaying routes over 50k is ok but over 25k would be better


 
Posted : 12/03/2009 5:38 pm
Posts: 0
Free Member
 

www.bikehike.co.uk

lets you plot on an OS map, only 50k but still great for free!


 
Posted : 13/03/2009 12:25 pm
Posts: 91157
Free Member
 

http://wheresthepath.googlepages.com

Best online map app ever. FACT.


 
Posted : 13/03/2009 12:39 pm
Posts: 0
Free Member
 

Thanks for that Simon (and also to the others suggesting route planning apps - those also look useful). I'd certainly not noticed before, despite Streetmap having always been my favourite online mapping (have been using Multimap more recently since they introduced 1:25k mapping). Not only is it not skewed, it's also better res. than either OS or Multimap - fortunately I now have unlimited overnight bandwidth for ripping, as higher res presumably means bigger file sizes!


 
Posted : 13/03/2009 12:58 pm
Posts: 27
Free Member
 

what do you mean by skewed?


 
Posted : 13/03/2009 1:13 pm
Posts: 0
Free Member
 

On multimap 1:25k, the EW OS grid lines aren't horizontal, and the NS grid lines aren't vertical. They are also curved (though you can't really see that from the small area available). It does of course depend what you mean by skewed, since the OS grid lines are based on a distorting projection, and in fact with the multimap projection EW latitude lines are horizontal and NS longitude lines are vertical!


 
Posted : 13/03/2009 1:23 pm
Posts: 2
Free Member
 

Err OS let you do this on their site.
< http://explore.ordnancesurvey.co.uk/>


 
Posted : 13/03/2009 1:26 pm
Posts: 0
Free Member
Topic starter
 

this is what I've done:
[url= http://www.bogtrotters.org/show_overlayy25.php?route=144&album=944&scale=1&base=25 ]example route using streetmap data[/url]


 
Posted : 13/03/2009 2:06 pm
Posts: 0
Free Member
 

Careful Simon - you're almost certainly breaking Streetmap T&Cs with that (can't be bothered to go and check, but would be very surprised if they did allow that, and I'd expect they may well notice).

...though I'm curious how you got the "loc2" numbers for the images, as I can't work that one out at the moment - or did you just nav to all the locations within Streetmap? ๐Ÿ˜ฏ


 
Posted : 13/03/2009 2:11 pm
Posts: 0
Free Member
 

Streetmap don't have crown copyright mark on their page at all either!


 
Posted : 13/03/2009 2:17 pm
Posts: 0
Free Member
Topic starter
 

you're almost certainly breaking Streetmap T&Cs with that

I'm just adding a copyright link to them - I've been doing that for my popup maps for 2 years

I have not copied the data, it's still on their servers


 
Posted : 13/03/2009 2:19 pm
Posts: 0
Free Member
 

I have not copied the data, it's still on their servers

I'm aware of that (hence the comment about image URLs above if you missed the edit - any comment on that?) However I'm still not convinced they'll be happy about hotlinking their image data.


 
Posted : 13/03/2009 2:23 pm
Posts: 0
Free Member
Topic starter
 

...though I'm curious how you got the "loc2" numbers for the images, as I can't work that one out at the moment - or did you just nav to all the locations within Streetmap?

one time, yes ๐Ÿ™‚
Oh, and I have an OS licence for displaying maps


 
Posted : 13/03/2009 2:23 pm
Posts: 0
Free Member
 

..."loc2" does appear to follow some sort of logical pattern, so I think it's probably possible to work it out. Probably put there on purpose to try and stop people ripping ๐Ÿ™„

This all takes me back to the days before I owned Anquet maps (1:25k digital mapping is rather prohibitive to buy!)


 
Posted : 13/03/2009 2:31 pm
Posts: 0
Free Member
Topic starter
 

However I'm still not convinced they'll be happy about hotlinking their image data.

I've added a link back to their site, and it will be more obvious when I've finished the development. I expect the small amount of data hotlinked will not bother them if I also deliver a bit of traffic... and as we saw a couple of months back, it's quite easy to detect hot linking on a server and serve something different instead - but they obviously choose not to.


 
Posted : 13/03/2009 2:35 pm
Posts: 0
Free Member
Topic starter
 

..."loc2" does appear to follow some sort of logical pattern

it does, but it has escaped me to date ๐Ÿ™


 
Posted : 13/03/2009 2:36 pm
Posts: 0
Free Member
 

I'll report back if and when I work it out. Some sort of XOR hashing function involving all parts of the main URL I think.


 
Posted : 13/03/2009 2:41 pm
Posts: 0
Free Member
 

If you're interested, loc2 is XOR of ASCII values for the main image URL (ie the "SD64SW72" bit) all XORed with 0x28 (I think that has some relation to the ASCII for "gif", but can't quite work it out, and it doesn't really matter). You then take that number and rotate left by 3 bits (by rotate I mean the LSB becomes the MSB) - in C, this can be coded as:

loc2 = ((loc2&7) << 5) | ((loc2&0xF8) >> 3);

A quick bit of scratch code for the whole thing is:

strRef.Format("SD%d%d%c%c%d%d", x/100, y/100, (y%100)<50?'S':'N', (x%100)<50?'W':'E', (x/5)%10, (y/5)%10);
unsigned char loc2=0x28;
for (i=0; i<strRef.GetLength(); i++)
{
loc2 ^= strRef[i];
}
loc2 = ((loc2&7) << 5) | ((loc2&0xF8) >> 3);
strURL.Format("http://streetmap.co.uk/img.srf?image=%s.gif&loc2=%.2x&type=O25", strRef, loc2);


 
Posted : 14/03/2009 11:56 pm
Posts: 0
Free Member
Topic starter
 

cheers aracer ๐Ÿ™‚ Have you worked out the conversion from OS grid pos to file name yet ? (ie the SD44NE28 bit)


 
Posted : 15/03/2009 12:14 am
Posts: 0
Free Member
 

The first line of my second bit of code does most of that - x and y are the 6 figure (ie 3 figures each) ref within the two letter grid square. There's stuff on the web (possibly OS website?) for calculating grid square letters if you need that. In English:
Two letters for grid square (OS Landranger coords)
First digit of Easting within grid square
First digit of Northing within grid square
'S' if second digit of Northing is 0-4, 'N' if second digit of Northing is 5-9
'W' if second digit of Easting is 0-4, 'E' if second digit of Easting is 5-9
(second and third digits of Easting divided by 5) modulo 10
(second and third digits of Northing divided by 5) modulo 10

Basically they first divide the country into normal Landranger squares denoted by two letters. Each of those is then divided into 10km squares with the reference for each square being the next two digits. Then divide each 10km by 10km into 4 quadrants, SW, SE, NW and NE. Then finally divide each 5km resulting square into 500m squares denoted by the last two digits. Streetmap has always done their image squares like this, so it's not something new for me ๐Ÿ˜‰


 
Posted : 15/03/2009 12:31 am
Posts: 0
Free Member
Topic starter
 

thanks [b]aracer[/b], I wasn't paying attention to the C code ๐Ÿ™‚
I puzzled over it for ages but I guess codebreaking isn't my forte. I just ran the loc2 in PHP and it works perfectly!


 
Posted : 15/03/2009 12:38 am
Posts: 0
Free Member
 

I just ran the loc2 in PHP and it works perfectly!

What do you mean by that (not into PHP)?

Before I decoded it I did find that a call to "http://streetmap.co.uk/ajaxtp.srf?x=400000&y=400000&z=115" (for example - x and y there are National Grid numbers) did return correctly formatted image and loc2 numbers (the loc2 is the two digit number straight after the first @) by monitoring the HTTP traffic with Fiddler and examining the Javascript code. That helped a lot with the codebreaking, as I could quickly and easily generate loc2 codes - though it's also something which is my forte (usual technique being to try changing one thing at a time and see what happens).

Edit: made Streetmap URL non-clicky so they don't trace it back here if they check their logs!


 
Posted : 15/03/2009 12:53 am
Posts: 0
Free Member
Topic starter
 

What do you mean by that (not into PHP)?

sorry, I meant I tried the XORs of the ASCII and then the rotate bits. Yes I tried the AJAX call but it didn't work from my own webpages


 
Posted : 15/03/2009 1:01 am
Posts: 0
Free Member
 

HTH ๐Ÿ˜€


 
Posted : 15/03/2009 1:07 am
Posts: 45993
Free Member
 

Cheers guys - some great tools I have been looking for there.


 
Posted : 15/03/2009 12:48 pm
Posts: 0
Free Member
Topic starter
 

sorry aracer - your XOR doesn't seem to work ๐Ÿ™
chk: 7b c: 53 = S
chk: 3f c: 44 = D
chk: 0d c: 32 = 2
chk: 34 c: 39 = 9
chk: 67 c: 53 = S
chk: 22 c: 45 = E
chk: 1b c: 39 = 9
chk: 2e c: 35 = 5
SD29SE95: 35 # c5


 
Posted : 16/03/2009 12:24 am
Posts: 0
Free Member
 

Sorry - just worked that out sfb, and was coming back here to comment! I guess I was looking at a limited subset of squares all with 0 as the last digit (thought I'd varied that, but obviously not), since it's that which seems to be different to what I'd thought. That digit's essentially shifted one bit less than the rest, which also explains the 0x28 offset.

I'll try and come up with a simpler way to describe it, but what you need to do is the same as before for the first 7 characters, but for the final digit, rotate it one bit to the right before XORing it and then rotate the whole lot 3 bits left (a simpler method is to shift the result one bit left before XORing with the final digit, and then swap the nibbles at the end). There is no longer a 0x28 offset, so start with 0x00.
e.g.
chk: 53 c: 53 = S
chk: 17 c: 44 = D
chk: 25 c: 32 = 2
chk: 1c c: 39 = 9
chk: 4f c: 53 = S
chk: 0a c: 45 = E
chk: 33 c: 39 = 9
Shift one bit left, chk: 66
chk: 53 c: 35 = 5
Swap nibbles, chk: 35
Which gives you Donald Campbell.


 
Posted : 16/03/2009 3:00 am
Posts: 0
Free Member
 

C code:

strRef.Format("SD%d%d%c%c%d%d", x/100, y/100, (y%100)<50?'S':'N', (x%100)<50?'W':'E', (x/5)%10, (y/5)%10);
unsigned char loc2=0;
for (i=0; i<strRef.GetLength()-1; i++)
{
loc2 ^= strRef[i];
}
loc2 <<= 1;
loc2 ^= strRef[i];
loc2 = ((loc2&0xf) << 4) | ((loc2&0xf0) >> 4);


 
Posted : 16/03/2009 3:08 am
Posts: 0
Free Member
Topic starter
 

cheers [b]aracer[/b], I've got that working fine now ๐Ÿ™‚
[url= http://www.bogtrotters.org/show_overlayy25b.php?route=127&album=925&base=25 ]here[/url]


 
Posted : 16/03/2009 8:07 pm