Python Osmium Examples

Overview

Python Osmium Examples

This is a set (currently of size 1) of examples showing practical usage of PyOsmium, a thin wrapper around the osmium library.

If you have other useful scripts, please submit a pull request to include them. If you do, please also update setup.py accordingly. See the Click documentation for information.

How to install

git clone [email protected]:mvexel/python-osmium-examples.git
cd python-osmium-examples
python3 -m venv venv
source venv/bin/activate
pip install .

The Scripts

You can get basic syntax help by calling the script with --help.

count_highway_mappers

Counts edits to major highways by user. The result is written as a CSV file with one row per mapper and one column per highway value.

The highway tag values to include are hard-coded in the script.

You might also like...
Analisador de strings feito em Python // String parser made in Python

Este é um analisador feito em Python, neste programa, estou estudando funções e a sua junção com "if's" e dados colocados pelo usuário. Neste código,

Python with braces. Because Python is awesome, but whitespace is awful.

Bython Python with braces. Because Python is awesome, but whitespace is awful. Bython is a Python preprosessor which translates curly brackets into in

PSP (Python Starter Package) is meant for those who want to start coding in python but are new to the coding scene.

Python Starter Package PSP (Python Starter Package) is meant for those who want to start coding in python, but are new to the coding scene. We include

Py-Parser est un parser de code python en python encore en plien dévlopement.

PY - PARSER Py-Parser est un parser de code python en python encore en plien dévlopement. Une fois achevé, il servira a de nombreux projets comme glad

Simple, high-school-leveled sequence library written in Python / 간단한 고등학교 수준 수열 라이브러리 (Python)
A community based economy bot with python works only with python 3.7.8 as web3 requires cytoolz

A community based economy bot with python works only with python 3.7.8 as web3 requires cytoolz has some issues building with python 3.10

A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning  Essence.
A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning Essence.

A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning Essence.

Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors inside nodejs.

inverted pendulum fuzzy control python code (python 2.7.18)
inverted pendulum fuzzy control python code (python 2.7.18)

inverted-pendulum-fuzzy-control- inverted pendulum fuzzy control python code (python 2.7.18) We have 3 general functions for 3 main steps: fuzzificati

Comments
  • AttributeError: 'osmium.osm._osm.Way' object has no attribute 'mapper'

    AttributeError: 'osmium.osm._osm.Way' object has no attribute 'mapper'

    I'm not sure if this is caused by an issue with my environment or the input files I've downloaded, but I'm getting this with the public Geofabrik .osm.pbf extracts as well as the internal (with metadata) .osm.pbf and .osh.pbf extracts downloaded from https://osm-internal.download.geofabrik.de/north-america/us/minnesota.html

    (venv) [afranco@MIDD-13822 python-osmium-examples (installation-fixes)]$ python3 highway_mappers.py minnesota-internal.osh.pbf mn-highway-mappers.csv
    processing minnesota-internal.osh.pbf
    Stage 1: Counting Unique Highway Mappers
    Way w4384659: nodes=[26759799,26759798,26759797,26759796,26759794,26...] tags={created_by=YahooApplet 1.0,highway=motorway,nam...}
    Traceback (most recent call last):
      File "highway_mappers.py", line 69, in <module>
        cli()
      File "/Users/afranco/python-osmium-examples/venv/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
        return self.main(*args, **kwargs)
      File "/Users/afranco/python-osmium-examples/venv/lib/python3.8/site-packages/click/core.py", line 1053, in main
        rv = self.invoke(ctx)
      File "/Users/afranco/python-osmium-examples/venv/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/Users/afranco/python-osmium-examples/venv/lib/python3.8/site-packages/click/core.py", line 754, in invoke
        return __callback(*args, **kwargs)
      File "highway_mappers.py", line 56, in cli
        mch.apply_file(osmfile)
      File "highway_mappers.py", line 27, in way
        if w.mapper not in self.mappers:
    AttributeError: 'osmium.osm._osm.Way' object has no attribute 'mapper'
    

    It looks like I have the latest 3.2.0 release of osmium:

    (venv) [afranco@MIDD-13822 python-osmium-examples (installation-fixes)]$ ls venv/lib/python3.8/site-packages/
    __pycache__/                                 numpy/                                       pytz/
    certifi/                                     numpy-1.22.1.dist-info/                      pytz-2021.3.dist-info/
    certifi-2021.10.8.dist-info/                 osmium/                                      requests/
    charset_normalizer/                          osmium-3.2.0.dist-info/                      requests-2.27.1.dist-info/
    charset_normalizer-2.0.10.dist-info/         pandas/                                      setuptools/
    click/                                       pandas-1.4.0.dist-info/                      setuptools-41.2.0.dist-info/
    click-8.0.3.dist-info/                       pip/                                         six-1.16.0.dist-info/
    dateutil/                                    pip-19.2.3.dist-info/                        six.py
    easy_install.py                              pkg_resources/                               urllib3/
    idna/                                        python_dateutil-2.8.2.dist-info/             urllib3-1.26.8.dist-info/
    idna-3.3.dist-info/                          python_osmium_examples-0.1.0-py3.8.egg-info/ 
    

    Thoughts as to what to investigate?

    opened by adamfranco 0
  • Add --after and --before filters on changeset dates.

    Add --after and --before filters on changeset dates.

    These filters allow scoping of the changesets considered to a particular date range which should be useful for fetch lists of recently active highway mappers in an area.

    opened by adamfranco 2
Owner
Martijn van Exel
the map man that map can
Martijn van Exel
lets learn Python language with basic examples. highly recommended for beginners who just start coding.

Lets Learn Python ?? Learn python from basic programs. learn python from scratch. 1.Online python compiler: https://www.onlinegdb.com/online_python_co

Subhranshu Choudhury 1 Jan 18, 2022
A tutorial presents several practical examples of how to build DAGs in Apache Airflow

Apache Airflow - Python Brasil 2021 Este tutorial apresenta vários exemplos práticos de como construir DAGs no Apache Airflow. Background Apache Airfl

Jusbrasil 14 Jun 3, 2022
Improving the Transferability of Adversarial Examples with Resized-Diverse-Inputs, Diversity-Ensemble and Region Fitting

Improving the Transferability of Adversarial Examples with Resized-Diverse-Inputs, Diversity-Ensemble and Region Fitting

Junhua Zou 7 Oct 20, 2022
Amazon SageMaker Delta Sharing Examples

This repository contains examples and related resources showing you how to preprocess, train, and serve your models using Amazon SageMaker with data fetched from Delta Lake.

Eitan Sela 5 May 2, 2022
A collection of examples of using cocotb for functional verification of VHDL designs with GHDL.

At the moment, this repo is in an early state and serves as a learning tool for me. So it contains a a lot of quirks and code which can be done much better by cocotb-professionals.

T. Meissner 7 Mar 10, 2022
Different steganography methods with examples and my own small image database

literally-the-most-useless-project [Different steganography methods with examples and my own small image database] This project currently contains thr

Kamyishka 1 Dec 9, 2022
Todos os exercícios do Curso de Python, do canal Curso em Vídeo, resolvidos em Python, Javascript, Java, C++, C# e mais...

Exercícios - CeV Oferecido por Linguagens utilizadas atualmente O que vai encontrar aqui? ?? Esse repositório é dedicado a armazenar todos os enunciad

Coding in Community 43 Nov 10, 2022
PyDy, short for Python Dynamics, is a tool kit written in the Python

PyDy, short for Python Dynamics, is a tool kit written in the Python programming language that utilizes an array of scientific programs to enable the study of multibody dynamics. The goal is to have a modular framework and eventually a physics abstraction layer which utilizes a variety of backends that can provide the user with their desired workflow

PyDy 307 Jan 1, 2023
A Python script made for the Python Discord Pixels event.

Python Discord Pixels A Python script made for the Python Discord Pixels event. Usage Create an image.png RGBA image with your pattern. Transparent pi

Stanisław Jelnicki 4 Mar 23, 2022
this is a basic python project that I made using python

this is a basic python project that I made using python. This project is only for practice because my python skills are still newbie.

Elvira Firmansyah 2 Dec 14, 2022