fisharebest / webtrees

Online genealogy
https://webtrees.net
GNU General Public License v3.0
418 stars 290 forks source link

Geographic Data, cannot "Delete unused locations" #4971

Closed TonyGravagno closed 3 weeks ago

TonyGravagno commented 3 months ago

I originally entered locations as "Chicago" or "Los Angeles", then revised in the UI to "Chicago, Illinois, USA".

After moving all references to "Chicago, Illinois, USA", both Illinois and California were correctly added under USA in Geographic Data, and the cities are under the states. I added lat/lon coordinates to each place, USA, then each state, then each city.

But "Illinois" remained as a top-level place next to USA, and could not be removed. "Chicago" is under "Illinois". That cannot be removed either. There are no facts or events related to "Chicago, Illinois", only the text with the country, which is now under USA.

"Delete unused locations" fails, even though the screen says ' "Illinois" has been deleted. ' image

I thought it might be that a record could not be deleted unless the warning flag was addressed a missing lat/lon. So I added lat/lon detail for Chicago, then Illinois, then retried "Delete unused locations". It still didn't work. Attempt to delete the individual places also failed. However, the lat/lon detail is deleted while these place records remain.

There are only two individuals and one family in this new database. There is no place specified for "Chicago" or "Chicago, Illinois" that might prevent a deletion. The two records that exist both have "Chicago, Illinois, USA".

Thanks.

kiwi3685 commented 3 months ago

No. Just not enough understanding of the mapping function.

You're looking at Geographic data. A separate table from GEDCOM places. They connect only by place names (hierarchical) when map is displayed.

fisharebest commented 3 months ago

If Illinois is being added, then the data must come from somewhere. The code is searching the indexes for your tree.

Perhaps this index contains an orphaned value? Maybe as the result of an earlier error?

If you export your tree to a GEDCOM file and then re-import it, then webtrees will rebuild the index.

HonkXL commented 2 months ago

I have the same problem here: it shows me a lot of unused places in the list. They are really nowhere used in one of my trees. Look my screenshot: Allan Park and Ányás are no longer in use. The places still exists, but in other hierarchies like "Allan Park, USA". It's very hard to find them in one of my many trees. Exporting and importing is a hard job because my trees are large. Total of over 170.000 persons in 15 trees...

In the screenshot I clicked to "delete all unused places". There comes messages that they are deleted, but they still exists. I closed most of the delete messages before making screenshot to show the problem.

In the next levels of hierarchy the same problem exists...

What about a function like "database reorganisation" in old database applications? This would be very helpful here.

locations-wt
fisharebest commented 2 months ago

If you export your tree to a GEDCOM file and then re-import it, then webtrees will rebuild the index.

Were you able to do this?

It would confirm my hypothesis about orphaned place entries.

TonyGravagno commented 2 months ago

Just coming back this. Will respond within some days. Thanks.

HonkXL commented 3 weeks ago

I found a solution: search for the place, open any person that uses this place, change one character in the place, save, then change it back and everything works fine.... All placec that had this problem were added in 2020/2021. I think at this time there must have been a problem with places, maybe.

But now it works. If you have any idea: great. If not, you can close this.

fisharebest commented 3 weeks ago

@TonyGravagno - if you are still having issues, then perhaps you could allow me access to your site to investigate. Otherwise, I do not think I can help you.