Convert a CSV file into a GeoPackage, specifying the names of the coordinate columns and assigning a coordinate reference system

ogr2ogr

  • Convert geospatial vector data between file formats.
    More information: <https://gdal.org/programs/ogr2ogr.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

ogr2ogr -f GPKG {{path/to/output}}.gpkg {{path/to/input}}.csv -oo X_POSSIBLE_NAMES={{longitude}} -oo Y_POSSIBLE_NAMES={{latitude}} -a_srs {{EPSG:4326}}

click the source code to copy install ogr2ogr on any operating system with command-not-found.com