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 : tuple¶
The first point decimal degrees.
- p1 : tuple¶
The second point decimal degrees.
- t : float¶
The proportion along great circle distance between
p0andp1(e.g., \(\mathtt{t}=0.5\) would find the mid-point).- lonx : bool¶
The method to assess the order of the coordinates.
Truefor (lon,lat);Falsefor (lat,lon). Default isTrue.
- Returns:¶
newpx, newpy – The new point in decimal degrees of (lon-lat) by default or (lat-lon) if
lonxis set toFalse.- Return type:¶
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)