libpysal.cg.lonlat

libpysal.cg.lonlat(pointslist)[source]

Converts point order from lat-lon tuples to lon-lat (x,y) tuples.

Parameters
pointslistlist

A list of lat-lon tuples. This must be a list, even for one point.

Returns
newptslist

A list with tuples of points in lon-lat order.

Examples

>>> points = [
...     (41.981417, -87.893517), (41.980396, -87.776787), (41.980906, -87.696450)
... ]
>>> newpoints = lonlat(points)
>>> newpoints
[(-87.893517, 41.981417), (-87.776787, 41.980396), (-87.69645, 41.980906)]