Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/content/60/9972860/html/smf/Sources/Load.php(225) : runtime-created function on line 3
iView script for GPS data
The DAM Forum
Welcome, Guest. Please login or register.
January 20, 2021, 09:54:17 PM

Login with username, password and session length
Search:     Advanced search
28033 Posts in 5147 Topics by 2903 Members
Latest Member: kbroch
* Home Help Search Login Register
+  The DAM Forum
|-+  General
| |-+  GPS/ Geotagging
| | |-+  iView script for GPS data
« previous next »
Pages: 1 [2] Print
Author Topic: iView script for GPS data  (Read 37478 times)
Sam Rohn
Location Scout & Manager
Newbie
*
Posts: 10


Location Scout :: New York City


View Profile WWW Email
« Reply #15 on: June 24, 2007, 11:31:38 PM »

i just looked at the applescript, i'm not a scripter at all, but i believe
the problem is that IVMP/EM currently return the long/lat value as degrees,
minutes, seconds, rather than as a decimal value, which i believe google maps
& earth require (i think i ran into this trying to make a web template)

http://en.wikipedia.org/wiki/Geographic_coordinate_conversion#Conversion_from_DMS_to_Decimal_Degree

so the long/lat, in degrees, minutes, seconds (DMS), which was returned by the script -

N 040° 42' 55.89
W 074° 00' 32.90

needs to be converted to, in decimal format -

40.71553
-74.00914 (note the minus symbol, indicates W)

perhaps a PHP function could accomplish this in a cross platform web template ?

there is a simple online converter, and many other useful GPS utilities   
here -

http://www.gpsvisualizer.com/calculators

sam


Logged

Sam Rohn :: 360 Panoramic Photography :: www.samrohn.com :: Location Scout :: www.nylocations.com :: New York City
johnbeardy
Administrator
Hero Member
*****
Posts: 1813


View Profile WWW
« Reply #16 on: June 25, 2007, 12:38:13 AM »

Sam

I was working on the script yesterday and am getting closer. There was an issue sending a url variable to Safari, but now the real problem is indeed to do with DMS. Google does accept degrees - that's how my equivalent Windows script works - but the degree symbol, not the others, comes over to Safari as a character string value (you'll see if you try this).

I can't rely on the same intuition as I apply on Windows - for all I know, AS may have a built in DMS to decimal function. That's the next step. Otherwise I'd have to figure out how to parse out the DMS elements and how to build conditional processing into my script. Given I don't use GPS, and use my Mac laptop when I'm watching TV or on the road, there are diminishing returns for me from this intellectual exercise!

John



Code:
on run
-- get the list of selected ID's in front window
set selectedItems to GetSelection()
set urlPrefix to "http://maps.google.com/?ll="

-- process each item
tell application "iView MediaPro"
repeat with theItem in selectedItems
set theInfo to the device info of theItem
set theText to latitude of theInfo & ", " & longitude of theInfo
end repeat
end tell

-- display dialog ¬
-- urlPrefix & theText buttons {"OK"} default button ¬
-- "OK" with icon note giving up after 10

tell application "Safari"
activate
tell document 1
set URL to urlPrefix & theText
end tell
end tell
end run


-- get the selected media items in an array ---------------------------------------------
on GetSelection()
set selectedItems to {}
tell application "iView MediaPro"
if catalog 1 exists then set selectedItems to the selection of catalog 1
end tell
if number of items in selectedItems is 0 then
display dialog ¬
"You need to select at least one media item in the front catalog in order to use this script." buttons {"OK"} default button ¬
"OK" with icon note giving up after 10
error number -128
end if
return selectedItems
end GetSelection
Logged
Sam Rohn
Location Scout & Manager
Newbie
*
Posts: 10


Location Scout :: New York City


View Profile WWW Email
« Reply #17 on: June 25, 2007, 02:01:45 AM »

i just came across a page with a similar script -

http://www.mp3car.com/vbulletin/maccar/70562-nmea-extraction-applescript-need-help.html

about 2/3 down the page, this bit seems like a DMS - Decimal converter routine for applescript ?

Code:
on GEGenerate(geGPSinfo)
--Convert GPS_Latitude into Decimal
set dd to characters 1 thru 2 of Latitude of geGPSinfo as string
set mm to characters 3 thru 9 of Latitude of geGPSinfo as string
set mmD to mm / 60
set Latitude to dd + mmD
if NS of geGPSinfo is equal to "S" then
set Latitude of geGPSinfo to "-" & Latitude of geGPSinfo as string
end if

--Convert GPS_Longitude into Decimal
set ddd to characters 1 thru 3 of Longitude of geGPSinfo as string
set mm to characters 4 thru 10 of Longitude of geGPSinfo as string
set mmD to mm / 60
set Longitude of geGPSinfo to ddd + mmD
if EW of geGPSinfo is equal to "W" then
set Longitude of geGPSinfo to "-" & Longitude of geGPSinfo as string
end if

i've never put an applescript together, but i have messed about w/ PHP a bit (at a very newbie cut & paste level), perhaps a PHP web template with map (insert your own map api key) would be a better cross platform solution ?

sam
Logged

Sam Rohn :: 360 Panoramic Photography :: www.samrohn.com :: Location Scout :: www.nylocations.com :: New York City
johnbeardy
Administrator
Hero Member
*****
Posts: 1813


View Profile WWW
« Reply #18 on: June 25, 2007, 02:30:45 AM »

Sorry, I should have answered about PHP. I know it pretty well, but the user would need web hosting.

Thanks for that snippet - I'll see if I can use it.

John
Logged
Sam Rohn
Location Scout & Manager
Newbie
*
Posts: 10


Location Scout :: New York City


View Profile WWW Email
« Reply #19 on: June 25, 2007, 09:13:07 AM »

no prob, may thanx for your work on the script...

installing PHP on OS X is easy enough, there is a simple OS X type .pkg installer here, which includes GD, exif, etc  - http://www.entropy.ch/software/macosx/php/

then turn on web sharing and boom - local PHP hosting

i assume there are similar options for XP & Vista...

sam
Logged

Sam Rohn :: 360 Panoramic Photography :: www.samrohn.com :: Location Scout :: www.nylocations.com :: New York City
johnbeardy
Administrator
Hero Member
*****
Posts: 1813


View Profile WWW
« Reply #20 on: June 25, 2007, 09:16:49 AM »

Yes, there are, I have php and perl running on all my Windows machines - but I don't think many people use them.

John
Logged
blake
Newbie
*
Posts: 1


View Profile
« Reply #21 on: August 20, 2007, 12:06:34 PM »

Geotagger is a freeware mac "droplet" that runs on applescript that I think deals with this lat/long coversion. Maybe this software or contacting the fellow that wrote it could help out (http://craig.stanton.net.nz/software/Geotagger.html). I'm not a coder so I'll let the more experienced of you tackle that. I stumbled upon this post because I'd like to find a way to build a php based web gallery exported from iView (of photos tagged with lat long using Geotagger and google earth) that will provide a pre-built link to view the photo location on a google maps page. This seems similiar to what john is working on - thanks so much for your effort.

Also, I agree with Sam that installing php locally on a mac is a really easy option - I use the free version of MAMP (http://www.mamp.info/en/download.html) which comes bundled with apache and mysql.

Dane
« Last Edit: August 28, 2007, 05:53:10 PM by blake » Logged
yDuR
Newbie
*
Posts: 9

rudy_engels@hotmail.com
View Profile WWW Email
« Reply #22 on: August 21, 2007, 08:23:43 AM »

http://d-eye.be/portfolio/googlemaps.php

This is a solution for wordpress/coppermine and maybe it doesn't belong here but maybe you can find some ideas to optimize the workflow (I'm still looking after a faster one).

How does this work? Well after having worked with a dedicated gps for my D200 I now work with a Garmin GPSMap 60Cx. Via the free GPSPhotoLinker program I synchronize my pics with the gpx-track. You can then display the gpx track (see http://d-eye.be/wandelen/index.php/2007/07/09/tros-marets/#more-181) and there's a general map (see top). There's also the possibility to include a search (nearby walks, ...) which I've not yet implemented. PHP is needed though...

What should be the ideal situation? From the moment that the coordinates are in the pics (direct/indirect), upload to the server and creation of gallery and googlemaps/googleearth file...

Rudy
« Last Edit: August 21, 2007, 08:45:59 AM by yDuR » Logged
johnbeardy
Administrator
Hero Member
*****
Posts: 1813


View Profile WWW
« Reply #23 on: August 21, 2007, 08:37:46 AM »

If my script depended on PHP or perl, everyone who used my script would have to install one of them on their computer, and even if I wanted a web solution it would depend on the user having them on the server. In any case I have now got my head around how these GPS coordinates work and have created separate VB and AppleScripts to send decimal GPS to an HTML page with cross platform JavaScript.

John

PS With my Moderator hat on, Blake/yDuR please sign off posts with your names

Logged
guillbro
Newbie
*
Posts: 1


View Profile
« Reply #24 on: January 02, 2009, 04:45:38 PM »

In any case I have now got my head around how these GPS coordinates work and have created separate VB and AppleScripts to send decimal GPS to an HTML page with cross platform JavaScript.

John
I want to be able to clik on an getagged image from iView to open a safari Window with Google maps showing the aerial view of the spot without instaling php on my mac.

I have tried your applescript that you showed on the first page but I didn't manage to make it work (no Safari window was opening). I'm not an applescript pro but I did manage sometime to improve very simple script but not this one!

Did you manage to write a script that uses the DMS to decimal conversion, Can you share it with us or can I have a copy (I can give you my email adress in that case)?
Thanks in advance for your help
Guillaume

IView Media pro 3.1.3; Mac OS 10.5.3
Logged
Pages: 1 [2] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!