# osm-comments-parser **Repository Path**: mirrors_mapbox/osm-comments-parser ## Basic Information - **Project Name**: osm-comments-parser - **Description**: Parsers to read Notes and Changeset XML files and save them in a Postgres DB - **Primary Language**: Unknown - **License**: ISC - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2025-12-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![CircleCI](https://circleci.com/gh/mapbox/osm-comments-parser.svg?style=svg)](https://circleci.com/gh/mapbox/osm-comments-parser) ### Notes and comments parser Reads XML files and saves into database. ### Setup Run `npm install` Setup database: createdb psql < scripts/create_tables.sql The following command adds indexes to the database, making it much more swift to query. You can add them right after the setup of the database, or perform this after the initial data loading (see below) for better performance during the import. psql < scripts/create_indexes.sql Setup environment variables required for the project: export OSM_COMMENTS_POSTGRES_URL='postgres://@localhost/osm-comments' export OSM_COMMENTS_TEST_POSTGRES_URL='postgres://username@localhost/osm-comments-test' ### Run In a node shell: var notesParser = require('./notes'); notesParser({filename: '/path/to/notes-xml'}); var changesetParser = require('./changesets'); changesetParser({filename: '/path/to/changeset-xml'}); From the terminal: node index.js --filename=/path/to/xml/file ### Test Run `npm test` ### Initial load of changesets When starting out with an empty database, there is an optimized way to load the initial backlog of changesets. Create an empty folder called `csv` in the project root and pass the option: `initial=true` changesetParser. After this command is run, run `psql < changesets/post_initial.sql` to load the CSVs into the database. FIXME: this should be scripted.