![]() ![]() Next, we use a lambda function to convert our point geometries into a series of strings. #Read input file into a GeoDataFrame gdf = gpd.read_file(pth_join(data_root,input_file)) gdf_wgs = gdf.to_crs( "EPSG:4326" ) Next, we have to reproject our dataset into WGS84, which is the geographic coordinate system used by the API. ![]() ![]() First, we will load our input file (a shapefile of prescribed burn locations in Oregon) into a GeoDataFrame. Now that we have all of our constants configured, let’s get to work. Request_str = "%s/%s?locations=%s&key=%s"ĭata_root = "/Users/airsci/git/wrap-cmfd/CM_data" Key_str = "GFVerAfCoyBsdfPD7nnW8QQC7ZZt5ytKiCO4e3Zu" import matplotlib.pyplot as plt import geopandas as gpd import requests from shapely.geometry import Point from os.path import join as pth_join import json import time You’ll need to paste in your own API key, which you can set up by following these instructions. So let’s set up everything we’ll need to make a request to the API, including importing the packages, defining request strings, and sourcing input data. To run the code below, you’ll first need to set up your Python environment, which for this example uses the following: This post assumes you have some working knowledge of scripting, and introduces some very powerful, open-source tools for manipulating spatial data. Altitude geometry example how to#Here, we’ll go over how to do the same thing using Python. We recently wrote a post about a handy Excel workbook you can use to query elevations for a set of coordinates in the Google Maps Application Programming Interface (API). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |