Skip to content

Instantly share code, notes, and snippets.

@alexcpn
Created February 2, 2024 15:28
Show Gist options
  • Save alexcpn/ea3925bb30b842e183d67f6fd19e69bf to your computer and use it in GitHub Desktop.
Save alexcpn/ea3925bb30b842e183d67f6fd19e69bf to your computer and use it in GitHub Desktop.
Plot via shapely
from pyproj import Geod
n_extra_points = 800
accesspoint_loc =(38.377266, -78.468021)
receiver_loc=(37.78341666666667, -78.49219444444445)
lon0, lat0 = accesspoint_loc[::-1]
lon1, lat1 = receiver_loc[::-1]
geoid = Geod(ellps="WGS84")
extra_points = geoid.npts(lon0, lat0, lon1, lat1, n_extra_points)
#print(extra_points)
import geopandas as gpd
from geojson import Point as GeoPoint
# write these points out
geo_points =[]
for item in extra_points:
point1 = GeoPoint(item)
geo_points.append(point1)
gdf = gpd.GeoDataFrame({'geometry': geo_points},
crs='EPSG:4269')
# # Save the GeoDataFrame to a shapefile
# # Save the GeoDataFrame to a shapefile
gdf.to_file('sip2_800points.shp')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment