Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI: Add new location action to database node in Data tab #790

Conversation

lindakarlovska
Copy link
Contributor

@lindakarlovska lindakarlovska commented Jul 14, 2020

wxGUI/datacatalog: New functions download_location_interactively, create_location_interactively added. Also checking for location validation a bit changed, made more clear. After clicking on grass node, two options for creating and downloading location are avaliable.

@lindakarlovska lindakarlovska marked this pull request as draft July 14, 2020 15:24
@lindakarlovska
Copy link
Contributor Author

lindakarlovska commented Jul 16, 2020

There is no longer the above-mentioned error after the Creating of new location in data catalog but I tried out to Read CRS from a georeferenced data file and this does not work. Not sure whether my georeferenced file is weird or there is an error. I tested .tfw and .jgw files looking like this:
Screenshot from 2020-07-16 02-15-55

@petrasovaa
Copy link
Contributor

There is no longer the above-mentioned error after the Creating of new location in data catalog but I tried out to Read CRS from a georeferenced data file and this does not work. Not sure whether my georeferenced file is weird or there is an error. I tested .tfw and .jgw files looking like this:
Screenshot from 2020-07-16 02-15-55

This is not a world file, it's any tif, shp, ....

@wenzeslaus wenzeslaus added this to In progress in New GUI Startup via automation Jul 17, 2020
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic functionality works for me, but there is couple issues I tried to describe in the comments.

Additionally, I tried changing the database directory in the location wizard and that caused some confusion in data catalog. GUI freezes and in command line I got "LOCATION </tmp/nc_spm> not available...access: No such file or directory" where /tmp/nc_spm is a combo of the database from the location wizard and nc_spm is a name of the current loation, but in different database.

gui/wxpython/startup/guiutils.py Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Outdated Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Outdated Show resolved Hide resolved
@petrasovaa petrasovaa added gsoc Reserved for Google Summer of Code student(s) GUI wxGUI related labels Jul 17, 2020
@lindakarlovska
Copy link
Contributor Author

lindakarlovska commented Jul 17, 2020

Basic functionality works for me, but there is couple issues I tried to describe in the comments.

Additionally, I tried changing the database directory in the location wizard and that caused some confusion in data catalog. GUI freezes and in command line I got "LOCATION </tmp/nc_spm> not available...access: No such file or directory" where /tmp/nc_spm is a combo of the database from the location wizard and nc_spm is a name of the current loation, but in different database.

I made several changes and this problem addressed at the end of my "trying" and I was not able to reach the state you are describing. There are two cases. It works fine in case I add the new database I want to append in to datacatalog before creating the new location. If I do not add this database It does not react but It does not display any error. I need to have a look more deeply at this case.
But in both mentioned cases I get this message:
Screenshot from 2020-07-17 11-04-51
and no error after that.

Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are additional comments based on your change and my further analysis.

gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Show resolved Hide resolved
@petrasovaa
Copy link
Contributor

Basic functionality works for me, but there is couple issues I tried to describe in the comments.
Additionally, I tried changing the database directory in the location wizard and that caused some confusion in data catalog. GUI freezes and in command line I got "LOCATION </tmp/nc_spm> not available...access: No such file or directory" where /tmp/nc_spm is a combo of the database from the location wizard and nc_spm is a name of the current loation, but in different database.

I made several changes and this problem addressed at the end of my "trying" and I was not able to reach the state you are describing. There are two cases. It works fine in case I add the new database I want to append in to datacatalog before creating the new location. If I do not add this database It does not react but It does not display any error. I need to have a look more deeply at this case.
But in both mentioned cases I get this message:
Screenshot from 2020-07-17 11-04-51
and no error after that.

The GUI currently freezes if you attempt to change the db in location wizard first page. That's probably because it switches the db in OnWizFinished. It should be enough to remove the g.gisenv call from there.

Since the db can be changed in the wizard, you need to search the tree for the requested db and if the node is not there, you need to add the database to the tree..

gui/wxpython/datacatalog/tree.py Outdated Show resolved Hide resolved
gui/wxpython/gis_set.py Outdated Show resolved Hide resolved
gui/wxpython/gis_set.py Outdated Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Outdated Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Outdated Show resolved Hide resolved
gui/wxpython/startup/guiutils.py Outdated Show resolved Hide resolved
lindakladivova added 7 commits July 19, 2020 01:42
…ate_location_interactively added. Also checking for location validation a bit changed, made more clear. After clicking on grass node, two options for creating and downloading location are avaliable.
…d_location_interactively corrected. In the function create_location_interactively tuple is returned instead of actual GUI. Function import_file is moved to guiutils.py as a seperate function.
…to create_location_interactively. Flake8 corrected. The error after hitting cancel in Location Wizard corrected.
…into create_location_interactively. Default mapset is PERNAMENT or could be the result of create_mapset_interactively. Function download_location_interactively was adapted in terms of interface with the create_location_interactively. Still error related to the change of grassdatabase within location wizard.
… from OnCreateLocation. InsertLocation removed as well. Tried to add grass database to datacatalog within OnWizFinished function but I am not sure if I do it well.
@lindakarlovska lindakarlovska force-pushed the wxGUI-Add-new-location-action-to-database-node-in-data-tab branch from 9e611e7 to 48bf628 Compare July 19, 2020 08:25
@lindakarlovska
Copy link
Contributor Author

lindakarlovska commented Jul 19, 2020

Basic functionality works for me, but there is couple issues I tried to describe in the comments.
Additionally, I tried changing the database directory in the location wizard and that caused some confusion in data catalog. GUI freezes and in command line I got "LOCATION </tmp/nc_spm> not available...access: No such file or directory" where /tmp/nc_spm is a combo of the database from the location wizard and nc_spm is a name of the current loation, but in different database.

I made several changes and this problem addressed at the end of my "trying" and I was not able to reach the state you are describing. There are two cases. It works fine in case I add the new database I want to append in to datacatalog before creating the new location. If I do not add this database It does not react but It does not display any error. I need to have a look more deeply at this case.
But in both mentioned cases I get this message:
Screenshot from 2020-07-17 11-04-51
and no error after that.

The GUI currently freezes if you attempt to change the db in location wizard first page. That's probably because it switches the db in OnWizFinished. It should be enough to remove the g.gisenv call from there.

Since the db can be changed in the wizard, you need to search the tree for the requested db and if the node is not there, you need to add the database to the tree..

I am not sure where to search the tree and eventually add the node is not there. I think it should be in OnWizFinished function but I need to make tree object in init here and I do not know how. I made suggestions in the past commit which do not work.

I would like to ask you several things, the best would be a video call on Monday 21 CET? What do yout think?

@petrasovaa
Copy link
Contributor

The GUI currently freezes if you attempt to change the db in location wizard first page. That's probably because it switches the db in OnWizFinished. It should be enough to remove the g.gisenv call from there.
Since the db can be changed in the wizard, you need to search the tree for the requested db and if the node is not there, you need to add the database to the tree..

I am not sure where to search the tree and eventually add the node is not there. I think it should be in OnWizFinished function but I need to make tree object in init here and I do not know how. I made suggestions in the past commit which do not work.

You search the tree in tree.py. Use SearchNodes functions, plenty of examples in tree.py.

@lindakarlovska
Copy link
Contributor Author

The GUI currently freezes if you attempt to change the db in location wizard first page. That's probably because it switches the db in OnWizFinished. It should be enough to remove the g.gisenv call from there.
Since the db can be changed in the wizard, you need to search the tree for the requested db and if the node is not there, you need to add the database to the tree..

I am not sure where to search the tree and eventually add the node is not there. I think it should be in OnWizFinished function but I need to make tree object in init here and I do not know how. I made suggestions in the past commit which do not work.

You search the tree in tree.py. Use SearchNodes functions, plenty of examples in tree.py.

Now, it should work.

@wenzeslaus wenzeslaus linked an issue Jul 20, 2020 that may be closed by this pull request
@wenzeslaus wenzeslaus marked this pull request as ready for review July 21, 2020 02:58
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. This works for me as expected. Can you please go through the comments and make sure they are all addressed and comment on them how they were addressed?

@wenzeslaus wenzeslaus self-requested a review July 21, 2020 03:00
lindakladivova added 2 commits July 21, 2020 12:40
…ively and create_location_interactively added. Changed function OnCreateLocation in gis_set.py.
@wenzeslaus wenzeslaus merged commit bccf537 into OSGeo:master Jul 24, 2020
New GUI Startup automation moved this from PRs in progress to Done Jul 24, 2020
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc Reserved for Google Summer of Code student(s) GUI wxGUI related
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[Feat] Add new location action to database node in Data tab
4 participants