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

Fix crash when reading SVG with simplify active (read --simplify or using the read APIs with simplify=True) #732

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

nataquinones
Copy link
Contributor

@nataquinones nataquinones commented May 20, 2024

Description

Separated LineString simplification and numpy array conversion to fix TypeError caused by changing data-type for object array.

Checklist

  • feature/fix implemented
  • code formatting ok (black and ruff check .)
  • mypy returns no error
  • tests added/updated and pytest succeeds
  • documentation added/updated
    • command docstring and option/argument help
    • README.md updated (Feature Overview)
    • CHANGELOG.md updated
    • added new command to reference.rst
    • RTD doc updated and building with no error (make clean && make html in docs/)

Refactored the line simplification in _process_path to avoid the numpy TypeError caused by changing data-type for an object array. Replaced np.array(LineString(line).simplify(tolerance=quantization)) with separate LineString simplification and conversion of its 
coordinates to a numpy array. This ensures the correct handling.
@abey79 abey79 changed the title Fix TypeError in line simplification Fix crash when reading SVG with simplify active (read --simplify or using the read APIs with simplify=True) Jun 3, 2024
Copy link

sonarqubecloud bot commented Jun 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@abey79 abey79 merged commit ce0b7cf into abey79:master Jun 3, 2024
12 checks passed
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