Skip to main content

GTFS Editor frontend app for Django

Project description

GTFS Shape Editor

GTFS Editor, Django App

GTFS Shape Editor is mainly a frontend app which uses Vue, OpenLayers/OpenStreetMap, sweetalert2 and Bootstrap. Editor shows a map max width where you can draw and route shapes, place stops and edit the properties in the tables just below.

Install

pip install shapeeditor

Add the app 'shapeeditor' in your Django project settings file

INSTALLED_APPS = [
    ...
    'shapeeditor',
    ...
]

Shapeeditor needs authentication to edit the data, define the LOGIN_URL variable to know where redirect if visitor is not logged.

LOGIN_URL='/admin/login/'

# First point map extent area
#       +++++++++
#       +       +
#       +  Map  +
#       +       +
# --->  @++++++++

# Second point map extent area
# ++++++++@ <---
# +       +
# +  Map  +
# +       +
# +++++++++

SHAPEEDITOR_MAP_EXTENT_AREA = [
    [-84.43669241118701, 9.726525930153954],
    [-83.72894500499169, 9.99625455768836]]

# Center by default on load
SHAPEEDITOR_MAP_CENTER = [-84.1027104, 9.865107]

# Router it could ask for shape generation
SHAPEEDITOR_ROUTING_MACHINE_URL = "http://router.project-osrm.org/route/v1/driving/" 

Include Shapeeditor urls in urls.py, then we can open the editor from the site, draw the shape and download as a shapes.txt or import it to the database.

urlpatterns = [
    path('shapeeditor/', include('shapeeditor.urls')),
]

Just to be sure database is ok run the next commands.

./manage.py makemigrations
./manage.py migrate

Usage

There is not a manual yet, but essentially the map allows the user to draw a shape, cut links and delete links and nodes, to create a shape you need to define two endpoints then put waypoints between the begin and end, more waypoints means better aproximation.

Most of the features are already implemented in JS but there is not a GUI equivalent to call for methods yet.

Shapes are made with nodes, nodes have a type, it could be endpoint for start or end of shapes, stops, these can be part of the shape too, fork are the nodes where are more than two links, waypoint are the common nodes. To create a Shape first draw paths clicking on map with the interaction add_node, when you already have a connection between two endpoints through multiple nodes and links add a Shape in the section below, once added the shape pick the waypoints with select_node + Shift, when you pick a waypoint and it is in a shape segment, the whole segment is selected, pick only waypoints their segments are in the shape.

Pick waypoints from the start node to the final node, keep the waypoints in order to avoid backward motion, when you pick a waypoint the section>accordion for the shape we are adding the waypoints will show the waypoints list, when the the waypoints are enough click on save button to write the shape, then push it to database.

Uninstall

pip uninstall shapeeditor

Then delete it from settings.py mentions.

How to give my contribution

You could fork and PR, suggestions are welcome.

Here some screenshots:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shapeeditor-0.1.5.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shapeeditor-0.1.5-py2.py3-none-any.whl (1.8 MB view details)

Uploaded Python 2Python 3

File details

Details for the file shapeeditor-0.1.5.tar.gz.

File metadata

  • Download URL: shapeeditor-0.1.5.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for shapeeditor-0.1.5.tar.gz
Algorithm Hash digest
SHA256 7eaf12a00271081f6f9815a25b9d75b150cd8ee1a881277847ab61ea66a478be
MD5 7b41b19ed49c63e6e799d0d5d61def84
BLAKE2b-256 a44f7e0033b99cd3a9e87f36e92f08b28823ddc54379dba5fcdde6f2766927b3

See more details on using hashes here.

File details

Details for the file shapeeditor-0.1.5-py2.py3-none-any.whl.

File metadata

  • Download URL: shapeeditor-0.1.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for shapeeditor-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f7f39beb97791430c88835724c5a76a8e26dab7b41bdc4e09ef1902cd2719deb
MD5 097069dcf54716a22210d3068790e99d
BLAKE2b-256 e9039ff495f4ac442f5a49d24e14e5463350b2da9426389b2bcf33b3a75c960d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page