{"id":19010877,"url":"https://github.com/osmcode/osm-postgresql-experiments","last_synced_at":"2025-04-22T23:23:03.438Z","repository":{"id":53602735,"uuid":"171168738","full_name":"osmcode/osm-postgresql-experiments","owner":"osmcode","description":"Experimental code for importing OSM data into PostgreSQL/PostGIS","archived":false,"fork":false,"pushed_at":"2023-08-22T07:07:07.000Z","size":340,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T14:39:03.306Z","etag":null,"topics":["openstreetmap","postgis","postgresql"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osmcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-02-17T20:29:23.000Z","updated_at":"2024-10-14T10:23:52.000Z","dependencies_parsed_at":"2025-04-17T04:27:57.451Z","dependency_job_id":"96f6c422-e3f6-4f41-92b7-a725b3e18eba","html_url":"https://github.com/osmcode/osm-postgresql-experiments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmcode%2Fosm-postgresql-experiments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmcode%2Fosm-postgresql-experiments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmcode%2Fosm-postgresql-experiments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osmcode%2Fosm-postgresql-experiments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osmcode","download_url":"https://codeload.github.com/osmcode/osm-postgresql-experiments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250338614,"owners_count":21414216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openstreetmap","postgis","postgresql"],"created_at":"2024-11-08T19:12:46.370Z","updated_at":"2025-04-22T23:23:03.419Z","avatar_url":"https://github.com/osmcode.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# OSM-PostgreSQL-Experiments\n\nThis is some experimental code for importing OSM data into a PostgreSQL/PostGIS\ndatabase. It is meant as a super-flexible tool for advanced OSM and database\nusers who know the ins and outs of the OSM data model and as a test bed for\nimplementing new ideas in getting OSM data into PostgreSQL/PostGIS. This is\ndefinitely not a tool for casual users.\n\nThis program doesn't actually talk to the PostgreSQL database. Instead it\ncreates files in the PostgreSQL COPY format containing the data and SQL files\nwith the commands to create the tables and import the data. This allows you to\nchange anything or add extra steps anywhere along the import process giving you\neven more flexibility.\n\n## Prerequisites\n\nYou need a C++ compiler with support for C++14.\n\nYou need the following libraries:\n\n* [Libosmium](https://osmcode.org/libosmium/)\n* [Protozero](https://github.com/mapbox/protzero/)\n* [expat](https://libexpat.github.io/)\n* [bzip2](http://www.bzip.org/)\n* [zlib](https://www.zlib.net/)\n* [Boost libraries](https://www.boost.org/)\n* [fmt](https://github.com/fmtlib/fmt)\n\n\n## Build\n\n```\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n## Usage\n\nGenerally you call it as: `ope [OPTIONS] OSMFILE OUTPUT-TABLE...`.\n\nUse `src/ope --help` to get usage information and a list of options.\n\nData is read from `OSMFILE` and written to one or more output tables. Each\noutput table is specified using the format `FILENAME=STREAM%COLUMNS`. The\n`FILENAME` is the filename to be used. If it doesn't have a suffix, `.pgcopy`\nis used. A file with suffix `.sql` is also written containing the data\ndefinitions used.\n\nThe `STREAM` defines what kind of data should be written into the table. It can\nbe one of the following:\n\n* o: objects (nodes, ways, and relations)\n* n: nodes\n* w: ways\n* r: relations\n* a: areas\n* oT: tags from all objects\n* nT: tags from nodes\n* wT: tags from ways\n* rT: tags from relation\n* wN: nodes from ways\n* rM: members from relations\n* u: users\n* c: changesets\n* cT: tags from changesets\n* cC: comments from changesets\n\nThe `COLUMNS` define the columns to be written out. Each column is specified\nby two characters, the first specifies the column type, the second the format.\nFor instance `I.` creates an object id (`I`) column in the default format (`.`)\nwhich is a BIGINT. Some column types only have a single format, others allow\nmultiple formats.\n\nLook for `column_config` in `src/table.cpp` to see all column types/formats.\n\nIf the `COLUMNS` is not specified a default for this stream is used. The\ndefault depends on whether the `--with-history/-H` flag is used or not.\n\nThe \"users\" stream is somewhat special. It will generate a row for each unique\nuser id encountered while generating any of the other tables specified. This\nallows you to have user ids in all tables and a lookup table to get the user\nnames from these.\n\n## Command line options\n\n* `-f, --filter FILTER`: Only import data that matches the filter expresssion.\n  Currently the only supported filter is `with-tags`, ie. objects without\n  tags are ignored.\n* `-h, --help`: Show usage information.\n* `-v, --verbose`: Enable verbose mode.\n* `-H, --with-history`: The input file contains history data, ie. there can\n  be several versions of the same object in it.\n\n## License\n\nCopyright (C) 2020  Jochen Topf (jochen@topf.org)\n\nThis program is available under the GNU GENERAL PUBLIC LICENSE Version 3.\nSee the file LICENSE.txt for the complete text of the license.\n\n\n## Authors\n\nThis program was written and is maintained by Jochen Topf (jochen@topf.org).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmcode%2Fosm-postgresql-experiments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosmcode%2Fosm-postgresql-experiments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosmcode%2Fosm-postgresql-experiments/lists"}