https://github.com/Xetnus/osm-finder Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + By Plan + Enterprise + Teams + Compare all + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} Xetnus / osm-finder Public * Notifications * Fork 1 * Star 44 A "line-network" geolocation tool created for Bellingcat's September 2022 Hackathon: https://www.bellingcat.com/resources/2022/10/06/ automated-map-searches-scam-busting-tools-and-twitter-search-translations-here-are-the-results-of-bellingcats-second-hackathon / License MIT license 44 stars 1 fork Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights Xetnus/osm-finder This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 2 branches 1 tag Code * Clone HTTPS GitHub CLI [https://github.com/X] Use Git or checkout with SVN using the web URL. [gh repo clone Xetnus] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @Xetnus Xetnus Heroku support, README additions, minor UI changes ... fbc699c Sep 30, 2022 Heroku support, README additions, minor UI changes fbc699c Git stats * 28 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time static Heroku support, README additions, minor UI changes Sep 30, 2022 .gitignore Add Heroku support Sep 29, 2022 LICENSE Add MIT license Sep 25, 2022 Procfile Heroku support, README additions, minor UI changes Sep 30, 2022 README.md Heroku support, README additions, minor UI changes Sep 30, 2022 app.py Add Heroku support Sep 29, 2022 flex.lua Add partial intersection query code Sep 25, 2022 index.html Heroku support, README additions, minor UI changes Sep 30, 2022 package-lock.json Add Heroku support Sep 29, 2022 package.json Heroku support, README additions, minor UI changes Sep 30, 2022 requirements.txt Add Heroku support Sep 29, 2022 View code [ ] osm-finder The UI is now accessible from anywhere on Heroku: https:// osm-finder.herokuapp.com/ Tool Description Installation I. Install and Configure Postgres Backend II. Install Frontend Usage Next Steps README.md osm-finder The UI is now accessible from anywhere on Heroku: https:// osm-finder.herokuapp.com/ Tool Description One of the most prominent tools that assists in geolocating images using openstreetmap data is Overpass Turbo. This requires learning and using the Overpass Query Language and restricts your geolocation abilities to only what's permitted by the query language. This tool attempts to make it easier for researchers to find locations with a simple click-and-drag interface. No need to learn a new query language. It also adds capabilities not present in existing tools, like the ability to search by the angle between roads, power lines, and railways. This tool currently supports all highway, railway, and a couple power line (namely, 'line' and 'minor_line') types. When in doubt, it's always safer to enter larger/wider parameters than you think is needed (e.g., enter an angle of 25 +/- 20 instead of 25 +/- 5). Works best on images with unique intersections. If there are any tags you can enter (e.g. bridge=yes, tunnel=yes), you'll decrease the size of the results significantly. Tested on Ubuntu 22.04.1 LTS. Installation Instructions below are for Linux. I. Install and Configure Postgres Backend 1. Ensure you have PostGIS installed, and then install osm2pgsql version 1.7.0 or higher. Note: On Ubuntu and Fedora, this requires building from source (as of Sep 25). + To install on Linux using a package manager: https:// osm2pgsql.org/doc/install.html#installing-on-linux + To install on Windows using prebuilt binaries: https:// osm2pgsql.org/doc/install.html#installing-on-windows + To install on Ubuntu, follow Building instructions: https:// github.com/openstreetmap/osm2pgsql 2. Download openstreetmap data for your area of interest. To follow along with the demo, download the data for Massachusetts at https://download.geofabrik.de/north-america/us.html. Click on the .osm.bz2 download. 3. Download flex.lua and run the following commands (in Linux): + Note: you may need to move files around and change directory/ file permissions appropriately to ensure that the postgres user can access massachusetts-latest.osm.bz2 and flex.lua. sudo -u postgres createuser osmuser; sudo -u postgres createdb --encoding=UTF8 --owner=osmuser osm; sudo -u postgres psql osm --command='CREATE EXTENSION postgis;'; sudo -u postgres psql osm --command='CREATE EXTENSION hstore;'; sudo -u postgres osm2pgsql -d osm -c massachusetts-latest.osm.bz2 -S flex.lua -O flex; 4. Configure your (Linux) terminal using the following commands: + Note: The interactive query terminal that opens when you run psql is what you'll use to run the PostgreSQL queries that the front-end generates. + You can confirm your database was set up correctly by running \dt. You should see four tables: closed_shapes, linestrings, points, and spatial_ref_sys. sudo su postgres psql \c osm II. Install Frontend 1. Download this project repository. git clone git@github.com:Xetnus/osm-finder.git 2. Install requirements.txt (you might want to create a venv first): pip install -r requirements.txt 3. Install paper.js: npm install paper 4. Run gunicorn app:app in project directory to start the app. Copy the URL that the command outputs and paste it into a web browser window. Usage Buttons: * Upload Photo: upload any photo you want to geolocate * Add Linestring: Click and drag to annotate a line in the image (e.g. highway, railway, power line) * Next Step: Continue through the next steps, entering the properties for the linestrings and entering any distance or angle parameters between the linestrings. Next Steps * [ ] Start from scratch. Because this was created during a hackathon, little emphasis was put on code quality and future maintenance. No standard JavaScript libraries were used and most of the code is inefficient in one way or another. Now that I have a better idea for how this tool can be architected, reconstructing it should be easier. * [ ] Add support for nodes. Towers, buildings, and nodes of all types should be supported. * [ ] Add support for shapes. Many roads, buildings, structures, etc. have unique shapes that should be queryable using carefully crafted PostgreSQL queries. * [ ] Host a public website. Depending on cost, I aim to integrate and host both the frontend (UI) and backend (PostgreSQL) on a public-facing website. About A "line-network" geolocation tool created for Bellingcat's September 2022 Hackathon: https://www.bellingcat.com/resources/2022/10/06/ automated-map-searches-scam-busting-tools-and-twitter-search-translations-here-are-the-results-of-bellingcats-second-hackathon / Resources Readme License MIT license Stars 44 stars Watchers 3 watching Forks 1 fork Releases 1 tags Packages 0 No packages published Languages * JavaScript 84.0% * Lua 10.6% * CSS 3.6% * HTML 1.4% * Other 0.4% Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.