{"id":16752413,"url":"https://github.com/whizsid/osm-to-sql","last_synced_at":"2025-10-08T21:44:35.500Z","repository":{"id":98598744,"uuid":"211938039","full_name":"whizsid/osm-to-sql","owner":"whizsid","description":"A command line tool to convert XML open street map data to SQL.","archived":false,"fork":false,"pushed_at":"2020-07-15T20:04:47.000Z","size":63,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-08T14:46:59.932Z","etag":null,"topics":["cli","foreign-key-constraints","osm","pinned","sql-files"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whizsid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-09-30T19:22:49.000Z","updated_at":"2023-07-20T01:51:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9f19785-fec1-4bf2-9dfa-7f5cdecb6646","html_url":"https://github.com/whizsid/osm-to-sql","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/whizsid/osm-to-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizsid%2Fosm-to-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizsid%2Fosm-to-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizsid%2Fosm-to-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizsid%2Fosm-to-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whizsid","download_url":"https://codeload.github.com/whizsid/osm-to-sql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whizsid%2Fosm-to-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000703,"owners_count":26082837,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","foreign-key-constraints","osm","pinned","sql-files"],"created_at":"2024-10-13T02:46:56.149Z","updated_at":"2025-10-08T21:44:35.471Z","avatar_url":"https://github.com/whizsid.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# osm-to-sql\n\n---\n![AUR version](https://img.shields.io/aur/version/osm-to-sql)\n![GitHub](https://img.shields.io/github/license/whizsid/osm-to-sql)\n![Travis CI](https://travis-ci.org/whizsid/osm-to-sql.svg?branch=master)\n\n---\n\nSimple OSM XML data to SQL converter command. This command will create 7 SQL files with foreign key constraints. You can use these SQL files with MySQL/ SQLite or any other SQL server.\n\n## Installation\n\nCurrently only supporting to linux distros.\n\n### Arch Based Distros\n\nInstall it from arch user repository.\n\n```\nyaourt -S osm-to-sql\n```\n\n### Debian Based Distros\n\nDownload the `.deb` file from [here](https://github.com/whizsid/osm-to-sql/releases/download/0.1.3/osm-to-sql_0.1.3_amd64.deb) and install it using `dpkg`.\n\n```\ndpkg -i ./osm-to-sql_0.1.3_amd64.deb\n```\n\n## Other Distros\n\nDownload the standalone binary file from [here](https://github.com/whizsid/osm-to-sql/releases/download/0.1.3/osm-to-sql) and run it.\n\n## Usage\n\nThis is the default help menu for the command line tool.\n\n```\n\nUsage:\n    osm-to-sql [OPTIONS] -i \u003cxml_file_path.xml\u003e -d \u003coutput_directory\u003e\n\nOPTIONS:\n    -i        Input open street map file in XML format.\n    -d        Output directory to save output sql files.\n    -r        Maximum rows per one SQL insert query. [400]\n    -h        Prints help information\n    -g        Do not use INSERT IGNORE queries\n\n```\n\n## Table mappings\n\nAll tables have foreign key constraints and all tables will creating automatically with these SQL files. And please import with the following order when you importing to your database server.\n\n```\n    1.nodes\n        id,lat,lng,version,changeset,user,uid,visible,date_time\n\n    2.ways\n        id,version,changeset,user,uid,visible,date_time\n\n    3.way_nodes\n        way_id,node_id\n            -- way_id = ways(id)\n            -- node_id = nodes(id)\n\n    4.relations\n        id,version,changeset,user,uid,visible,date_time\n\n    5.relation_members\n        rm_id,relation_id,node_id,way_id,role\n            -- relation_id = relations(id)\n            -- node_id = nodes(id)\n            -- way_id = ways(id)\n            -- sub_relation_id = relations(id)\n\n    6.tags\n        id,name\n\n    7.ref_tags\n        rt_id,tag_id,node_id,relation_id,way_id,value\n            -- tag_id = tags(id)\n            -- node_id = nodes(id)\n            -- relation_id = relations(id)\n            -- way_id = ways(id)\n \n```\n\nSample output files in the `sample/output` folder.\n\n## Contirbutions\n\nAll contibutions and issues are welcome. Please help me to make this tool faster and powerfull.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhizsid%2Fosm-to-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhizsid%2Fosm-to-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhizsid%2Fosm-to-sql/lists"}