albva, mlkin
Inspired by OSM Finder, SketchMapper allows users to search for locations based on sketches of buildings, streets and vegetation. Internally, it transforms OpenStreetMap data into an graph of adjacent spatial objects, additionally considering various features such as the relative size of geometries, distances and angles between objects. Given the user's input, the scenes with the least percentage deviation from the provided sketch are returned.
The software consists of a data importer, an API and a visual interface.
You need access to a Neo4j database where the data was previously imported in, as well as a vector map tiles URL (e.g. from MapTiler). The .env file should have the following entries: VITE_API_URL, VITE_API_KEY, VITE_TILES_URL
-
Open the terminal and run:
git clone https://github.com/mlkin/sketchmapper.git && cd sketchmapper
-
Install and run the server:
cd server && npm install && npm run dev
-
Install and run the frontend by opening a second terminal in the inner sketchmapper directory:
npm install && npm run dev
You need access to an empty Neo4j instance as well as a PostGIS instance to perform the geometric operations. The .env file in the osm directory should contain: NEO4J_HOST, NEO4J_USER, NEO4J_PASSWORD, PG_CONNECTION
-
Obtain your OpenStreetMap extract (e.g. here, in PBF)
-
Use a tool like osm2pgsql to import the extract into your database
-
Open a terminal in the osm directory and install the dependencies:
pip install -r requirements.txt
-
Run the import (May take several minutes for one city):
python import_osm.py
Draw shapes corresponding to buildings, streets and vegetation and provide the approximate length of their longer edge as well as their shortest distance to the center of the scene. This way, the algorithm can understand the dimensions of the drawn sketch.
- Incorporate new features (building floors, street curvatures, shop names...)
- Allow more shapes to be drawn (currently only rectangles)
- Increase the sampling resolution (currently around 30 m)
- Automatically generate scenes from photos