开发者

How to find lat long values from the POINT

开发者 https://www.devze.com 2023-01-27 04:42 出处:网络
i have Point value which is POINT(24.3 80.2) which is stored in variable pnt I want to have the lat and long values seperately. is there any simple way to get that using python

i have Point value which is POINT(24.3 80.2) which is stored in variable pnt

I want to have the lat and long values seperately. is there any simple way to get that using python

POINT he开发者_Go百科re is geographical location which meanse POINT(longitude latitude)


[Edit: Ignacio Vazquez-Abrams is spot on!]

You are using geos django.

Check out the docs.

>>> pnt = Point(5, 23)
>>> [coord for coord in pnt]
[5.0, 23.0]
>>> pnt.coords
(5.0, 23.0)

The following is not relevant but can be used. Kept for other references.

Check out the following project : pyproj

  • http://pypi.python.org/pypi/pyproj/
  • http://code.google.com/p/pyproj/

Module can performs cartographic transformations and geodetic computations.

The Proj class can convert from geographic (longitude,latitude) to native map projection (x,y) coordinates and vice versa, or from one map projection coordinate system directly to another.

and much more.

Also check out : geojson

  • http://pypi.python.org/pypi/geojson/1.0.1
  • http://sgillies.net/blog/815/geojson-and-pyproj-interop/
0

精彩评论

暂无评论...
验证码 换一张
取 消