Created
February 2, 2024 15:28
-
-
Save alexcpn/ea3925bb30b842e183d67f6fd19e69bf to your computer and use it in GitHub Desktop.
Plot via shapely
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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