使用 django 和 postgis 的 3 维 GiS 数据
我可以在我当前的项目中使用第三维,该项目强烈涉及谷歌地图和 django。 我该如何处理这个问题?
class Waypoint(models.Model):
latlng = models.PointField()
>>> p = Point( 5, 10, 20)
<Point object at Ox...>
>>> p.kml
'<Point><coordinates>5.0,10.0,20.0</coordinates></Point>'
>>> w = Waypoint.objects.all()[0]
<Waypoint: Waypoint object>
>>> w.latlng = p
>>> w.latlng.kml
'<Point><coordinates>5.0,10.0,20.0</coordinates></Point>'
>>> w.save()
>>> w = Waypoint.objects.all()[0]
<Waypoint: Waypoint object>
>>> w.latlng.kml
'<Point><coordinates>5.0,10.0,0</coordinates></Point>'
^
注意第三维被忽略。 咕噜!
I could use a third dimension in my current project, which strongly involves google-maps and django. How do I deal with this?
class Waypoint(models.Model):
latlng = models.PointField()
>>> p = Point( 5, 10, 20)
<Point object at Ox...>
>>> p.kml
'<Point><coordinates>5.0,10.0,20.0</coordinates></Point>'
>>> w = Waypoint.objects.all()[0]
<Waypoint: Waypoint object>
>>> w.latlng = p
>>> w.latlng.kml
'<Point><coordinates>5.0,10.0,20.0</coordinates></Point>'
>>> w.save()
>>> w = Waypoint.objects.all()[0]
<Waypoint: Waypoint object>
>>> w.latlng.kml
'<Point><coordinates>5.0,10.0,0</coordinates></Point>'
^
Note third diemsnion is ignored. GRRR!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论