-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The database is no longer showing .zip files #34
Comments
Did anyone managed to work with the csv file with QGIS like we used to when it was directly GeoJSON ? |
The file contents are line delimited GeoJSON. On Windows you can do the following to extract and rename and ArGIS/QGIS will recognize: Invoke-WebRequest url.to.csv.gz -outfile local.path.to.csv.gz
7z e local.path.to.csv.gz
Move-Item local.path.to.csv local.path.to.geojsonl If you want to get all of Greece, you use a script like this and it might save some time: import pandas as pd
import geopandas as gpd
from shapely.geometry import shape
dataset_links = pd.read_csv("https://minedbuildings.blob.core.windows.net/global-buildings/dataset-links.csv")
greece_links = dataset_links[dataset_links.Location == 'Greece']
for _, row in greece_links.iterrows():
df = pd.read_json(row.Url, lines=True)
df['geometry'] = df['geometry'].apply(shape)
gdf = gpd.GeoDataFrame(df, crs=4326)
gdf.to_file(f"{row.QuadKey}.geojson", driver="GeoJSON") Edit: updated link for new location |
Those csv aren't csv, but instead json. Here's a code snippet to extract and properly rename. # url is looked up from dataset-links.csv
path = url.split('/')
gzfile = path[-1]
jsonfile = f'{gzfile[:-6]}json'
with gzip.open(gzfile, 'rb') as gz:
with open(jsonfile, 'wb') as js:
shutil.copyfileobj(gz, js)
os.remove(gzfile) |
Great code @andwoi , just add one more line to get directly shape files (.shp) just to save some time. import pandas as pd def main():
|
Hi,
I'm trying to download building footprints for Greece. There seems to no longer be .zip files and instead csv.gz files, is there a link to access GeoJSON files for Greece specifically?
When I import the JSON database into ArcGIS it only recognizes the region tiles and not the building footprint info.
Please help, thank you!
The text was updated successfully, but these errors were encountered: