Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Last active March 8, 2022 16:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/1970e4edea19c463e0daf68bbad5f587 to your computer and use it in GitHub Desktop.
Save ThomasG77/1970e4edea19c463e0daf68bbad5f587 to your computer and use it in GitHub Desktop.
Consommation à distance du Geopackage BDTOPO France entière Sept 2021 - 83Go

GDAL VSICURL tests to remote BDTOPO Geopackage France

# MultiPolygon output
ogr2ogr -f GeoJSON /tmp/mairies_multipolygons.geojson "/vsicurl/https://labs.webgeodatavore.com/partage/bdtopo.gpkg" \
        -lco RFC7946=YES \
        -sql "SELECT code_insee, nom_officiel, liens_vers_autorite_administrative, zone_d_activite_ou_d_interet.* FROM commune LEFT JOIN zone_d_activite_ou_d_interet ON liens_vers_autorite_administrative = zone_d_activite_ou_d_interet.cleabs"

# Point output
ogr2ogr -f GeoJSON /tmp/mairies_points.geojson "/vsicurl/https://labs.webgeodatavore.com/partage/bdtopo.gpkg" \
        -lco RFC7946=YES \ 
        -sql "SELECT code_insee, nom_officiel, liens_vers_autorite_administrative, zone_d_activite_ou_d_interet.cleabs, categorie, nature, nature_detaillee, toponyme, statut_du_toponyme, importance, fictif, etat_de_l_objet, zone_d_activite_ou_d_interet.date_d_apparition, zone_d_activite_ou_d_interet.date_de_confirmation, sources, identifiants_sources, precision_planimetrique, zone_d_activite_ou_d_interet.date_modification, zone_d_activite_ou_d_interet.date_creation, ST_PointOnSurface(zone_d_activite_ou_d_interet.geometrie) AS geom FROM commune LEFT JOIN zone_d_activite_ou_d_interet ON liens_vers_autorite_administrative = zone_d_activite_ou_d_interet.cleabs"
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment