Macro to calculate offset markers on googlemaps

M

my

I am looking for a macro which will take the two co-ordinates
glat,glong (in a csv file)
and go through the list of these values (in two specific columns)
work out which ones are close to each other i.e. nn.xxx, nn.xxx either
nn.x value is the same on either co-ordinates
e.g. 52,543984, -1.494839 and 52.548948, -1.34984398 would be marked
as close.

Then an offset value (x,y) would be worked out for these
e.g
52,543984, -1.494839, -40, 30
52.548948, -1.34984398, -40, 15

so the points work in spokes. And the offset would be printed in two
specific columns.

See http://www.quickfilepost.com/download.do?get=25f26b9bca498718a6dae452d5365625
 
P

PY & Associates

I am looking for a macro which will take the two co-ordinates
glat,glong (in a csv file)
and go through the list of these values (in two specific columns)
work out which ones are close to each other i.e. nn.xxx, nn.xxx either
nn.x value is the same on either co-ordinates
e.g. 52,543984, -1.494839 and 52.548948, -1.34984398   would be marked
as close.

Then an offset value (x,y) would be worked out for these
e.g
52,543984, -1.494839, -40, 30
52.548948, -1.34984398, -40, 15

so the points work in spokes. And the offset would be printed in two
specific columns.

Seehttp://www.quickfilepost.com/download.do?get=25f26b9bca498718a6dae452...

I trust you may have to "vlookup" twice, once with the values in
ascending order and another in descending order.
Work out their differences to pick which one is closer to the value of
interest.

The file downloaded is corrupted.
 
M

my

I trust you may have to "vlookup" twice, once with the values in
ascending order and another in descending order.
Work out their differences to pick which one is closer to the value of
interest.

The file downloaded is corrupted.

Seems that site is corrupting uploads - tried 3 times.

It's here but you have to go through a bit of waiting
http://www.filefactory.com/file/b21c4e9/n/files2.zip

I'm looking to do it with XML now - seems more future proof for doing
points, but it's still the same principle, the values would still be
the same in excel
 
M

my

I trust you may have to "vlookup" twice, once with the values in
ascending order and another in descending order.
Work out their differences to pick which one is closer to the value of
interest.

The file downloaded is corrupted.

Try this



http://uploadrobots.com/X4HgEq




Seems quickfilepost doesn't work.

I am not sure myself how the offset relates to the lat,long values but
i believe it's just a number of pixels. I am thinking this varies with
the zoom level as to whether there would be "close" data. So if the
map is 500 pixels wide, an offset of (4,3) would go 4 pixels across, 3
pixels up and draw a line from the (lat,long) to that point.



I believe something like this might do the job?



function getPoint(lat, lon, mapwidth, mapheight) {
x = (180+lon) * (mapwidth / 360);
y = (90-lat) * (mapheight / 180);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top