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

Fixes for master to work with traffic-engine 0.3 #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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 pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<version>12.2</version>
</dependency>
<dependency>
<groupId>com.conveyal</groupId>
<groupId>io.opentraffic</groupId>
<artifactId>traffic-engine</artifactId>
<version>0.3</version>
</dependency>
Expand Down
62 changes: 34 additions & 28 deletions src/main/java/com/conveyal/traffic/app/TrafficEngineApp.java
Original file line number Diff line number Diff line change
@@ -1,45 +1,51 @@
package com.conveyal.traffic.app;

import java.awt.Rectangle;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.temporal.ChronoField;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;

import com.conveyal.traffic.app.data.StatsObject;
import com.conveyal.traffic.app.data.TrafficPath;
import com.conveyal.traffic.app.data.WeekObject;
import com.conveyal.traffic.app.data.WeeklyStatsObject;
import com.conveyal.traffic.app.engine.Engine;
import com.conveyal.traffic.data.SpatialDataItem;
import com.conveyal.traffic.data.stats.SummaryStatistics;
import com.conveyal.traffic.data.stats.SummaryStatisticsComparison;
import com.conveyal.traffic.geom.StreetSegment;
import com.conveyal.traffic.data.stats.SegmentStatistics;
import com.conveyal.traffic.app.routing.Routing;
import com.conveyal.traffic.app.tiles.TrafficTileRequest.DataTile;
import com.conveyal.traffic.app.tiles.TrafficTileRequest.SegmentTile;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.vividsolutions.jts.geom.Envelope;
import io.opentraffic.engine.data.SpatialDataItem;
import io.opentraffic.engine.data.pbf.ExchangeFormat;
import io.opentraffic.engine.data.stats.SegmentStatistics;
import io.opentraffic.engine.data.stats.SummaryStatistics;
import io.opentraffic.engine.data.stats.SummaryStatisticsComparison;
import io.opentraffic.engine.geom.GPSPoint;
import io.opentraffic.engine.geom.StreetSegment;
import org.mapdb.Fun;
import org.opentripplanner.common.model.GenericLocation;
import org.opentripplanner.routing.core.RoutingRequest;
import org.opentripplanner.routing.core.TraverseMode;
import org.opentripplanner.routing.core.TraverseModeSet;

import com.conveyal.traffic.data.pbf.ExchangeFormat;
import com.conveyal.traffic.geom.GPSPoint;
import com.conveyal.traffic.app.data.StatsObject;
import com.conveyal.traffic.app.routing.Routing;
import com.conveyal.traffic.app.tiles.TrafficTileRequest.DataTile;
import com.conveyal.traffic.app.tiles.TrafficTileRequest.SegmentTile;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.awt.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;

import static spark.Spark.*;
import static spark.Spark.get;
import static spark.Spark.post;
import static spark.Spark.staticFileLocation;

public class TrafficEngineApp {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/conveyal/traffic/app/data/TrafficPath.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.conveyal.traffic.app.data;

import com.conveyal.traffic.data.stats.SummaryStatistics;
import com.conveyal.traffic.geom.StreetSegment;
import io.opentraffic.engine.data.stats.SummaryStatistics;
import io.opentraffic.engine.geom.StreetSegment;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.conveyal.traffic.app.data;

import com.conveyal.traffic.data.stats.SummaryStatistics;
import com.conveyal.traffic.geom.StreetSegment;
import io.opentraffic.engine.data.stats.SummaryStatistics;
import io.opentraffic.engine.geom.StreetSegment;
import org.jcolorbrewer.ColorBrewer;
import org.opentripplanner.util.PolylineEncoder;
import org.opentripplanner.util.model.EncodedPolylineBean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.conveyal.traffic.app.data;

import com.conveyal.traffic.data.stats.SummaryStatistics;
import com.conveyal.traffic.data.stats.SummaryStatisticsComparison;
import io.opentraffic.engine.data.stats.SummaryStatistics;
import io.opentraffic.engine.data.stats.SummaryStatisticsComparison;

public class WeeklyStatsObject {

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/conveyal/traffic/app/engine/Engine.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.conveyal.traffic.app.engine;

import com.conveyal.traffic.app.TrafficEngineApp;
import com.vividsolutions.jts.geom.Point;
import io.opentraffic.engine.TrafficEngine;
import io.opentraffic.engine.geom.GPSPoint;
import io.opentraffic.engine.osm.OSMArea;

import java.io.File;
import java.util.*;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.conveyal.traffic.TrafficEngine;
import com.conveyal.traffic.app.TrafficEngineApp;
import com.conveyal.traffic.geom.GPSPoint;
import com.conveyal.traffic.osm.OSMArea;
import com.vividsolutions.jts.geom.Point;


public class Engine {

Expand Down Expand Up @@ -38,7 +38,7 @@ public Engine() {

Integer numberOfWorkerCores;
try {
numberOfWorkerCores = Integer.parseInt(TrafficEngineApp.appProps.getProperty("writeStatistics"));
numberOfWorkerCores = Integer.parseInt(TrafficEngineApp.appProps.getProperty("application.numberOfWorkerCores"));
} catch(Exception e) {
numberOfWorkerCores = Runtime.getRuntime().availableProcessors() / 2;
log.log(Level.INFO, "Property numberOfWorkerCores not set, defaulting to " + numberOfWorkerCores + " cores.");
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/conveyal/traffic/app/routing/Routing.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


import com.beust.jcommander.internal.Maps;
import com.conveyal.traffic.data.SpatialDataItem;
import com.conveyal.traffic.geom.StreetSegment;
import com.conveyal.traffic.data.stats.SummaryStatistics;
import io.opentraffic.engine.data.SpatialDataItem;
import io.opentraffic.engine.geom.StreetSegment;
import io.opentraffic.engine.data.stats.SummaryStatistics;
import com.conveyal.traffic.app.TrafficEngineApp;
import com.google.common.collect.Lists;
import com.vividsolutions.jts.geom.Envelope;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.conveyal.traffic.app.tiles;

import com.conveyal.traffic.data.SpatialDataItem;
import com.conveyal.traffic.data.stats.SummaryStatisticsComparison;
import com.conveyal.traffic.geom.StreetSegment;
import com.conveyal.traffic.data.stats.SummaryStatistics;
import io.opentraffic.engine.data.SpatialDataItem;
import io.opentraffic.engine.data.stats.SummaryStatisticsComparison;
import io.opentraffic.engine.geom.StreetSegment;
import io.opentraffic.engine.data.stats.SummaryStatistics;
import com.conveyal.traffic.app.TrafficEngineApp;
import com.google.common.base.Charsets;
import com.google.common.hash.HashCode;
Expand Down