# lanelet2-parser: Parser for Lanelet2
## Tutorial
#### Creating Lanelet2Parser instance
```
>>> from lanelet2_parser import Lanelet2Parser
>>> lanelet2_parser = Lanelet2Parser()
```
#### Parse OSM File
```
>>> osm_data = lanelet2_parser.parse(osm_map_file_path)
```
##### OSM Data Format
```
OSM
- version: Float
- nodes: List<Node>
- ways: List<Way>
- relations: List<Relation>
Node
- id: Int
- lat: Decimal
- lon: Decimal
- ele: Decimal
- tags: List<Tag>
- visible: Bool
Way
- id: Int
- nodes: List<Node>
- tags: List<Tag>
- visible: Bool
Relation
- id: Int
- members: List<Member>
- tags: List<Tag>
- visible: Bool
Tag
- key: String
- value: String
Member
- type: String
- ref: Int
- role: String
```
#### Convert Lanelet2 format from OSM
```
>>> lanelet2_data = lanelet2_parser.convert_to_lanelet2(osm_data)
```
##### Lanelet2 Data Format
```
Lanelet2
- version: Float
- points: List<Node>
- line_strings: List<LineString>
- lanelets: List<Lanelet>
- areas: List<Area>
- polygons: List<Polygon>
- regulatory_elements: List<RegulatoryElement>
- line_string_relations: Dict<line_string_id: LineStringRelation>
- lanelet_relations: Dict<lanelet_id: LaneletRelation>
Point
- id: Int
- lat: Decimal
- lon: Decimal
- ele: Decimal
- x: Decimal
- y: Decimal
- z: Decimal
- attibutes: List<Attribute>
LineString
- id: Int
- points: List<Point>
- attibutes: List<Attribute>
Lanelet
- id: Int
- left_bound: LineString
- right_bound: LineString
- center_line: LineString
- attibutes: List<Attribute>
- regulatory_element: List<RegulatoryElement>
RegulatoryElement
- id: Int
- subtype: String
- attibutes: List<Attribute>
- parameters: List<Parameter>
Parameter
- refers: LineString or Lanelet
- ref_line: LineString
- right_of_way: Lanelet
- param_yield: Lanelet
- cancels: Lanelet
- cancel_line: LineString
LineStringRelation
- prev_ids: List<Int>
- next_ids: List<Int>
LaneletRelation
- prev_ids: List<Int>
- next_ids: List<Int>
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tier4/lanelet2-parser",
"name": "lanelet2-parser",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Lanelet2,Parser,Autoware",
"author": "Yuki Iida",
"author_email": "yuki.iida@tier4.jp",
"download_url": "https://files.pythonhosted.org/packages/bb/c8/7f143573548d550d6fe20ab27a06b10d374210fa410c3cb2b26a0c7e7b68/lanelet2_parser-0.1.8.tar.gz",
"platform": null,
"description": "# lanelet2-parser: Parser for Lanelet2\n\n## Tutorial\n#### Creating Lanelet2Parser instance\n```\n>>> from lanelet2_parser import Lanelet2Parser\n>>> lanelet2_parser = Lanelet2Parser()\n```\n\n#### Parse OSM File\n```\n>>> osm_data = lanelet2_parser.parse(osm_map_file_path)\n```\n\n##### OSM Data Format\n```\nOSM\n- version: Float\n- nodes: List<Node>\n- ways: List<Way>\n- relations: List<Relation>\n\nNode\n- id: Int\n- lat: Decimal\n- lon: Decimal\n- ele: Decimal\n- tags: List<Tag>\n- visible: Bool\n\nWay\n- id: Int\n- nodes: List<Node>\n- tags: List<Tag>\n- visible: Bool\n\nRelation\n- id: Int\n- members: List<Member>\n- tags: List<Tag>\n- visible: Bool\n\nTag\n- key: String\n- value: String\n\nMember\n- type: String\n- ref: Int\n- role: String\n```\n#### Convert Lanelet2 format from OSM\n```\n>>> lanelet2_data = lanelet2_parser.convert_to_lanelet2(osm_data)\n```\n\n\n##### Lanelet2 Data Format\n```\nLanelet2\n- version: Float\n- points: List<Node>\n- line_strings: List<LineString>\n- lanelets: List<Lanelet>\n- areas: List<Area>\n- polygons: List<Polygon>\n- regulatory_elements: List<RegulatoryElement>\n- line_string_relations: Dict<line_string_id: LineStringRelation>\n- lanelet_relations: Dict<lanelet_id: LaneletRelation>\n\nPoint\n- id: Int\n- lat: Decimal\n- lon: Decimal\n- ele: Decimal\n- x: Decimal\n- y: Decimal\n- z: Decimal\n- attibutes: List<Attribute>\n\nLineString\n- id: Int\n- points: List<Point>\n- attibutes: List<Attribute>\n\nLanelet\n- id: Int\n- left_bound: LineString\n- right_bound: LineString\n- center_line: LineString\n- attibutes: List<Attribute>\n- regulatory_element: List<RegulatoryElement>\n\nRegulatoryElement\n- id: Int\n- subtype: String\n- attibutes: List<Attribute>\n- parameters: List<Parameter>\n\nParameter\n- refers: LineString or Lanelet\n- ref_line: LineString\n- right_of_way: Lanelet\n- param_yield: Lanelet\n- cancels: Lanelet\n- cancel_line: LineString\n\nLineStringRelation\n- prev_ids: List<Int>\n- next_ids: List<Int>\n\nLaneletRelation\n- prev_ids: List<Int>\n- next_ids: List<Int>\n```\n\n\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Parser for Lanelet2",
"version": "0.1.8",
"project_urls": {
"Homepage": "https://github.com/tier4/lanelet2-parser"
},
"split_keywords": [
"lanelet2",
"parser",
"autoware"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "634f6acb40c0342ebb02498ef7d18b4cde6fa8650aa5d2d18394d467b3fbb18a",
"md5": "0b4f99f3ade0235b1fc4d3cb5bf68b0d",
"sha256": "6c1b5b10f39c1ea42f0f1b0cf48a746823cd769f090c0ca6b86514354a06bdb3"
},
"downloads": -1,
"filename": "lanelet2_parser-0.1.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0b4f99f3ade0235b1fc4d3cb5bf68b0d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10899,
"upload_time": "2023-06-08T08:27:23",
"upload_time_iso_8601": "2023-06-08T08:27:23.284857Z",
"url": "https://files.pythonhosted.org/packages/63/4f/6acb40c0342ebb02498ef7d18b4cde6fa8650aa5d2d18394d467b3fbb18a/lanelet2_parser-0.1.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bbc87f143573548d550d6fe20ab27a06b10d374210fa410c3cb2b26a0c7e7b68",
"md5": "5649e069ef068185ecc383f2e9259425",
"sha256": "711d4b7a5a70395077166928bb3787cd1db3b0e8bedcffeb82fa2b8fdfb7c69e"
},
"downloads": -1,
"filename": "lanelet2_parser-0.1.8.tar.gz",
"has_sig": false,
"md5_digest": "5649e069ef068185ecc383f2e9259425",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9622,
"upload_time": "2023-06-08T08:27:25",
"upload_time_iso_8601": "2023-06-08T08:27:25.081028Z",
"url": "https://files.pythonhosted.org/packages/bb/c8/7f143573548d550d6fe20ab27a06b10d374210fa410c3cb2b26a0c7e7b68/lanelet2_parser-0.1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-08 08:27:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tier4",
"github_project": "lanelet2-parser",
"github_not_found": true,
"lcname": "lanelet2-parser"
}