Exporting Locations and Geocoordinates

Hello, I’m looking for a way to export my locations and geo coordinates so that I can import the latest version of my family tree and import my location data back in and merge any differences please?

I’m not a coder so it’s all a bit new to me so clear instructions from someone kind enough would be grately appreciated - perhaps such instructions could also be added to the wiki for the benefit of other users too?

Gramps Latest Release as of 06 Feb 2020 - running Linux Mint.

Many thanks again.

You may want to put this task off until the next release. A significant evolution is planned for the 5.2.x version of Gramps. See GEPS

Is there not a copy and paste way of doing it please? Thanks.

I thought I had a simple workaround with the Export View from the Place View. But then discovered that this export currently mangles the CSV (comma separated values) columns when there are custom Place types.

The reason Places are undergoing a major rework right now is that the interface metaphor has been stretched to the breaking point over the last 14 years. The current metaphor does not export nor merge as well as the volunteer Developers would like. When they did a deep dive into the design, they found too many conflicting constraints. So they are reworking it.

Several people have chosen the route of harmonizing their Place Tree with some external GIS system. Like GNS Geonet. This made maintenance & merging less painful. But that has been problematic too.

So if you want to do it now via the interface, you can… but it would require a LOT of manual intervention and the process is complex. It you are a coder, it is a lot more doable. This is just one place patiently anticipating the next version will save you a lot of pain.

I do wish this had been made a lot clearer before I spent a week painfully going through all of my locations. Does it help any that I have all of the Locations and Coordinates exported into an Excel Spreadsheet already? The places I have are from the built in drop down list of types btw too.

Thanks.

Yes, Open Source does expect that user be a bit more proactive in finding information than with COTS (Commercial Off The Shelf) packages.

I suspect that your GPS coordinates spreadsheet will help for the next version.

Judging from the messages that have been posted to the maillist, a lot of progress has been made. The update schedule has maintained a surprisingly aggressive release history for open source. (For the technically adept with the Git repository, lots of ‘Pulls’ are available incrementally for experimentation & feedback. Not for production use or the faint-of-heart!)

Sure, so no use currently then? I totally appreciate the Open Source world relies on coders and that the release schedule is very accurate and is a nod to talented and dedicated volunteers. I am trying to use GRAMPS as a go between from Ancestry to Webtrees, however, through it’s ability to undertake on the fly queries to allow me to test the accuracy of my data, i’m able to tidy it up before porting out the latest version to Webtrees. I appreciate that that approach is not to everybody’s liking, but, it makes sense to me as new information becomes available, particularly within the nature of DNA and its use in validating or disproving tree branches that may either be added or deleted in future versions as new people come onto Ancestry and to placate my ever-extending family members who want to see continuing dedication.

I really need an intermediary fix to be honest. Also, when is the projected release date of the next version and what do you envisage will have changed that will help me in the future - I saw a link - I think it was on another post of yours but neither were clear.

Thanks ever so much for taking the time to speak to me about this. It’s not at all personal to you or GRAMPS. It’s just a case of trying not to throw the time investment down the pan in not being able to achieve what I set out to having researched GRAMPS and having learnt quite a few things about third party “Gramplets” later where what users should expect in terms of them not being fully integrated into GRAMPS should have been clearly communicated.

Importing places from Ancestry into Gramps is going to be difficult because Ancestry places have no real structure. As far as I remember, they are just comma separated descriptions with no unique identifier. What you really need is either store a unique identifier in Ancestry or maintain a lookup table to convert between the two systems.

I’m not sure how exporting a list of locations and co-ordinates from Gramps would help, but it would be easy enough to write a script to do so.

Since you’re using only standard Place types, I suggest you make a backup & give it a try! (My Tree and all my test Trees have custom types mixed in. I can’t do a reasonable test.)

Make backup of your Tree & label as recognizably ‘before the test’. Use the Export View to make a CSV file. (Inspect it with a text editor.) Open it in your spreadsheet program make 1 specific change and re-save as a CSV. (Re-inspect the revised file. Does it still have quotes around the same data? Did it change any date formats or swap linefeeds & carriage returns?)

Note the number of Places in your Tree before importing. Import the revised CSV. Did the Place count increase? (By 1 or double?) Check the GPS coordinates for your specific change.

Please note that the View’s CSV export is DIFFERENT depending on your mode (grouped [aka hierarchical Tree] or flat list) and configuration. ONLY the fields displayed in the View configuration will be exported. If GPS coordinates aren’t one of the columns in the View, you won’t get far! So use the configuration to show the appropriate coulmns before exporting.

If there a multiples of the Places after import, you may want to experiment with the Place Cleanup Gramplet and Import Text Gramplet. Personally, I became a bit disaffected with the Import Text Gramplet. I expected that if I reduced the columns to just the ID & changed data column, it would update just that data. Instead, it blanked the other columns! :grimacing: I’m sure it was designed to fulfill a specific need of that Contributor… but didn’t fit me. No doubt it could be adapted.

This can be done with the Export to CSV and a little work in Excel or other spreadsheets…
If you need to clean up a flat structured place list to a Gramps hierarchial structure, that can be done either by using the excelent tool of OpenRefine openrefine.org (there are a long discussion about how to do it in the sourceofrge mailing list, i think it was in october/november and december 2019…

It will also be possible with formulas in Excel or other spreadsheet software… OR you can use the unbelievable Power Query tool in Excel 2016 -> (it can be downloaded for some older versions).

The thing you need to be aware of is to keep the original “Place” field for the place lowest in the hierachy, and create some custom Place “codes” for the higher levels placenames…
i.e.:
if you have New York City, NY, USA as Place P0001, and you would like this to be in a hierachy list fixed in either OpenRefine or in a spreadsheet, then you will need to add a row for NY State, and a row for USA… and give each of thos new rows a new “Place code” i.e. P0002 for NY State and P0003 for USA…

There was some problems with this, that Gramps need a sorted list, but that has been fixed, and I also think the fix has been added to the latest version of Gramps, if not, the fix is mentioned in the sourceforge maillist thread about this topic…

Its important that you use latest version of Gramps when exporting/importing the CSV list…

To get the correct format for the CSV list, just do an export of a single place, then create a table of it Excel (it will be easier to work with if you want to create formulas for extracting placenames for different sheets/workbooks…

I recommend using Power Query or OpenRefine for this job, if you have a lot of place name in flat format styles formated as a comma delimited list…
I have not found anything like Power Query in LibreOffice or OpenOffice, so if you only run Linux, OpenRefine will be the best choice I think… and with OpenRefine, you can also Reconcile data in your table with data from other tables and service providers.

And when using Power Query or OpenRefine, you can batch add Dates, Types and other values as you need to…
Its still a lot of work, but not as much as if you should do it all manually…

When you import the Edited CSV with all you hierachial data back to Gramps, all places with the PlaceID will be updated and places with ID’s not in Gramps will be created…

Please remember to do all this work on a test database !

You will most likely have to do the import/export a lot of times untill you have the data like you want it…

I have created one csv with more than 80000 places this way, and I have multple CSV files that I am about to merge to one table of more than 800000 placenames…

It should also work with alternative names if you use the date field and the same ID for all names, but I have not done any extended testing on that…

Just remember, the original place need to keep the original placeid unaltered, else it will be created as a new place…
You will need to use a few hours learning the work of OpenRefine, but take a look at the different tutorials they have and it should not be a big problem to do the work, only time consuming…

And done right, you will not have to merge any places in Gramps, it should be automated by the import.

Ooh… and one more thing… the placeID must be identical each place in each of the databases you import, else some of them might be overwritten or you end up with multiple identical placenames…

So this job must be done on each of the databases and the PlaceID must be “IN SYNC” if you don’t want to overwrite or get multiple entries in the resulting database…

i.e. if you have NY City in Both databases, the PlaceID must be the same in both databases to be able to merge them…
If you in the import has Philly with the ID of NY City in your target database, NY City wil be overwritten…
(If this behavior has not been changed lately, I know I screw up my own import a few times in the beginning because of that…)

If anyone have any other experience about this behavior, place correct me, its a long time since I last did an import where PlaceId had different Place Names vs. the target database

2 Likes

PS.

since the CSV import overwrite anything with the same placeID thats in the database, it will not work with Alternative Place Names… It will only use the last name in you csv with a given PlaceID…

So to be able to import a csv list with multiple names for the same location, you either need to write a VBA that creates a Gramps XML or JSON…

or change to csv export/import to support adding/merging Alternative Names instead of overwriting the records already in the database…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.