Please do NOT expect all Feature Requests to be actioned automatically. Describing your proposal here will ensure the development team are aware of it, and they will give it careful consideration.
  • Page:
  • 1
  • 2

TOPIC:

Removal of Locations 3 weeks 7 hours ago #1

  • jheiler
  • jheiler's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 93
I request to provide a process to remove places that are no longer needed. I have places without a link to events and those with link to zero events in the overview "Geographic Data". The delete function does not work properly.
The locations with zero events are also visible in the locations list. Screenshots are attached.
Kind regards

Attachments:

Please Log in or Create an account to join the conversation.

Removal of Locations 3 weeks 4 hours ago #2

  • hermann
  • hermann's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 295
I have such unused locations, too. Because of merging several trees together, there are hundreds of them. I'm missing a function to delete them all with one click instead of deleting them one by one.
webtrees 2.0.16 (all available custom modules installed, php 7.4.15, MySQL 5.6) @ ahnen.hartenthaler.eu/
and webtrees 1.7.18 (many custom modules) @ ahnen1.hartenthaler.eu/

Please Log in or Create an account to join the conversation.

Removal of Locations 3 weeks 2 hours ago #3

  • Gustine
  • Gustine's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 179
webtrees 1.7.17 (+ module sosa17 + vytux_menu + ancestral fan chart + openstreetmap) - Mageia 7 (php 7.3)

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 6 days ago #4

Hello,
Perhaps this thread can help : www.webtrees.net/index.php/en/forum/help...to-clean-places-list

That thread doesn't really help if the locations doesn't yet have a latitude/longitude position set. When I export to CSV I only get the locations with explicit positions.

I'm currently working on fixing all my locations to follow the same hierarchy structure, that's easiest (not easy though) editing the gedcom using a text editor (Notepad++) and Excel and doing a lot of search, reformat, copy and replace, then re-importing the file now and then. That means for every location I fix, I get an unused location. I have over 4000 locations so there's some work to do... it would have been MUCH easier to have a clean method to get rid of ALL unused locations with ONE click on a button instead of walking through every location one by one, click, wait several seconds, scroll the page and find the next unused and so on... that's tedious.

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 6 days ago #5

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
> it would have been MUCH easier to have a clean method to get rid of ALL unused locations with ONE click on a button instead of walking through every location one by one

Did you read my comment #5 in that thread?
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 6 days ago #6

> it would have been MUCH easier to have a clean method to get rid of ALL unused locations with ONE click on a button instead of walking through every location one by one

Did you read my comment #5 in that thread?

I did, but fail to understand how that could solve the issue. When I export to CSV I only get all locations that has a latitude/longitud point. That's not my problem. I don't want to delete locations that hasn't yet got any map point, only those that are not used in my tree.

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 6 days ago #7

  • jheiler
  • jheiler's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 93
I remove all obsolete entries from the tables placelinks, places and place_location, but they are restored again. I am not a database specialist, but I see different indices in the structure. The final removal of places is for me a basic requirement. It would be great, if such a function could be implemented. Please see encl. screenshot.
Kind regards

Attachments:

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 6 days ago #8

I did, but fail to understand how that could solve the issue. When I export to CSV I only get all locations that has a latitude/longitud point. That's not my problem. I don't want to delete locations that hasn't yet got any map point, only those that are not used in my tree.


It is not a problem when a "blank" location is deleted - there are no data there. I think, that the used places with no latitude/longitud will be deleted in the first step, and in a second step automaticly recreated. In pervious versions there was a possibility to import places fromt the tree - now should this import work automaticaly.

Ladislav
webtrees 2.0.16 + ⚶ Vesta modules (from cissee.de/)
on PHP Version 7.3.14

Please Log in or Create an account to join the conversation.

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Removal of Locations 2 weeks 5 days ago #9

I did, but fail to understand how that could solve the issue. When I export to CSV I only get all locations that has a latitude/longitud point. That's not my problem. I don't want to delete locations that hasn't yet got any map point, only those that are not used in my tree.


It is not a problem when a "blank" location is deleted - there are no data there. I think, that the used places with no latitude/longitud will be deleted in the first step, and in a second step automaticly recreated. In pervious versions there was a possibility to import places fromt the tree - now should this import work automaticaly.

Ladislav


Well, I think we're not talking about the same issue here. For me a "blank" location means that I have a name and structure for the place, but haven't yet put in the location. So it must not be deleted in any case. All my "blank" locations are waiting for me to catch up and put in the latitude/longitude values, a very time consuming process since I have to manually lookup every estate, farm or address and get the coordinates for those.

Example 1, here all places must be kept, even those that are "blank" without location:



Example 2, here three places are unused and can safely be deleted since they're not used anywhere. An automatic method for this would save many days of work, at least for me.

Attachments:

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #10

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
> For me a "blank" location means that I have a name and structure for the place, but haven't yet put in the location. So it must not be deleted in any case. All my "blank" locations are waiting for me to catch up and put in the latitude/longitude values

Trust us!

You did not create those "blank" locations. They were created automatically by webtrees.

If you use a place name in one of your trees, a "blank location" will be created for you.

If you delete them all - then they will be recreated.

So - follow our instructions.

The locations with co-ordinates will be loaded from the file.
The "blank" locations without co-ordinates be be created automatically.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #11

> For me a "blank" location means that I have a name and structure for the place, but haven't yet put in the location. So it must not be deleted in any case. All my "blank" locations are waiting for me to catch up and put in the latitude/longitude values

Trust us!

You did not create those "blank" locations. They were created automatically by webtrees.

If you use a place name in one of your trees, a "blank location" will be created for you.

If you delete them all - then they will be recreated.

So - follow our instructions.

The locations with co-ordinates will be loaded from the file.
The "blank" locations without co-ordinates be be created automatically.


Oh, I'm sorry, I do trust you! It's just that if I make a mistake causing 4500+ places go lost in void, then I'd be very lost...

Anyway, I followed your instructions, exported to CSV, then re-imported the same file using the default import settings.

Still I have the unused places in my list. No changes at all.

Attachments:

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #12

Alright, I tried again and chose to remove all existing data when importing, and yes, now most of the unused places was removed and everything else recreated! Great, that was a relief.
Still, not all of them got removed for some reason, but I probably can fix those manually.

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #13

I should have looked more carefully, now all my locations are gone. Places are valid, but all my coordinates got removed.
So that method is really not fool-proof.

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #14

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
You saved all your co-ordinates in a CSV (or geojson) file.

You should be able to import them.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #15

Yes, in the CSV file all the coordinates are fine. But they don't get imported. Is the import function validated with Unicode-8 ?

Here's a sample from CSV-file raw text with Swedish characters:

Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by hahalj.

Removal of Locations 2 weeks 5 days ago #16

In the file
\app\Http\RequestHandlers\MapDataImportAction.php
I note line 111:
while (($row = fgetcsv($fp, 0, MapDataService::CSV_SEPARATOR)) !== false) {

but is fgetcsv handling also UTF8 characters seamlessly?
According to this discussion there might be needed some extra code to take care of that:
stackoverflow.com/questions/8882090/utf-...sv-file-with-fgetcsv

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #17

I added UTF8 support according to the solution in the mentioned discussion on StackOverflow. I've attached it as a zip-file here.
With this patch I could import all my locations with coordinates. So my issue is solved. If you want to add it to the project, please do so.

Still I think a new feature with a simple button would make life easier than this export/re-import procedure.

File Attachment:

File Name: MapDataImp...tion.zip
File Size:3 KB
Attachments:

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #18

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
I do not know what you are doing. Let me try again with pictures.

1) Here is my data. It includes unused places (with a red "delete" icon). It includes UTF8 characters.



2) I export it to a CSV file

3) I import the CSV file, and I select the option "delete all data first"



4) I now have all my location data - but the unused places are gone.

Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
Attachments:

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #19

This is exactly how I did it.
But it failed updating with co-ordinates, after I patched the MapDataImportAction.php as mentioned above it worked.
And my site language settings is Swedish, if that matters.

Please Log in or Create an account to join the conversation.

Removal of Locations 2 weeks 5 days ago #20

  • jheiler
  • jheiler's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 93
@hahalj
Thank You very much that you hijacked my threat. My request is lost in space...

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum