Skip to content
Snippets Groups Projects
Commit 5c711725 authored by kraleva's avatar kraleva
Browse files

Merge branch 'add_proto_classes' into 'main'

Create proto class for debug-tool and add sample

See merge request !3
parents d95f7d57 d6a2612a
No related branches found
No related tags found
1 merge request!3Create proto class for debug-tool and add sample
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
\ No newline at end of file
# Routing Service
## Create Proto Classes
------
## Getting started
In order to create classes from the protos (in case the definition changed) one has to use the following command :
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://git.imp.fu-berlin.de/swp-datenverwaltung-navigation-2023/routing-service.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://git.imp.fu-berlin.de/swp-datenverwaltung-navigation-2023/routing-service/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
```sh
protoc --proto_path=debug-tool/proto/schema --python_out=./debug-tool/proto debug-tool/proto/schema/roadnetwork.proto
```
\ No newline at end of file
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: roadnetwork.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11roadnetwork.proto\x12\x06protos\"\x9f\x02\n\x0bRoadNetwork\x12-\n\x05nodes\x18\x01 \x03(\x0b\x32\x1e.protos.RoadNetwork.NodesEntry\x12\x33\n\x08segments\x18\x02 \x03(\x0b\x32!.protos.RoadNetwork.SegmentsEntry\x12.\n\x11turn_restrictions\x18\x03 \x03(\x0b\x32\x13.protos.Restriction\x1a:\n\nNodesEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\x1b\n\x05value\x18\x02 \x01(\x0b\x32\x0c.protos.Node:\x02\x38\x01\x1a@\n\rSegmentsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\x1e\n\x05value\x18\x02 \x01(\x0b\x32\x0f.protos.Segment:\x02\x38\x01\"I\n\x04Node\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0e\n\x06osm_id\x18\x02 \x01(\x04\x12%\n\x08position\x18\x03 \x01(\x0b\x32\x13.protos.Coordinates\"\xaa\x01\n\x07Segment\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0e\n\x06osm_id\x18\x02 \x01(\x04\x12%\n\x08geometry\x18\x03 \x03(\x0b\x32\x13.protos.Coordinates\x12\x0e\n\x06length\x18\x04 \x01(\x01\x12\x12\n\nstart_node\x18\x05 \x01(\x04\x12\x10\n\x08\x65nd_node\x18\x06 \x01(\x04\x12&\n\x08\x63\x61tegory\x18\x07 \x01(\x0e\x32\x14.protos.RoadCategory\"-\n\x0bRestriction\x12\x0f\n\x07\x66rom_id\x18\x01 \x01(\x04\x12\r\n\x05to_id\x18\x02 \x01(\x04\"\'\n\x0b\x43oordinates\x12\x0b\n\x03lat\x18\x01 \x01(\x02\x12\x0b\n\x03lon\x18\x02 \x01(\x02*\x94\x01\n\x0cRoadCategory\x12\x19\n\x15ROAD_CATEGORY_INVALID\x10\x00\x12\x19\n\x15ROAD_CATEGORY_HIGHWAY\x10\x01\x12\x16\n\x12ROAD_CATEGORY_MAIN\x10\x02\x12\x17\n\x13ROAD_CATEGORY_LOCAL\x10\x03\x12\x1d\n\x19ROAD_CATEGORY_RESIDENTIAL\x10\x04\x42(\n\x12map.builder.protosB\x10RoadNetworkProtoP\x01\x62\x06proto3')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'roadnetwork_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\022map.builder.protosB\020RoadNetworkProtoP\001'
_ROADNETWORK_NODESENTRY._options = None
_ROADNETWORK_NODESENTRY._serialized_options = b'8\001'
_ROADNETWORK_SEGMENTSENTRY._options = None
_ROADNETWORK_SEGMENTSENTRY._serialized_options = b'8\001'
_ROADCATEGORY._serialized_start=656
_ROADCATEGORY._serialized_end=804
_ROADNETWORK._serialized_start=30
_ROADNETWORK._serialized_end=317
_ROADNETWORK_NODESENTRY._serialized_start=193
_ROADNETWORK_NODESENTRY._serialized_end=251
_ROADNETWORK_SEGMENTSENTRY._serialized_start=253
_ROADNETWORK_SEGMENTSENTRY._serialized_end=317
_NODE._serialized_start=319
_NODE._serialized_end=392
_SEGMENT._serialized_start=395
_SEGMENT._serialized_end=565
_RESTRICTION._serialized_start=567
_RESTRICTION._serialized_end=612
_COORDINATES._serialized_start=614
_COORDINATES._serialized_end=653
# @@protoc_insertion_point(module_scope)
xx
\ No newline at end of file
syntax = "proto3";
package protos;
option java_multiple_files = true;
option java_package = "map.builder.protos";
option java_outer_classname = "RoadNetworkProto";
//Roadnetwork represents our whole roadnetwork
message RoadNetwork {
// Nodes are corresponding to intersections, the key value currently is the OSM id
map<uint64,Node> nodes = 1;
// Segments correspond to edges in our graph, the key value currently is the OSM id
map<uint64,Segment> segments = 2;
// Turn restrictitons correspond to turn restrictions
repeated Restriction turn_restrictions = 3;
}
// Nodes represent usually intersections in our network.
message Node {
// Internally used ids of our segments, currently same as OSM id
uint64 id = 1;
// Vendor IDs of OSM data, used for referencing the original data
uint64 osm_id = 2;
// Coordinaes of the intersection
Coordinates position = 3;
}
// Segment represents a directed edge in our network, which connects two nodes
message Segment {
// id is the internal id used in our system of a segment, currently same as OSM id
uint64 id = 1;
// osm_id is the id of the segment, in the original OSM data, if it exists as a separate segment there
uint64 osm_id = 2;
// geometry represents the linestring representing the segment
repeated Coordinates geometry = 3;
// length of the segment in meters
double length = 4;
// start_node is the start endpoint of the segment
uint64 start_node = 5;
// end_node is the end endpoint of the segment
uint64 end_node = 6;
// category of the road according to OSM main road types
RoadCategory category = 7;
}
// RoadCategory groups road segments into several classes
enum RoadCategory {
// a special value to indicate that the field is not set
ROAD_CATEGORY_INVALID = 0;
// represents motorway and trunks, according to the specification of OSM's data
ROAD_CATEGORY_HIGHWAY = 1;
// often link larger towns
ROAD_CATEGORY_MAIN = 2;
// represents a road within a city or connecting small towns
ROAD_CATEGORY_LOCAL = 3;
// represents a vehicular access to small streets connecting roads with apartments, buildings
ROAD_CATEGORY_RESIDENTIAL=4;
}
// A restricted turn from one segment to another, which are adjacent to each other
message Restriction {
// from_id is the id of the segment from which the turn originates
uint64 from_id = 1;
// to_id is the id of the segment in which the turn ends
uint64 to_id = 2;
}
// A location is geographical point. The coordinate system used is WGS 84
message Coordinates {
// lat corresponds to the latitude of the point
float lat = 1;
// lon corresponds to the longitude of the point
float lon = 2;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment