Skip to content

Commit

Permalink
Merge pull request #80 from usdot-jpo-ode/count-endpoints
Browse files Browse the repository at this point in the history
Fixing Issue with Name Parsing
  • Loading branch information
John-Wiens authored May 1, 2024
2 parents 8a5b013 + 3ed1702 commit 4ff7cb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ public List<IntersectionReferenceData> getIntersectionIDs() {
MongoCursor<Integer> results = docs.iterator();
List<IntersectionReferenceData> referenceDataList = new ArrayList<>();
while (results.hasNext()) {

Integer intersectionId = results.next();
if (intersectionId != null){

if (intersectionId != null){
Bson projectionFields = Projections.fields(
Projections.include("properties.intersectionId", "properties.originIp",
"properties.refPoint.latitude", "properties.refPoint.longitude", "properties.intersectionName"),
Expand All @@ -125,10 +126,10 @@ public List<IntersectionReferenceData> getIntersectionIDs() {
data.setRoadRegulatorID("-1");
data.setRsuIP(properties.getString("originIp"));

if(properties.getString("intersectionName").isEmpty()){

if(properties.getString("intersectionName") != null && properties.getString("intersectionName").isEmpty()){
data.setIntersectionName(properties.getString("intersectionName"));
}
data.setIntersectionName(properties.getString("intersectionName"));

if (refPoint != null) {
data.setLatitude(refPoint.getDouble("latitude"));
data.setLongitude(refPoint.getDouble("longitude"));
Expand All @@ -139,7 +140,7 @@ public List<IntersectionReferenceData> getIntersectionIDs() {
} catch (MongoException e){
logger.error("MongoDB Intersection Query Did not finish in allowed time window");
} catch (Exception e) {
logger.error("");
logger.error(e.getMessage());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void broadcastSpat(ProcessedSpat spat) {
}

if (intersectionID != -1) {
broadcastMessage(buildTopicName(roadRegulatorID, intersectionID, "spat"), spat.toString());
broadcastMessage(buildTopicName(-1, intersectionID, "spat"), spat.toString());
}
}

Expand All @@ -57,7 +57,7 @@ public void broadcastMap(ProcessedMap<LineString> map) {
}

if (intersectionID != -1) {
broadcastMessage(buildTopicName(roadRegulatorID, intersectionID, "map"), map.toString());
broadcastMessage(buildTopicName(-1, intersectionID, "map"), map.toString());
}
}

Expand Down

0 comments on commit 4ff7cb5

Please sign in to comment.