Skip to content

This project provides a PowerShell script to import OpenStreetMap (OSM) PBF files into a PostGIS-enabled PostgreSQL database.

Notifications You must be signed in to change notification settings

bsozer06/import-pbf-to-postgis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

import-pbf-to-postgis

This project provides a PowerShell script to import OpenStreetMap (OSM) PBF files into a PostGIS-enabled PostgreSQL database.

Features

  • Imports OSM .pbf files into a PostGIS database
  • Generic and configurable for different OSM extracts and database setups
  • Automates the import process using command-line tools

Requirements

  • Windows PowerShell
  • PostgreSQL with PostGIS extension
  • osm2pgsql installed and available in your PATH
  • OSM .pbf file(s) to import

Usage

  1. Edit the script:

    • Open import_osm_generic.ps1 in a text editor.
    • Set the database connection parameters and file paths as needed.
  2. Run the script:

    • Open PowerShell in the script directory.
    • Execute:
      .\import_osm_generic.ps1
  3. Follow prompts:

    • The script may prompt for additional information or confirmation.

Configuration

  • Update variables in the script for your database host, port, user, password, database name, and the path to your OSM .pbf file.
  • Ensure osm2pgsql is installed and accessible from the command line.

Example

# Example usage in PowerShell
.\import_osm_generic.ps1

Notes

  • Make sure your PostgreSQL server is running and accessible.
  • The script may overwrite existing tables in the database.
  • For large OSM files, ensure you have enough disk space and memory.

License

MIT License

About

This project provides a PowerShell script to import OpenStreetMap (OSM) PBF files into a PostGIS-enabled PostgreSQL database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published