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.

Argument confusion when constructing a Polygon

See original GitHub issue

When trying to create a polygon, works fine with the coords argument by itself, but when adding an extra keyword argument, such as geodesic, it throws an error:

EEException: Projection: Argument ‘crs’: Invalid type. Expected: String. Actual: Type<Boolean>.

I think the issue may come from https://github.com/google/earthengine-api/blob/ba57b055e1db6e0839ea9a26149e78c13ab5a73b/python/ee/geometry.py#L703 and https://github.com/google/earthengine-api/blob/ba57b055e1db6e0839ea9a26149e78c13ab5a73b/python/ee/geometry.py#L585

When you don’t specify an argument, it gets the value of _UNSPECIFIED, so the function _GetSpecifiedArgs trims that argument, and as _parseArgs parses parameters by position, it misparse them. That is what I think is happening.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tylerecommented, Nov 25, 2019

It is still an open bug, but you can work around it by specifying proj=None.

test = ee.Geometry.Polygon(
              coords=[[0,0],[1,1],[2,2],[3,3]], 
              geodesic=True,
              proj=None)
print(test.getInfo())
0reactions
jerubiocommented, Nov 25, 2019

Thank you!!

El lun., 25 de nov. de 2019 a la(s) 14:48, Tyler Erickson ( notifications@github.com) escribió:

It is still an open bug, but you can work around it by specifying proj=None.

test = ee.Geometry.Polygon( coords=[[0,0],[1,1],[2,2],[3,3]], geodesic=True, proj=None) print(test.getInfo())

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/earthengine-api/issues/76?email_source=notifications&email_token=ALJLLRXLZ3LO7C3SQKXZNQ3QVQFWTA5CNFSM4GUOU6W2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFDHOGY#issuecomment-558266139, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJLLRRTAT2B6LJSKZTTJBDQVQFWTANCNFSM4GUOU6WQ .

– Jorge R

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tkinter Canvas polygon object issues - python - Stack Overflow
When the create_polygon method asks for an even number of arguments, why not provide an even number? The create_polygon method takes ...
Read more >
Confusion regarding TopoJSON polygon coordinates
I have a TopoJSON file which represents a hexagon. A hexagon has 6 vertices, so I was expecting the arcs attribute of TopoJSON...
Read more >
The Curious Case of Convexity Confusion - Project Zero
A concave polygon is a polygon that is not convex. ... functions we can call with a path object as an argument do...
Read more >
Construction of regular polygons - DynamicsOfPolygons.org
A constructible regular polygon is one that can be constructed with compass and (unmarked) straightedge. For example the construction on the right below ......
Read more >
Polygon - Wikipedia
A simple polygon is one which does not intersect itself. Mathematicians are often concerned only with the bounding polygonal chains of simple polygons...
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