Question: I need help figuring out where an error comes from in my python code. Includes OOP. R = position1.get_geometry().get_units().get_measure() position1 is an instance of a

I need help figuring out where an error comes from in my python code. Includes OOP. 

R = position1.get_geometry().get_units().get_measure()

position1 is an instance of a class

get_geometry() is a method of position1's class that returns an instance of another class

get_units() is a method of the class returned in the previous line that returns an instance of another class

get_measure is a method of the class returned in the previous line that returns an attribute of this final class.

This is the error:

Traceback (most recent call last): File "C:/Users/cdd77/PycharmProjects/LA3/main.py", line 11, in LA3Main.main() File "C:/Users/cdd77/PycharmProjects/LA3/main.py", line 8, in main Application.Application.run_example() File "C:\Users\cdd77\PycharmProjects\LA3\Package1\Application.py", line 51, in run_example print('Distance between position 1 and position 2 is:', kalamazoo.distance(pos2), File "C:\Users\cdd77\PycharmProjects\LA3\Package2 ew_position.py", line 130, in distance return self.geometry.curry_distance(self, position2) File "C:\Users\cdd77\PycharmProjects\LA3\Package2 ew_position.py", line 34, in curry_distance R = position1.get_geometry().get_units().get_measure() AttributeError: 'NoneType' object has no attribute 'get_measure'

I'm not sure how this error got here or how to resolve it. If you need more information please tell me.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!