Hi!
So I'm working on a way to visually map data from different text files with lots of numbers in (generated from data logging apps from an iPhone) and to use these numbers to create an image file.
For example:
(the actual files I'll be using will probably have about 1000-5000 values)
text file 1; location
______________
53.226700 -0.544238 65.000000 2011-11-14 18:41:00 +0000
53.227048 -0.544065 78.480770 2011-11-14 18:41:00 +0000
53.227048 -0.544065 78.480770 2011-11-14 18:41:00 +0000
53.227048 -0.544065 78.480770 2011-11-14 18:41:00 +0000
53.226883 -0.544247 65.000000 2011-11-14 18:41:00 +0000
53.226883 -0.544247 65.000000 2011-11-14 18:41:00 +0000
______________
(longitude) (latitude) (accuracy in m) (date) (time) (not sure what this is lol)
Text file 2; magnitude
______________
Magnitude = 61.3
Time = 06:42:39 PM
Date = 2011-11-14
----------------------
Magnitude = 70.8
Time = 06:42:39 PM
Date = 2011-11-14
----------------------
Magnitude = 70.1
Time = 06:42:39 PM
Date = 2011-11-14
----------------------
Magnitude = 66.8
Time = 06:42:39 PM
Date = 2011-11-14
______________
and heres what I need to do;
- create image file with transparent background
- set pixel [x=line 1, longitude, from desktop/location.txt], [Y=line 1, latitude, from desktop/location.txt]
- set pixel value; greyscale colour; [text file 2, first magnitude value]%
(or maybe always use black colour and set the opacity with the magnitude from text file 2)
- then continue this process with the next values in each file.
I've been learning applescript very slowly but its taking way too long as this is for an architectural project to visualise values onto a map. I will take the output of this script and then scale it over a satellite map to show this layer. If anyone is interested I'm mapping values such as EMF magnitude in micro tesla and its part of my student project.
Hope someone can help make this a reality!
Thanks!
Luke
edit; theres a few tricky things here as some of the numbers aren't positive and some will only change slightly e.g., long and lat values. I'm guessing that the script will need to set the range and find the largest value of each variable and set that as 100% and then the same with the smallest values setting them as the 0% values (or something). I don't really have a clue.
edit 2; Just had another thought, if applescript can't make the image file it could open a new photoshop file and use the longitude and latitude as x,y mouse arrow co-ordinates and then click. Making the image in photoshop with a style I could define in photoshop before hand, i.e. i can change the brush style creating different output styles. but thats not important.
So I'm working on a way to visually map data from different text files with lots of numbers in (generated from data logging apps from an iPhone) and to use these numbers to create an image file.
For example:
(the actual files I'll be using will probably have about 1000-5000 values)
text file 1; location
______________
53.226700 -0.544238 65.000000 2011-11-14 18:41:00 +0000
53.227048 -0.544065 78.480770 2011-11-14 18:41:00 +0000
53.227048 -0.544065 78.480770 2011-11-14 18:41:00 +0000
53.227048 -0.544065 78.480770 2011-11-14 18:41:00 +0000
53.226883 -0.544247 65.000000 2011-11-14 18:41:00 +0000
53.226883 -0.544247 65.000000 2011-11-14 18:41:00 +0000
______________
(longitude) (latitude) (accuracy in m) (date) (time) (not sure what this is lol)
Text file 2; magnitude
______________
Magnitude = 61.3
Time = 06:42:39 PM
Date = 2011-11-14
----------------------
Magnitude = 70.8
Time = 06:42:39 PM
Date = 2011-11-14
----------------------
Magnitude = 70.1
Time = 06:42:39 PM
Date = 2011-11-14
----------------------
Magnitude = 66.8
Time = 06:42:39 PM
Date = 2011-11-14
______________
and heres what I need to do;
- create image file with transparent background
- set pixel [x=line 1, longitude, from desktop/location.txt], [Y=line 1, latitude, from desktop/location.txt]
- set pixel value; greyscale colour; [text file 2, first magnitude value]%
(or maybe always use black colour and set the opacity with the magnitude from text file 2)
- then continue this process with the next values in each file.
I've been learning applescript very slowly but its taking way too long as this is for an architectural project to visualise values onto a map. I will take the output of this script and then scale it over a satellite map to show this layer. If anyone is interested I'm mapping values such as EMF magnitude in micro tesla and its part of my student project.
Hope someone can help make this a reality!
Thanks!
Luke
edit; theres a few tricky things here as some of the numbers aren't positive and some will only change slightly e.g., long and lat values. I'm guessing that the script will need to set the range and find the largest value of each variable and set that as 100% and then the same with the smallest values setting them as the 0% values (or something). I don't really have a clue.
edit 2; Just had another thought, if applescript can't make the image file it could open a new photoshop file and use the longitude and latitude as x,y mouse arrow co-ordinates and then click. Making the image in photoshop with a style I could define in photoshop before hand, i.e. i can change the brush style creating different output styles. but thats not important.
Last edited: