Git Product home page Git Product logo

map-stylizer's Introduction

map-stylizer

GUI written in Python to parse OSM (OpenStreetMap) files and render them onscreen. Layers may be toggled on/off and drawing may be customized.


This program allows a user to render OSM files within the GUI. The GUI enables the user to easily modify which layers are visible and the style of these layers.

Basic Demo Video

Steps

  1. Download the source code open the program by typing python main.py in the command line.
  2. Open your browser of choice to OpenStreetMap.
  3. Click the "Export" tab and select the "Manually select a different area" link. Shape and place the box over the region from which you want map data. Click "Export" to download the OSM file for the box you've drawn. If you get an error that you've selected too many nodes, you may alternatively click "Overpass API."
    Note: Ensure your downloaded OSM file is around 30MB. Larger files will noticeably slow the program.
  4. Open your OSM file using the GUI.
  5. Edit away!

Editing

  • Choose which layers you want visible
    Note: Layers are grouped by OSM keys (i.e., "highway," "waterway," etc.)
  • Change the style of line or fill layers
    • Line layers are QPen objects, so you can specify the line's width, color, style, cap style, and join style
    • Fill layers are QColor objects, so you can only specify their color
  • When you save an image, the resulting configuration is saved into the "configs" folder so you can reimport these settings for another project
  • You can also automate the creation of configurations via your own script, where you use the Configuration class to set colors of layers en masse

Adding Additional Layers

When you import an OSM file and begin manipulating it, you will likely notice warnings on your command prompt indicating there are additional layers not rendering because they need to be added. This is okay, as I've added the majority of layers you would be interested in; however, if you would like to add the layers mentioned, follow the below steps:

  1. In the constants.py file:
    1. Create a unique (both variable name and variable value) VAL variable under the appropriate KEY group
    2. Create a unique (both variable name and variable value) CONFIG_STYLE variable under the appropriate KEY group
    3. Connect the new VAL and new CONFIG_STYLE in the DATA_GROUPS dictionary
  2. Finally, in the configuration.py file, connect the CONFIG_STYLE to a QPen (for a layer to be rendered as a line) or QColor (for a layer to be rendered as a fill)

map-stylizer's People

Contributors

absolute-tinkerer avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.