我在firestore中有地质点域。 我希望能够将地质点转换回latlng。 在firestore文档中,.getLatitude()和getLatitude()应该可以实现这一功能。 但这似乎不适用于Python。我不断得到错误:
print(geopoint.getLatitude())
AttributeError: 'GeoPoint' object has no attribute 'getLatitude'
如何在Python中获取地质点值
geopoint = field['location']
print(geopoint.getLatitude())
print(geopoint.getLongitude())
正如@spmaddox提到的,对于Python,get方法不是必需的。 因此,以下工作:
GeoPoint具有经度和纬度属性,请参考这些属性,而不是您正在使用的方法
相关问题 更多 >
编程相关推荐