Giter Site home page Giter Site logo

openstreetmap-si / petrol-osm-import Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 174 KB

Preparation of gas station data from Petrol.si for a possible import into OpenStreetMap.org

Makefile 9.98% Python 80.60% HTML 9.42%
openstreetmap slovenia slovenija gas-station petrol osm-conflator

petrol-osm-import's Introduction

Petrol.si gas stations for OpenStreetMap.org

Scrapes the map on petrol.si for their fuel and charging station data and converts it to a format suitable for importing into OpenStreetMap, while preserving existing data.

Build Status Requirements Status

Note: this is currently broken due to sourece website changes. New source starting point could be a JSON endpoint.

OpenStreetMap wiki about gas stations in Slovenia

Result preview

Full-screen preview of the derived changes is available here

Running

Requirements: python and pip

Run via GNU make, using the included Makefile, which:

  1. Prepares the python virtual environment

  2. Installs all needed dependencies as defined in requirements.txt

  3. Executes scraping using scrape-petrol.py, which

    • Fetches https://www.petrol.si/bencinski-servisi/zemljevid
    • Tags the nodes as defined in tags-mapping.yaml
    • filters the nodes to Slovenia only (via the is_in tag) - it can easily be adapted for other countries
    • Fetches all the individual gas station pages for exact opening times (using mapping in openingtimes.yaml) Requests are cached aggressively in webcache.sqlite, so make sure to delete it when you want to scrape fresh data, typically the last time before import
    • generates file petrol-si-scraped.json
  4. Executes OSM conflator with petrol-si-profile.py and generates

    • existingdata.osm - existing data from OpenStreetMap
    • petrol-si.osm - osmChange file for import (do NOT import anything until community approval!!!)
    • petrol-si-changes.geojson - proposed changes preview, in git only for easy preview and diff history

Scraper is expecting javascript lines with data in format:

createMarker(new google.maps.LatLng(45.1234567800,15.8765432100), '<div>marker html</div>', ' tag one tag two tag three ', 1);

Status

This exercise is a work in progress, not yet fully ready for use. Still TODO:

  • add leading zeros to opening_hours
  • scrape phone, fax and address
  • get approval from data owners (they do publish simpler datasets for gps devices) they will most likely be ok with it, as it is in their best interest to be on the map
  • get community approval
    • list the possible import in the OSM import catalogue
    • global imports@ mailing list,
    • local forum,
    • review
  • review the proposed changes with OSM conflator audit system
  • import the reviewed data into the OSM using JSON

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.