MCPcopy
hub / github.com/microsoft/GlobalMLBuildingFootprints / main

Function main

scripts/make-gis-friendly.py:11–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9from shapely.geometry import shape
10
11def main():
12 # this is the name of the geography you want to retrieve. update to meet your needs
13 location = 'Greece'
14
15 dataset_links = pd.read_csv("https://minedbuildings.z5.web.core.windows.net/global-buildings/dataset-links.csv")
16 greece_links = dataset_links[dataset_links.Location == location]
17 for _, row in greece_links.iterrows():
18 df = pd.read_json(row.Url, lines=True)
19 df['geometry'] = df['geometry'].apply(shape)
20 gdf = gpd.GeoDataFrame(df, crs=4326)
21 gdf.to_file(f"{row.QuadKey}.geojson", driver="GeoJSON")
22
23
24if __name__ == "__main__":

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected