Skip to content

Instantly share code, notes, and snippets.

@johnwbryant
Last active September 17, 2024 01:18
Show Gist options
  • Save johnwbryant/06b504e2cfb4044c5216a1627ccc6180 to your computer and use it in GitHub Desktop.
Save johnwbryant/06b504e2cfb4044c5216a1627ccc6180 to your computer and use it in GitHub Desktop.
Extract Australia data in a usable format from Microsoft road detections data
#!/bin/bash
# see https://github.com/microsoft/RoadDetections
# 1) get the data
wget https://usaminedroads.blob.core.windows.net/road-detections/Oceania-Full.zip
# 2) extract the records for Australia, second column of tsv only
zgrep AUS Oceania-Full.zip | cut -f2 > AUS.geojson
# 3) convert to GPKG, works better in QGIS
ogr2ogr -f GPKG Oceania_AUS.gpkg AUS.geojson
@JamshidSod
Copy link

when running the following code ogr2ogr -f GPKG Oceania_AUS.gpkg AUS.geojson
FAILURE:
Unable to open datasource AUS.geojson' with the following drivers. -> FITS'
-> PCIDSK' -> netCDF'
-> PDS4' -> VICAR'
-> JP2OpenJPEG' -> PDF'
-> MBTiles' -> BAG'
-> EEDA' -> OGCAPI'
-> ESRI Shapefile' -> MapInfo File'
-> UK .NTF' -> LVBAG'
-> OGR_SDTS' -> S57'
-> DGN' -> OGR_VRT'
-> Memory' -> CSV'
-> NAS' -> GML'
-> GPX' -> KML'
-> GeoJSON' -> GeoJSONSeq'
-> ESRIJSON' -> TopoJSON'
-> Interlis 1' -> Interlis 2'
-> OGR_GMT' -> GPKG'
-> SQLite' -> ODBC'
-> WAsP' -> PGeo'
-> MSSQLSpatial' -> PostgreSQL'
-> OpenFileGDB' -> DXF'
-> CAD' -> FlatGeobuf'
-> Geoconcept' -> GeoRSS'
-> VFK' -> PGDUMP'
-> OSM' -> GPSBabel'
-> OGR_PDS' -> WFS'
-> OAPIF' -> EDIGEO'
-> SVG' -> Idrisi'
-> XLS' -> ODS'
-> XLSX' -> Elasticsearch'
-> Carto' -> AmigoCloud'
-> SXF' -> Selafin'
-> JML' -> PLSCENES'
-> CSW' -> VDV'
-> GMLAS' -> MVT'
-> NGW' -> MapML'
-> Parquet' -> Arrow'
-> TIGER' -> AVCBin'
-> AVCE00' -> HTTP'
Could you please help with that?

@JamshidSod
Copy link

AUS.geojson file has only text: Binary file Oceania-Full.zip matches

@mykol404
Copy link

How would I run this to convert a full dataset (such as South America) without extracting a country? I played around with the command and cannot figure it out. Any help would be tremendously appreciated!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment