Skip to content

Instantly share code, notes, and snippets.

@filipkral
Created January 6, 2025 08:30
Show Gist options
  • Save filipkral/77b5d2e9cd732998f644614fb8cd8ba5 to your computer and use it in GitHub Desktop.
Save filipkral/77b5d2e9cd732998f644614fb8cd8ba5 to your computer and use it in GitHub Desktop.
Import Polygon ESRI Shapefile to PostgreSQL database using ogr2ogr
ogr2ogr -f "PostgreSQL" -a_srs "EPSG:4326" -lco SCHEMA=<schema> PG:"host=<ip or hostname> user=<user> password=<password> dbname=<dbname>" -nlt MULTIPOLYGON -nln <table_name> <shapefile_name>.shp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment