Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding custom tags to ways and nodes #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AzilAverakot
Copy link

When user provides a dictionary that contains the names of custom tags that need to be ingested those tags are added to ways and nodes.

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 12.12121% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 82.50%. Comparing base (c30254c) to head (16cf6d2).
Report is 2 commits behind head on master.

❗ Current head 16cf6d2 differs from pull request most recent head 3def3b4. Consider uploading reports for the commit 3def3b4 to get more accurate results

Files Patch % Lines
src/graph.jl 10.00% 18 Missing ⚠️
src/parse.jl 15.38% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
+ Coverage   81.05%   82.50%   +1.44%     
==========================================
  Files          15       15              
  Lines        1151     1183      +32     
==========================================
+ Hits          933      976      +43     
+ Misses        218      207      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AzilAverakot AzilAverakot force-pushed the adding_custom_tags_to_ways branch 3 times, most recently from 77be6a4 to 16cf6d2 Compare March 22, 2024 04:11
@AzilAverakot
Copy link
Author

AzilAverakot commented Mar 22, 2024

The goal of this change is to allow users to add custom tags to the OSM graph.

MM 3rd network file in this agreed format will contain OSM tags together with vicmap tags and custom tags.

In this pr I add functions to add custom tags to the tags dictionary for ways and nodes. This will only be done if the user provides the dictionary filter to specify which custom tags to ingest.

For example, given the following sample file structure:

    {
          "version": "dtp_osm_road_network_transport:2.2",
          "timestamp_osm_base": "2023-12-05T23:27:21.722",
          "elements": [
                  {
                      "id": "OSM&&NODE10000307796",
                      "type": "node",
                      "lon": 145.2680669,
                      "lat": -37.7890839
                  },
                  {
                      "id": "OSM&&NODE10000307797",
                      "type": "node",
                      "lon": 145.2680689,
                      "lat": -37.7891024
                  },
                  {   
                      "dtp_id": "DTP&&WAY123456789"/"OSM&&WAY123456789",
                      "way_id": "OSM&&WAY123456789",
                      "type": "way",
                      "nodes": ["OSM&&NODE10000307796", "OSM&&NODE10000307797", "OSM&&NODE10000307798"],
                      "source_matched_id": "VICMAP_TRANSPORT&&59472156",
                      "tags": {
                          "name": "Ormiston Place",
                          "nodes": ["OSM&&NODE10000307796", "OSM&&NODE10000307797", "OSM&&NODE10000307798"],
                          "source": "nearmap",
                          "highway": "residential",
                          "more fields": "..."
                      },
                      "custom_tags": {
                          "DTP_REG_NAME": "GREATER METRO",
                          "LGA_ABB_NAME": "CASEY",
                          "MEL30_ART": "N", 
                          "more fields": "..."
                      },
                      "vmt_tags": {
                          "ufi": "59472156", 
                          "div_rd": "U", 
                          "road_name": "ORMISTON", 
                          "road_seal": "1",
                          "more fields": "..."
                      }
                  },
            ]
      }

to ingest selected vmt_tags and custom_tags the user needs to provide the following dictionary as the function input:

tags_filter = Dict(
    "custom_tags" => ["DTP_REG_NAME", "LGA_ABB_NAME", "MEL30_ART"],
    "vmt_tags" => ["ufi", "div_rd"]
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant