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

How to modify the shape value #252

Open
mshmoon opened this issue Jan 10, 2023 · 1 comment
Open

How to modify the shape value #252

mshmoon opened this issue Jan 10, 2023 · 1 comment
Labels

Comments

@mshmoon
Copy link

mshmoon commented Jan 10, 2023

What's your question?

I want to modify the shape value directly, by using sf.shape(i).points = [[xx,xx]],but it is nothing useful

@karimbahgat
Copy link
Collaborator

karimbahgat commented Jan 10, 2023

Pyshp currently does not allow direct editing of files. As you mention, modifying a shape read from a shapefile with Reader will therefore only modify the shape loaded into memory, not the actual file. If you want to edit the shapes, you would read in shapes with a Reader, edit them, then write them to a new shapefile with a Writer. The Readme has an example of this: https://github.com/GeospatialPython/pyshp#editing-shapefiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants