<para />\r
You may also drag-and-drop a URL of this type onto the map to cause the map to be re-centered.\r
<para />\r
- To enable this feature, create the file\r
+ This feature uses the file:\r
<para />\r
- <code>~/.config/geeqie/geocode-parameters.awk</code>\r
+ <code>/usr/local/lib/geeqie/geocode-parameters.awk</code>\r
<para />\r
- and copy the following text into it:\r
- </para>\r
- <para>\r
- <programlisting xml:space="preserve">\r
- # Store this file in:\r
- # ~/.config/geeqie/geocode-parameters.awk\r
- #\r
- # This file is used to decode the results of internet or other searches\r
- # to extract a geo-position from a text string. \r
- # To include other searches, follow the examples below and\r
- # ensure the returned value is either in the format:\r
- # 89.123 179.123\r
- # or\r
- # Error: $0\r
- #\r
- \r
- function check_parameters(latitude, longitude)\r
- {\r
- # Ensure the parameters are numbers \r
- if ((latitude == (latitude+0)) && (longitude == (longitude+0)))\r
- {\r
- if (latitude >= -90 && latitude <= 90 &&\r
- longitude >= -180 && longitude <= 180)\r
- {\r
- return latitude " " longitude\r
- }\r
- else\r
- {\r
- return "Error: " latitude " " longitude\r
- }\r
- }\r
- else\r
- {\r
- return "Error: " latitude " " longitude\r
- }\r
- }\r
- \r
- # This awk file is accessed by an internal function.\r
- # The call is of the format:\r
- # echo "string_to_be_searched" | awk -f geocode-parameters.awk\r
- #\r
- # Search the input string for known formats.\r
- {\r
- if (index($0, "http://www.geonames.org/maps/google_"))\r
- {\r
- # This is a drag-and-drop or copy-paste from a geonames.org search\r
- # in the format e.g.\r
- # http://www.geonames.org/maps/google_51.513_-0.092.html\r
- \r
- gsub(/http:\/\/www.geonames.org\/maps\/google_/, "")\r
- gsub(/.html/, "")\r
- gsub(/_/, " ")\r
- print check_parameters($1, $2)\r
- }\r
- \r
- else if (index($0, "https://www.openstreetmap.org/search?query="))\r
- {\r
- # This is a copy-paste from an openstreetmap.org search\r
- # in the format e.g.\r
- # https://www.openstreetmap.org/search?query=51.4878%2C-0.1353#map=11/51.4880/-0.1356\r
- \r
- gsub(/https:\/\/www.openstreetmap.org\/search\?query=/, "")\r
- gsub(/#map=.*/, "")\r
- gsub(/%2C/, " ")\r
- print check_parameters($1, $2)\r
- }\r
- \r
- else if (index($0, "https://www.openstreetmap.org/#map="))\r
- {\r
- # This is a copy-paste from an openstreetmap.org search\r
- # in the format e.g.\r
- # https://www.openstreetmap.org/#map=5/18.271/16.084\r
- \r
- gsub(/https:\/\/www.openstreetmap.org\/#map=[^\/]*/,"")\r
- gsub(/\//," ")\r
- print check_parameters($1, $2)\r
- }\r
- \r
- else if (index($0, "https://www.google.com/maps/"))\r
- {\r
- # This is a copy-paste from a google.com maps search\r
- # in the format e.g.\r
- # https://www.google.com/maps/place/London,+UK/@51.5283064,-0.3824815,10z/data=....\r
- \r
- gsub(/https:\/\/www.google.com\/maps.*@/,"")\r
- sub(/,/," ")\r
- gsub(/,.*/,"")\r
- print check_parameters($1, $2)\r
- }\r
- \r
- else if (index($0,".html"))\r
- {\r
- # This is an unknown html address\r
- \r
- print "Error: " $0\r
- }\r
- \r
- else if (index($0,"http"))\r
- {\r
- # This is an unknown html address\r
- \r
- print "Error: " $0\r
- }\r
- \r
- else if (index($0, ","))\r
- {\r
- # This is assumed to be a simple lat/long of the format:\r
- # 89.123,179.123\r
- \r
- split($0, latlong, ",")\r
- print check_parameters(latlong[1], latlong[2])\r
- }\r
- \r
- else\r
- {\r
- # This is assumed to be a simple lat/long of the format:\r
- # 89.123 179.123\r
- \r
- split($0, latlong, " ")\r
- print check_parameters(latlong[1], latlong[2])\r
- }\r
- }\r
-\r
- </programlisting>\r
+ You may create your own decodes by using the above file as an example, and storing the file in:\r
+ <para />\r
+ <code>~/.config/geeqie/applications/geocode-parameters.awk</code>\r
+ <para />\r
+ If a successful decode was not made from the first file, your local version will then be used.\r
</para>\r
</section>\r