libpysal.cg.geointerpolate¶
-
libpysal.cg.
geointerpolate
(p0, p1, t, lonx=True)[source]¶ Finds a point on a sphere along the great circle distance between two points on a sphere also known as a way point in great circle navigation
- Parameters
- p0
first
point
as
a
python:tuple
in
decimal
degrees
- p1
second
point
as
a
python:tuple
in
decimal
degrees
- t
proportion
along
great
circle
distance
between
p0
and
p1
e.g., t=0.5 would find the mid-point
- lonxbool
to
assess
the
order
of
the
coordinates, for lon,lat (default) = True, for lat,lon = False
- p0
- Returns
- x,y
python:tuple
in
decimal
degrees
of
lon-lat (default
)or
lat-lon, depending on setting of lonx; in other words, the same order is used as for the input
- x,y
Examples
>>> p0 = (-87.893517, 41.981417) >>> p1 = (-87.519295, 41.657498) >>> geointerpolate(p0,p1,0.1) # using lon-lat (-87.85592403438788, 41.949079912574796) >>> p3 = (41.981417, -87.893517) >>> p4 = (41.657498, -87.519295) >>> geointerpolate(p3,p4,0.1,lonx=False) # using lat-lon (41.949079912574796, -87.85592403438788)