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

Select crs #31

Merged
merged 10 commits into from
Jul 4, 2017
Merged

Select crs #31

merged 10 commits into from
Jul 4, 2017

Conversation

myarjunar
Copy link
Collaborator

@myarjunar myarjunar commented Jun 6, 2017

issue #27 #6

we will check whether the selected db has cogo scheme in it. If it doesn't have the schema then we will give an option to set one.

select-crs

@myarjunar
Copy link
Collaborator Author

could you test this PR is it works as you expecting?? @NyakudyaA

@NyakudyaA
Copy link
Collaborator

Ok I am on it now.

@myarjunar
Copy link
Collaborator Author

@NyakudyaA sorry, I've just made a patch for this PR, you can pull it again. Thanks!

@NyakudyaA
Copy link
Collaborator

ok. But just to be sure how does the selected CRS affect the database operations

@@ -299,6 +302,8 @@ def refresh_layers(self):
required_layer.layer = layer
self.iface.legendInterface().setLayerVisible(
layer, True)
if self.crs:
layer.setCrs(self.crs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok. But just to be sure how does the selected CRS affect the database operations

@NyakudyaA here, we will set the crs to the selected crs as soon as the layers are added by the plugin to the canvas.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok. That's fine. We assume that the user selects a CRS that corresponds to his database in the backend. Later we might need to add rules to check what database CRS has already been assigned to a table and compare this with the selected CRS so that a user can not select a CRS that is not the same as his database

@NyakudyaA
Copy link
Collaborator

I get the error message
rohmat

@myarjunar
Copy link
Collaborator Author

@NyakudyaA my bad, I just made another patch for that.

Sent from my LGE Nexus 5 using FastHub

@NyakudyaA
Copy link
Collaborator

So from an earlier discussion with Gavin, the select CRS need to obey the following rules.

db_connection

  • After choosing/defining a database connection we need to check if the plugin layers exist in the database.

  • Create another button that checks the database for plugin layers.

You could run a sql statement like
SELECT EXISTS (SELECT 1 AS result FROM pg_tables WHERE schemaname = 'public' AND tablename = 'beacons') This should return true if layers exist and false if it does not exist.

If the query return true for all the layers then we proceed to load them from the database.

  • If plugin layers do not exist then the drop down for selecting a CRS becomes active and a user selects a CRS from the list. The CRS text should explain that selecting this CRS will mean it gets used in the database creation.

  • Now a user should be able to click Setup database This will create the appropriate tables using the database ddl script in the database.

  • Create another tab for help and we will populate it will the appropriate text

@myarjunar
Copy link
Collaborator Author

myarjunar commented Jun 23, 2017

@NyakudyaA could you test this again for me?

select-crs

@NyakudyaA
Copy link
Collaborator

NyakudyaA commented Jun 23, 2017

I have tested it and it's doing the expected behavior. The only problem is that the CRS substitution is not happening properly. If I look at the function I see that the CRS is defined as 32632 for UTM 32N instead of 26332. Can you also change the text here?
cogo
The text should be The selected database does not contain tables and functions required for use of the plugin. Please select a CRS and click OK to proceed setting up a database using the chosen CRS.

@NyakudyaA NyakudyaA merged commit 78c05a7 into kartoza:develop Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants