How To Get An Use An Unique Identifier For Each Street In Google Maps Api
My objective here is to identify while the user is asking for directions, if the user has already been in one of the streets (even if not in the exact same coordinates) that were g
Solution 1:
I know you've probably moved on or figured this out by now, but I'll tell you what I would do.
If I wanted to identify streets that might be familiar, I would identify blocks on the street as a set of start and end coordinates. You could check for proximity to the ends of the blocks.
You should be able to find the ends of a block by geocoding the address of a point on the block and split the address line string up by spaces. parse the first number into an int, subtract the modulus of the street number divided by 100, then add one for the beginning and 99 for the end.
String[] splitAddr = address.getAddressLine(0).toString().split("\\s");
houseNum = splitAddr[0];
street = address.getAddressLine(0).toString().substring(houseNum.length());
blockNum = Integer.parseInt(houseNum);
blockNum = (blockNum - (blockNum % 100));
blockstart = blockNum + 1;
blockEnd = blockNum + 99
Post a Comment for "How To Get An Use An Unique Identifier For Each Street In Google Maps Api"