|
10 | 10 |
|
11 | 11 | NLDI_API_BASE_URL = 'https://labs.waterdata.usgs.gov/api/nldi/linked-data' |
12 | 12 | _AVAILABLE_DATA_SOURCES = None |
| 13 | +_CRS = "EPSG:4326" |
13 | 14 |
|
14 | 15 |
|
15 | 16 | def _query_nldi(url, query_params, error_message): |
@@ -101,7 +102,7 @@ def get_flowlines( |
101 | 102 | feature_collection = _query_nldi(url, query_params, err_msg) |
102 | 103 | if as_json: |
103 | 104 | return feature_collection |
104 | | - gdf = gpd.GeoDataFrame.from_features(feature_collection) |
| 105 | + gdf = gpd.GeoDataFrame.from_features(feature_collection, crs=_CRS) |
105 | 106 | return gdf |
106 | 107 |
|
107 | 108 |
|
@@ -154,7 +155,7 @@ def get_basin( |
154 | 155 | feature_collection = _query_nldi(url, query_params, err_msg) |
155 | 156 | if as_json: |
156 | 157 | return feature_collection |
157 | | - gdf = gpd.GeoDataFrame.from_features(feature_collection) |
| 158 | + gdf = gpd.GeoDataFrame.from_features(feature_collection, crs=_CRS) |
158 | 159 | return gdf |
159 | 160 |
|
160 | 161 |
|
@@ -291,7 +292,7 @@ def get_features( |
291 | 292 | feature_collection = _query_nldi(url, query_params, err_msg) |
292 | 293 | if as_json: |
293 | 294 | return feature_collection |
294 | | - gdf = gpd.GeoDataFrame.from_features(feature_collection) |
| 295 | + gdf = gpd.GeoDataFrame.from_features(feature_collection, crs=_CRS) |
295 | 296 | return gdf |
296 | 297 |
|
297 | 298 |
|
@@ -322,7 +323,7 @@ def get_features_by_data_source(data_source: str) -> gpd.GeoDataFrame: |
322 | 323 | url = f'{NLDI_API_BASE_URL}/{data_source}' |
323 | 324 | err_msg = f"Error getting features for data source '{data_source}'" |
324 | 325 | feature_collection = _query_nldi(url, {}, err_msg) |
325 | | - gdf = gpd.GeoDataFrame.from_features(feature_collection) |
| 326 | + gdf = gpd.GeoDataFrame.from_features(feature_collection, crs=_CRS) |
326 | 327 | return gdf |
327 | 328 |
|
328 | 329 |
|
|
0 commit comments