question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when translate a point

See original GitHub issue

Expected behavior and actual behavior.

Something in the last release (1.8.3) seems to cause an error when translate a point. Working fine with polygons.

Steps to reproduce the problem.

from shapely.geometry import Point
from shapely import affinity
affinity.translate(Point(10, 10), 50, 50)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/t/venv/lib/python3.8/site-packages/shapely/affinity.py", line 264, in translate
    return affine_transform(geom, matrix)
  File "/tmp/t/venv/lib/python3.8/site-packages/shapely/speedups/__init__.py", line 73, in affine_transform
    return _speedups.affine_transform(geom, matrix)
  File "shapely/speedups/_speedups.pyx", line 521, in shapely.speedups._speedups.affine_transform
  File "shapely/speedups/_speedups.pyx", line 553, in shapely.speedups._speedups.affine_transform
TypeError: an integer is required

Env

Ubuntu 20.04 Shapely version: 1.8.3

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jorisvandenbosschecommented, Aug 17, 2022

So the underlying reason here is that _geom / __geom__ no longer is an int:

In [3]: Point(10, 10).__geom__
Out[3]: <shapely.ctypes_declarations.LP_GEOSGeom_t at 0x7fbcf08ce5c0>

We are seeing similar problems in geopandas (with conversion to pygeos): https://github.com/geopandas/geopandas/issues/2531. So ideally we would solve this by changing __geom__ back to an int, and not by updating our internal code to deal with the changed return value.

1reaction
sgilliescommented, Aug 17, 2022

Resolved by #1487. @johnnv1 @jorisvandenbossche new distributions are uploading to PyPI now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Translating Points - YouTube
Translating Points. 3.3K views 9 years ago Algebra II · Keith Mann. Keith Mann. 1.02K subscribers. Subscribe. Like. I like this.
Read more >
Example translating points - YouTube
Khan Academy's mission is to provide a free, world-class education for anyone, anywhere. Our platform offers free high-quality, standards- ...
Read more >
How to Move (Translate) a Point on a Graph Math Help
VIEW ENTIRE PLAYLIST: http://www.youtube.com/view_play_list?p=0D2E061A2AF3327C If this helps, please leave a comment and subscribe!
Read more >
Translations 4.1 - Big Ideas Math
The point (x, y) is translated a units horizontally and b units vertically. Write a rule ... ERROR ANALYSIS Describe and correct the...
Read more >
Explanation of Error Categories
A grammar error occurs when a sentence in the translation violates the grammatical rules of the target language. Grammar errors include lack of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found