-
-
Save johnwbryant/06b504e2cfb4044c5216a1627ccc6180 to your computer and use it in GitHub Desktop.
#!/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 |
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?
AUS.geojson file has only text: Binary file Oceania-Full.zip matches
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!!!
Yep, it produces Newline-delimited GeoJSON
Try this:
NB: you have to delete manually the very last comma at the end of the file before the closing "]}" (or enhance the script)
you can check the result here: https://geojson.io/
it also says if there are any syntax errors and what they are. If you succeed there but still cannot open or convert it in QGIS, then download / save GEOJSON file from there and try to open / covert that one.