Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'io.sharedstreets'
version '0.3.1'
version '0.3.2'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version 0.3.2 already is published though this PR has not been merged.



buildscript {
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/io/sharedstreets/data/SharedStreetsOSMMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ public class WaySectionMetadata implements Serializable {
public Long[] nodeIds;
public String name;

public String[] tagNames;
public String[] tagValues;

public WaySectionMetadata( WaySection section, boolean storeWaySegmentNames) {

this.wayId = section.wayId;

this.roadClass = section.roadClass;
Expand All @@ -42,6 +46,17 @@ public WaySectionMetadata( WaySection section, boolean storeWaySegmentNames) {
for(int i = 0; i < section.nodes.length; i++) {
this.nodeIds[i] = section.nodes[i].nodeId;
}

this.tagNames = new String[section.fields.keySet().size()];
this.tagValues = new String[section.fields.keySet().size()];

int i = 0;
for (String key : section.fields.keySet()) {
this.tagNames[i] = key;
this.tagValues[i] = section.fields.get(key);
i++;

}
}
}

Expand Down Expand Up @@ -81,6 +96,13 @@ public byte[] toBinary() throws IOException {
waySection.addNodeIds(nodeId);
}

for(int i = 0 ; i < waySectionMetadata.tagNames.length; i++) {
SharedStreetsProto.OsmTag.Builder tag = SharedStreetsProto.OsmTag.newBuilder();
tag.setKey(waySectionMetadata.tagNames[i]);
tag.setValue(waySectionMetadata.tagValues[i]);
waySection.addTags(tag);
}

osmMetadata.addWaySections(waySection);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public static UniqueId generateId(SharedStreetsReference ssr) {
}
}
UniqueId id = UniqueId.generateHash(hashString);

return id;
}

Expand Down
Loading