private void handleTEworldEventserver(TEworldEventserver tee) {
log.debug("handleTEworldEventserver");
if(tee.tReceiveEnvironmentEvents != null) {
log.debug("tee.tReceiveAllEventsAt != null");
TEworldEventserver response = new TEworldEventserver();
Point2D.Double longLat = tee.tReceiveEnvironmentEvents.positionLongLat;
if(tee.tReceiveEnvironmentEvents.edgePosition != null) {
longLat = getLongLatPosition(
tee.tReceiveEnvironmentEvents.edgePosition
);
}
response.tEnvironmentEvents =
getTEnvironmentEvents(
tee.tReceiveEnvironmentEvents.types,
longLat,
tee.tReceiveEnvironmentEvents.startTime,
tee.tReceiveEnvironmentEvents.endTime
);
notifyTEworldEventserver(response);
}
if(tee.tReceiveRoadEvents != null) {
log.debug("tee.tReceiveRoadEvents != null");
TEworldEventserver response = new TEworldEventserver();
response.tRoadEvents =
getTRoadEvents(
tee.tReceiveRoadEvents.edgePosition,
tee.tReceiveRoadEvents.startTime,
tee.tReceiveRoadEvents.endTime
);
notifyTEworldEventserver(response);
}
if(tee.tReceiveNearestEdge != null) {
log.debug("tee.tReceiveNearestEdge != null");
TEworldEventserver response = new TEworldEventserver();
// find the nearest edge and get its distance
Pair<EdgeModel, Double> closestEdge =
Core.getInstance(null).getNearestEdge(
tee.tReceiveNearestEdge.positionLongLat.x,