Git Product home page Git Product logo

osmapy's Introduction

Osmapy - Python Editor for OpenStreetMap Data

Logo

May I introduce you to Osmapy, the Editor for OpenStreetMap data written in Python. This should become the new state of the art editor for OpenStreetMap. In contrast to the other common OSM editors this editor is based on Python. Python is modern, has a huge user base and is battery-included. This allows everyone to contribute to this project. Osmapy uses the widespread, powerful and freshly-looking Qt-framework.

OpenStreetMap and the OpenStreetMap Logo are a trademarks of the OpenStreetMap Foundation, and are used with their permission. Osmapy is not endorsed by or affiliated with the OpenStreetMap Foundation.
The Python Logo is a trademarks of the Python Software Foundation, and is used with their permission. Osmapy is not endorsed by or affiliated with the Python Software Foundation.

example

example

Currently Osmapy is more like a prove of concept than a full fledged editor. But it can already be used to modify OSM nodes.

Features

The following Features are already implemented:

  • Interface to Slippy Tiles
    • LiFo queue to load the most needed tiles first
    • Multiple workers to download tiles
    • Caching
    • Easy configuration to chose tile servers
  • Layers
    • Multi-Layer support
    • Change layer order by Drag'n'Drop
    • Change the opacity of layers
  • GPX files
    • GPX files are easily loaded by Drag'n'Drop
  • OSM objects modification
    • Create / Modify / Delete OSM nodes
    • Add / Change / Remove Tags
    • Precise node moving with the arrow keys
    • Upload your changes to the OSM server
  • Adaptive appearance
    • All the tool windows can be moved around freely
  • Easy configuration
    • Just one YAML file must be modified

Installation

The editor can be easily installed using pip:

pip3 install osmapy

After installation run in the commandline:

osmapy

⚠️ Windows
Python must be added to your PATH variable. If you have not chosen to do this while the installation of Python. You have two options to achieve this:

  1. Re-run the Python installer, select Modify, go to the next tab and enable the option "Add Python to environment variables"
  2. Manually modify the PATH variable and add the path where osmapy is installed. In the most cases that's something like C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\Scripts\.

⚠️ Windows
Maybe you have to install the Build Tools for Visual Studio on Windows. If the installation of Osmapy fails while installing numpy this is suggested by the error message.

Development and Testing

Please use the sandbox API for development and testing. You can set the API url in the configuration file.

osm_api_url: https://master.apis.dev.openstreetmap.org

Small User Hints

  • Move around: Right mouse button + Mouse Move
  • Zooming: Mousewheel
  • After zooming in you can click on "Load Elements" to load the OSM elements in the visible area
  • Select Node with right click
  • Move selected Node with arrow keys
  • Remove OSM tag: click on the key of the tag
  • Drop GPX file into window to load it

Contributing

All contributions are welcome!

License

This software is released under the terms of the GNU General Public License v3.0.

The presets used are a fork of the iD editor presets. The presets are under the ISC License.

osmapy's People

Contributors

philipprigoll avatar thefeiter avatar ugniljoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

osmapy's Issues

Cannot install osmapy

Last login: Sun Jun 13 00:15:39 on ttys000
williamdavis@Williams-Air ~ % pip3 install osmapy
Collecting osmapy
  Using cached osmapy-0.0.1.8-py3-none-any.whl (123 kB)
Collecting gpxpy
  Using cached gpxpy-1.4.2.tar.gz (105 kB)
Collecting Pillow
  Using cached Pillow-8.2.0-cp39-cp39-macosx_11_0_arm64.whl (2.7 MB)
Collecting osmapy
  Using cached osmapy-0.0.1.7-py3-none-any.whl (123 kB)
  Using cached osmapy-0.0.1.6-py3-none-any.whl (45 kB)
  Using cached osmapy-0.0.1.5-py3-none-any.whl (45 kB)
  Using cached osmapy-0.0.1.4-py3-none-any.whl (34 kB)
  Using cached osmapy-0.0.1.3-py3-none-any.whl (34 kB)
  Using cached osmapy-0.0.1.2-py3-none-any.whl (34 kB)
  Using cached Osmapy-0.0.1.1-py3-none-any.whl (34 kB)
  Using cached osmapy-0.0.1.0-py3-none-any.whl (34 kB)
ERROR: Cannot install osmapy==0.0.1.0, osmapy==0.0.1.1, osmapy==0.0.1.2, osmapy==0.0.1.3, osmapy==0.0.1.4, osmapy==0.0.1.5, osmapy==0.0.1.6, osmapy==0.0.1.7 and osmapy==0.0.1.8 because these package versions have conflicting dependencies.

The conflict is caused by:
    osmapy 0.0.1.8 depends on PySide2
    osmapy 0.0.1.7 depends on PySide2
    osmapy 0.0.1.6 depends on PySide2
    osmapy 0.0.1.5 depends on PySide2
    osmapy 0.0.1.4 depends on PySide2
    osmapy 0.0.1.3 depends on PySide2
    osmapy 0.0.1.2 depends on PySide2
    osmapy 0.0.1.1 depends on PySide2
    osmapy 0.0.1.0 depends on PySide2

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
williamdavis@Williams-Air ~ % 

Function to search for a Preset

To propose a preset to a user we need a function where we throw in a search string and get out a set of matching presets.

Check transformations

Maybe there can be something improved. Sometimes there is an extra sign (e. g. here, here, here).

The important calculations should take place in utils/calc.py, Viewer/Viewer.py and TileLoader/TileLoader.py. Maybe one can streamline this by using more geometric classes (e. g. utils/Point.py) and make more use of numpy arrays.

Presets for Nodes

Add a method to use presets for new nodes. Is there a external source where the presets can be loaded? Do we have to define them ourself? If we have to maybe a collection of yaml files for the objects would be cool.

Allow multiple tile layers

I was trying to add multiple tile servers via the config but atm only the first one is loaded in Viewer.py:
self.tile_loader = TileLoader.TileLoader(self, 0)

I managed to get the second one loaded by just creating a second TileLoader object but by this opacity control and priority order doesn't work anymore.

Pip installation

Hi!

If I do pip install POSM, I don't get anything executable. python3 -m POSM is not possible. Instead, my site packages contain only this dist-info:

$ ls .local/lib/python3.8/site-packages/POSM-0.1.dist-info/ 
entry_points.txt  INSTALLER  LICENSE  METADATA  RECORD  top_level.txt  WHEEL

(with an empty top_level.txt.)

No module named 'dataclasses'

Hey there!

First of all, this editor is a very good idea!!

I have tried to run it by

git clone https://github.com/PhilippRigoll/POSM.git
python3 setup.py develop
POSM

But I am getting:

Traceback (most recent call last):
  File "/usr/local/bin/POSM", line 11, in <module>
    load_entry_point('POSM', 'console_scripts', 'POSM')()
  File "/home/marvin/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/marvin/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2859, in load_entry_point
    return ep.load()
  File "/home/marvin/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2450, in load
    return self.resolve()
  File "/home/marvin/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2456, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/marvin/apps/POSM/POSM/main.py", line 12, in <module>
    from POSM.ElementsLoader.ElementsLoader import ElementsLoader
  File "/home/marvin/apps/POSM/POSM/ElementsLoader/ElementsLoader.py", line 10, in <module>
    from POSM.ElementsLoader import Node
  File "/home/marvin/apps/POSM/POSM/ElementsLoader/Node.py", line 5, in <module>
    from POSM.utils import calc
  File "/home/marvin/apps/POSM/POSM/utils/calc.py", line 6, in <module>
    from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'

I would love to get any help running it, since I am interested in co-developing.
I am not sure, if my python knowledge is sufficient, but I would like to try and fiddle around.

Organize the Tools/Menu

Make the menu nicer. Maybe add a QMenuBar. Maybe use Icons (please make sure that we are allowed to used them).

Cannot identify image file

when running in Terminal I am getting the error (memory adress changing with each error)
Error: cannot identify image file <_io.BytesIO object at 0x7fc06003c3b8>
loads of times. Doesn't seem to cause problems, but I think this shouldn't be like that.

I was not yet able to find out where it comes from.

Only load tiles which exist

At the moment there is no check if a tile exists. Everything is loaded.
As described here only tiles with X from 0 to 2^zoom − 1 and Y from 0 to 2^zoom -1 can exist.

Maybe one can also implement that the user cannot leave the world.

Use dummy image if tile is not loaded

Draw the dummy image assets/error.png if a tile is not already loaded. This was already implemented here but I think it broke when installing via pypi and I am not sure why.
The implementation looked like this:

if pathlib.Path(path_image).is_file():
    pic = QPixmap(str(path_image))
else:
    pic = QPixmap(viewer.asset_error_image)

'EasyDict' object has no attribute 'urls'

Traceback (most recent call last):
  File "/home/marvin/.local/bin/osmapy", line 11, in <module>
    load_entry_point('osmapy', 'console_scripts', 'osmapy')()
  File "/home/marvin/apps/osmapy/osmapy/main.py", line 82, in main
    main_window = Main()
  File "/home/marvin/apps/osmapy/osmapy/main.py", line 51, in __init__
    self.viewer = Viewer.Viewer(self)
  File "/home/marvin/apps/osmapy/osmapy/Viewer/Viewer.py", line 27, in __init__
    self.tile_loaders.append(TileLoader.TileLoader(self, config_id))
  File "/home/marvin/apps/osmapy/osmapy/TileLoader/TileLoader.py", line 34, in __init__
    self.urls = config.slippy_tiles[config_id].urls
AttributeError: 'EasyDict' object has no attribute 'urls'

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.