Always display Location coordinates in decimal format?

Gramps AIO64-5.1.5-1 on Win10, German language

Is there any way to tell Gramps that location coordinates should be shown in decimal format and not deg_min_sec format? Being a scientist by training, deg_min_sec is just a monstrosity for me :wink:

Override hacks have been documented in a note for feature request: 0011248: Add Preference option to control display format of Latitude/Longitude

Coordinates stay display in the format used for entry. So, if the Latitude and Longitude columns have been added to the Places view mode configuration, then multiple formats might be shown. It is a bit disconcerting.

Thre is no option in Preference for a display format override for coordinates. But an enhancement has been requested.

https://gramps-project.org/bugs/view.php?id=11248

Iā€™m afraid but that appears to be not the case. I always enter the coordinates in decimal format (monstrosity and so :wink: ) but at least my Gramps displays all coordinates in deg/min/sec format:

image

All coordinates in the screenshot above have been entered in decimal format but they are displayed in deg/min/sec format. If I export them, they are still in decimal format. Therefore the obvious solution (export, change in the XML export, re-import) will not fix the problem.

Hmmmm

Perhaps you did not enter data in one of the decimal formats that the validator supports? So while the parser recognizes the data, it converted the formatted value to one of the supported variants. And it chose the DEG format by default.

The GEDCOM 5.5.1 standard specifies (on page 58) a format unsupported by Gramps too: coordinates are to be decimal prefixed with 1 of 4 Cardinal direction letters ( N S E W ). None the supported decimal formats include a letter.

PLACE_LATITUDE:= {Size=5:8}
The value specifying the latitudinal coordinate of the place name. The latitude coordinate is the
direction North or South from the equator in degrees and fraction of degrees carried out to give the
desired accuracy. For example: 18 degrees, 9 minutes, and 3.4 seconds North would be formatted as
N18.150944. Minutes and seconds are converted by dividing the minutes value by 60 and the seconds
value by 3600 and adding the results together. This sum becomes the fractional part of the degreeā€™s
value.

PLACE_LONGITUDE:= {Size=5:8}
The value specifying the longitudinal coordinate of the place name. The longitude coordinate is
Degrees and fraction of degrees east or west of the zero or base meridian coordinate. For example:
168 degrees, 9 minutes, and 3.4 seconds East would be formatted as E168.150944.

I donā€™t think so. Consider the one line with Kennung = 84385. It was entered as 48.54486 N and 13.09433 E and and those values are correctly displayed in the place editor:

The XML export has the decimal values, too, so we are obviously talking about an algorithm that converts the decimal value into deg/min/sec only to display it in the place view.

PS: Ok, after reading the ā€œSupported longitude/latitude formatsā€, I only can think of the number of the decimal digits after the point. Iā€™m using 5 digits and the Wiki talks only of either 4 or 8. But adding 3 zeros to end up with 8 digits, I still have the deg/min/sec format in the place view.

Another complication is that your screen capture example shows a cardinal direction in German: osten (east).

The documentation does not describe how localization affect validation and parsing of coordinate values.

(I dislike degree notation simply because the symbol is too hard to key in during data entry. It is also tedious to estimate minutes in decimal when looking for element on a printed map.

But it is also frustrating that that the Degrees format that Google shows when asking for a place latitude cant be parsed either. So cutā€™nā€™paste always requires some tweaking.)

Try this simple hack of the code.

Edit the program file \gramps\gui\views\treemodels\placemodel.py

at line 143 change

value = conv_lat_lon('0', data[3], format='DEG')[1]

to

value = conv_lat_lon('0', data[3], format='D.D8')[1]

and line 151 change

value = conv_lat_lon(data[4], '0', format='DEG')[0]

to

value = conv_lat_lon(data[4], '0', format='D.D8')[0]

You can use the option ā€˜D.D4ā€™ for a four digit length.

Remember this is your hack so you would need to make the same ā€˜hackā€™ when a new Gramps version is released.

My results

1 Like

BTW: I always enter in English, i e N/E and never N/O as you can see in the place editor screenshot. The German O is obviously introduced by the display algorithm for the places view combined with the German localization.

Interesting, I cut and paste the decimal format from FamilySearch and Google all the time without any issues.

That is for the place record. But when displayed in the Place views, the entries are converted into the deg_min_sec format which @UlrichDemlehner found objectionable.

I think we should be able to choose the format to display the coordinates as we have for the date format in the preferences display tab.

2 Likes

Googling ā€œomaha ne latitudeā€ returns 41.2565Ā° N, 95.9345Ā° W

You have to delete the 2 degree symbols to make the parser happy.

I use Google Maps and if I right click on the location pin, the pop up just gives the decimal numbers. I also just tried this on my phone and got. 45.3099470, -76.1168405 ,no characters. So I have to conclude the sites we use are different.

None of the supported formats mix cardinal direction letter with decimal. All the decimal format use the Ā± signs. Only the DEG format offers leading or trailing cardinal direction letters.

Please give an example of the exact entry format you prefer for coordinates. Spaces and whether the cardinal direction is a prefix or suffix might matter.

Variants tend be overlooked when specific test cases are not provided in the enhancement requests.

Google Maps is different then Googleā€™s search. Use the search term in the URL address bar of ā€œomaha ne latitudeā€ (I try to avoid all the excess mousing of map lookups. This still requires a darn cutā€™nā€™paste mousing action.)

The only thing I do prefer is a decimal format instead of deg/min/sec, but otherwise I do not really have any preferences. So my problem is not the entry format, my problem is the display format and not being able to adjust it to a decimal format. @SNoiraud nailed it: we simply should be able to adjust the format as we are able to adjust the date format.

You may want to keep this web page open then.

Just enter the location in the search bar and then pick the location you want. The Lat/Log is on the page that you can just cut/paste. It is good 99% of the time. When I say pick the place, many times the same name comes up for a Parish, County, City or town/village.

1 Like

That particular FamilySearch site is nice. Thank you.

But if Iā€™m going to have to do an extra step (finding a bookmarked URL and fill in a form field) beyond just typing a search term in the Addressbar of an extra browser window, then Iā€™m just going to use the Place Cleanup gramplet add-on. It is more convenient to eliminates all the cutā€™nā€™paste nonsense when youā€™re already putting in the effort of opening a targeted place search.

And the FamilySearch result is another case where the coordinates are tucked away in the lower right in tiny text. (And you you have to scroll down if the window is less than 1132 Ɨ 850 pixels.)

The Google search result is oversized text, prominently placed.

Wow. No matter what was Googled, nothing came up that matched any of the text for that Place in your example.

So I did an easier one. (Most people know where Walt Disney World is located):

This one show the decimal coordinates with cardinal direction in the Place Editor while showing the DEG format in the view mode columns and the Details Gramplet.

Oh ā€“ ā€œmyā€ Google knows Reschdobl and lists the only POI there that happens to be a monument for the farmers and their servants who have been slaughtered there in 1706-01-06 in the ā€œBauernschlacht von Aidenbachā€.