Filter by GPS Altitude

Post Reply
tplunkett
Posts: 27
Joined: 15 Mar 11 1:28

Filter by GPS Altitude

Post by tplunkett » 08 Feb 14 6:00

I am trying to filter for images that are greater or less than a particular altitude. I thought I should use the Filter by Macro Command but when I get to selecting an operator concerning the GPS Altitude, I do not have options for Greater Than or Less Than Operators. Am I doing this the proper way?

Hert
Posts: 6685
Joined: 13 Sep 03 7:24

Re: Filter by GPS Altitude

Post by Hert » 09 Feb 14 22:58

The script that you use can't currently do that. Of course, anyone is free to alter the script.
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

tplunkett
Posts: 27
Joined: 15 Mar 11 1:28

Re: Filter by GPS Altitude

Post by tplunkett » 10 Feb 14 0:08

Thanks for the reply. If anyone could help me I would appreciate it.

It seems as though Less than and Greater than operators in this area could be helpful for a variety of these scripts. I am fairly technical so if there is some sort of reference guide to scripting in PSU I would be happy to try and train myself. I have searched the board but not really finding much to help me get started.

Hert
Posts: 6685
Joined: 13 Sep 03 7:24

Re: Filter by GPS Altitude

Post by Hert » 10 Feb 14 10:08

Building in "Greater Than" and "Less Than" isn't as straightforward as one might think. These are typically numeric comparisons while the macro parser always returns string values. For instance the GPS Altitude macro will be returned something like "1453.3m". So unless you catch all the possible numeric values for every possible macro result (hardly possible) you'll always end up doing string comparisons and as you probably know: in the world of strings the value 53m is greater than 1453m.

Here's how you can do it in the current filter script;

Code: Select all

Macro command: %code result := iif(StrToFloat(StrTran('%ImageGPSAltitude', 'm', '')) > 1453.0, 'Y', 'N'); %/code
Equals: Y
That will filter all the images that have the GPS value greater than 1453
FilterAlt.png
FilterAlt.png (7.29 KiB) Viewed 4368 times
Hert
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

tplunkett
Posts: 27
Joined: 15 Mar 11 1:28

Re: Filter by GPS Altitude

Post by tplunkett » 11 Feb 14 4:21

Thank You Hert for this example. I was able to run it.

Can you give me an example of how I would format this to be its own stand alone script file that I could save and run it each time. Basically a ,psc file in the Scripts\FilterScripts folder if I am understanding things properly.

weidmic
moderator
Posts: 858
Joined: 04 Dec 06 22:21

Re: Filter by GPS Altitude

Post by weidmic » 11 Feb 14 7:15

Thanks for asking... This would help me too!
PSUServer 6.x, PostgreSQL 12.x
My homepage http://www.michaelweidner.com

Hert
Posts: 6685
Joined: 13 Sep 03 7:24

Re: Filter by GPS Altitude

Post by Hert » 11 Feb 14 8:48

I've added a save and load to the next update
This is a User-to-User forum which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

weidmic
moderator
Posts: 858
Joined: 04 Dec 06 22:21

Re: Filter by GPS Altitude

Post by weidmic » 11 Feb 14 9:10

Cool, thanks!
PSUServer 6.x, PostgreSQL 12.x
My homepage http://www.michaelweidner.com

tplunkett
Posts: 27
Joined: 15 Mar 11 1:28

Re: Filter by GPS Altitude

Post by tplunkett » 12 Feb 14 4:56

Thank You Hert! Looking forward to the update.

Post Reply