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

Processing algorithm "gdal:clipvectorbypolygon" not working #2

Open
nmstreethran opened this issue Sep 1, 2021 · 0 comments
Open
Assignees

Comments

@nmstreethran
Copy link
Owner

nmstreethran commented Sep 1, 2021

outLayer = (
    "ogr:dbname=\'" + gpkgPath + "\' table=\"emodnet_bathymetry\" (geom)"
)
params = {
    "INPUT": tempDir + "bathymetry_pts_osgb.shp",
    "MASK": gpkgPath + "|layername=study_area_water",
    "OUTPUT": outLayer
}
processing.run("gdal:clipvectorbypolygon", params, feedback=feedback)

Current workaround (using GeoPandas):

import geopandas as gpd

data = gpd.read_file(
    tempDir + "bathymetry_pts_osgb.shp",
    mask=gpd.read_file(gpkgPath, layer="study_area_water")
)
data.to_file(gpkgPath, layer="emodnet_bathymetry", driver="GPKG")
@nmstreethran nmstreethran self-assigned this Sep 1, 2021
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

No branches or pull requests

1 participant