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

Promoting ogr_layer_algebra to official python script #6484

Merged
merged 9 commits into from Oct 14, 2022

Conversation

kssvrk
Copy link
Contributor

@kssvrk kssvrk commented Oct 7, 2022

What does this PR do?

This PR Promotes ogr_layer_algebra.py to official Python script mentioned at issue 1581.

What i have done is the following.

  • move ogr_layer_algebra.py from swig/python/gdal-utils/osgeo_utils/samples to swig/python/gdal-utils/osgeo_utils/
  • create a calling gdal-utils script for ogr_layer_algebra.py in swig/python/gdal-utils/scripts
  • Change the arguments of main function of ogr_layer_algebra from argv=None to argv=sys.argv
  • created documentation for ogr_layer_algebra at doc/source/programs/
  • Linked the documentation for ogr_layer_algebra in index under vector section
  • Created test cases for all modes of ogr_layer_algebra at autotest/pyscripts/test_ogr_layer_algebra.py

What are related issues/pull requests?

Tries to solve Issue 1581.

Tasklist

  • Reorganised the script
  • Add test case
  • Add documentation

@rouault
Copy link
Member

rouault commented Oct 7, 2022

(please don't close the pull request each time continuous integration raises error. you can just add new commits to fix issues and push again your branch)

could you do the following documented in https://github.com/OSGeo/gdal/blob/master/CONTRIBUTING.md#build-gdal-cmake:
Setup pre-commit (to be done just once):

python -m pip install pre-commit
pre-commit install

and then you can automatically fix the .py files with: pre-commit --run-all -a (this is also automatically done on modified un-committed files when running git commit)

Copy link
Contributor Author

@kssvrk kssvrk left a comment

Choose a reason for hiding this comment

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

@rouault I have done the required changes with pre-commit hook.
black,flake8,isort have passed.
pytest is also succesful for the test script written.
Please let me know if i have to look into anything else.

swig/python/gdal-utils/scripts/ogr_layer_algebra.py Outdated Show resolved Hide resolved
autotest/pyscripts/test_ogr_layer_algebra.py Outdated Show resolved Hide resolved
autotest/pyscripts/test_ogr_layer_algebra.py Outdated Show resolved Hide resolved
autotest/pyscripts/test_ogr_layer_algebra.py Outdated Show resolved Hide resolved
autotest/pyscripts/test_ogr_layer_algebra.py Outdated Show resolved Hide resolved
autotest/pyscripts/test_ogr_layer_algebra.py Outdated Show resolved Hide resolved
doc/source/programs/ogr_layer_algebra.rst Show resolved Hide resolved
doc/source/programs/ogr_layer_algebra.rst Outdated Show resolved Hide resolved
doc/source/programs/ogr_layer_algebra.rst Outdated Show resolved Hide resolved
doc/source/programs/ogr_layer_algebra.rst Outdated Show resolved Hide resolved
@kssvrk
Copy link
Contributor Author

kssvrk commented Oct 14, 2022

@rouault I have done the recommended changes by you. Kindly review and provide feedback.

@rouault rouault added this to the 3.6.0 milestone Oct 14, 2022
@rouault rouault merged commit a6555cc into OSGeo:master Oct 14, 2022
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.

None yet

2 participants