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

Disable geometry check per layer in 1.6 #2644

Merged
merged 1 commit into from
Nov 17, 2016

Conversation

juliensam
Copy link
Contributor

@juliensam juliensam commented Nov 16, 2016

Fix #2583

Added the geometry_validation UIMetadata to disable the check ST_IsValid and ST_IsSimple. Simply set it to False to disable it. Added tests and there's only one commit.

@juliensam juliensam force-pushed the disable_geom_check_1.6 branch from 1ab3063 to ecde7f5 Compare November 16, 2016 18:37
@juliensam
Copy link
Contributor Author

Ready for review

@sbrunner
Copy link
Member

Thanks @juliensam :-)

@sbrunner sbrunner changed the title Fix #2583 - Disable geometry check per layer in 1.6 Disable geometry check per layer in 1.6 Nov 17, 2016
@sbrunner
Copy link
Member

I think that this line: should be moved https://github.com/juliensam/c2cgeoportal/blob/ecde7f5dc5fe73a2660c90840d127f5d181c5b23/c2cgeoportal/views/layers.py#L326...

To get something like this:

            if self._get_ui_metadata(
                    layer, "geometry_validation", str(self.settings.get("geometry_validation", "false"))).lower() != "false":
                self._validate_geometry(spatial_elt)

and moved in a method to don't have duplicated code :-)

@sbrunner
Copy link
Member

In other word the geometry_validation validation settings will be the default value...

@juliensam
Copy link
Contributor Author

I'm thinkig of adding a _get_validation_setting method in the Layer model that returns a boolean. How does that sound?

@juliensam
Copy link
Contributor Author

Or should it be in LayerV1?

@juliensam
Copy link
Contributor Author

Oups! no the _get_ui_metadata is in the view. Scratch that.

@juliensam juliensam force-pushed the disable_geom_check_1.6 branch from ecde7f5 to 4fe5254 Compare November 17, 2016 13:55
@sbrunner
Copy link
Member

Thanks :-)

@sbrunner sbrunner merged commit f594ce1 into camptocamp:1.6 Nov 17, 2016
@juliensam
Copy link
Contributor Author

Ready to merge

@sbrunner sbrunner added this to the 1.6.10 milestone Nov 25, 2016
@ger-benjamin ger-benjamin modified the milestones: 1.6.10, 1.6.11 May 15, 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.

3 participants