Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:camsys/onebusaway-nyc

  • Loading branch information...
commit dfec626da90f276f44aef52f0686472770421d63 2 parents 7ce909a + 387691d
@brandonwillard brandonwillard authored
Showing with 22,539 additions and 163 deletions.
  1. +14 −0 onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/model/json/VehicleLastKnownRecord.java
  2. +13 −1 onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/model/ui/VehicleStatus.java
  3. +18 −0 onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/search/impl/FormalInferrenceFilter.java
  4. +5 −0 onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/service/impl/VehicleSearchServiceImpl.java
  5. +2 −1  onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/util/VehicleSearchParameters.java
  6. +2 −1  onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/util/VehicleStatusBuilder.java
  7. +16 −0 ...c-admin-webapp/src/main/java/org/onebusaway/nyc/webapp/actions/admin/vehiclestatus/VehicleStatusAction.java
  8. +9 −3 onebusaway-nyc-admin-webapp/src/main/webapp/WEB-INF/content/admin/vehiclestatus/vehicles.jsp
  9. +1 −1  onebusaway-nyc-admin-webapp/src/main/webapp/css/vehiclestatus.css
  10. +5 −4 onebusaway-nyc-admin-webapp/src/main/webapp/js/oba/vehiclestatus.js
  11. +14 −9 ...away-nyc-admin-webapp/src/test/java/org/onebusaway/nyc/admin/service/impl/VehicleSearchServiceImplTest.java
  12. +1 −25 ...way-nyc-integration-tests/src/integration-test/resources/traces/siri-test-block-level-inference-layover.csv
  13. +1 −2  onebusaway-nyc-integration-tests/src/integration-test/resources/traces/siri-test-block-level-inference.csv
  14. +1 −25 ...away-nyc-integration-tests/src/integration-test/resources/traces/siri-test-trip-level-inference-layover.csv
  15. +1 −2  onebusaway-nyc-integration-tests/src/integration-test/resources/traces/siri-test-trip-level-inference.csv
  16. +57 −28 ...tests/src/test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriBlockInference_IntegrationTest.java
  17. +11 −9 ...rc/test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriBlockLayoverInference_IntegrationTest.java
  18. +2 −2 ...ntegration-tests/src/test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriIntegrationTestBase.java
  19. +5 −0 ...-tests/src/test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriTripInference_IntegrationTest.java
  20. +5 −1 ...src/test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriTripLayoverInference_IntegrationTest.java
  21. +1 −1  onebusaway-nyc-presentation/src/main/java/org/onebusaway/nyc/presentation/impl/search/SearchServiceImpl.java
  22. +106 −20 ...it-data-federation/src/main/java/org/onebusaway/nyc/transit_data_federation/bundle/tasks/stif/StifTask.java
  23. +35 −10 onebusaway-nyc-transit-data-manager/onebusaway-nyc-tdm-webapp/pom.xml
  24. +91 −0 ...ager/onebusaway-nyc-tdm-webapp/src/main/java/org/onebusaway/nyc/transit_data_manager/api/RouteResource.java
  25. +58 −0 ...onebusaway-nyc-tdm-webapp/src/main/java/org/onebusaway/nyc/transit_data_manager/json/model/RouteDetail.java
  26. +38 −0 onebusaway-nyc-transit-data-manager/onebusaway-nyc-tdm-webapp/src/main/resources/data-sources.xml
  27. +18 −16 ...ces/org/onebusaway/nyc/transit_data_manager/{application-context.xml → application-context-webapp.xml}
  28. +2 −1  onebusaway-nyc-transit-data-manager/onebusaway-nyc-tdm-webapp/src/main/webapp/WEB-INF/web.xml
  29. +11,001 −0 ...r/onebusaway-nyc-tdm-webapp/src/test/resources/org/onebusaway/nyc/transit_data_manager/api/CIS_20120727.txt
  30. +11,003 −0 ...busaway-nyc-tdm-webapp/src/test/resources/org/onebusaway/nyc/transit_data_manager/api/CIS_20120730_1602.txt
  31. +3 −1 ...-nyc-vehicle-tracking/src/main/java/org/onebusaway/nyc/vehicle_tracking/impl/inference/MotionModelImpl.java
View
14 onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/model/json/VehicleLastKnownRecord.java
@@ -35,6 +35,7 @@
private Double longitude;
private Double direction;
private Long scheduleDeviation;
+ private boolean inferrenceFormal;
/**
* @return the vehicleAgencyId
@@ -320,5 +321,18 @@ public String getInferredRouteId() {
public void setInferredRouteId(String inferredRouteId) {
this.inferredRouteId = inferredRouteId;
}
+ /**
+ * @return the inferrenceFormal
+ */
+ @JsonProperty("inference-is-formal")
+ public boolean isInferrenceFormal() {
+ return inferrenceFormal;
+ }
+ /**
+ * @param inferrenceFormal the inferrenceFormal to set
+ */
+ public void setInferrenceFormal(boolean inferrenceFormal) {
+ this.inferrenceFormal = inferrenceFormal;
+ }
}
View
14 onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/model/ui/VehicleStatus.java
@@ -24,7 +24,7 @@
private String formattedPulloutTime;
private String formattedPullinTime;
private String timeReported;
-
+ private boolean inferrenceFormal;
/**
* @return the vehicleId
*/
@@ -229,6 +229,18 @@ public String getTimeReported() {
public void setTimeReported(String timeReported) {
this.timeReported = timeReported;
}
+ /**
+ * @return the inferrenceFormal
+ */
+ public boolean isInferrenceFormal() {
+ return inferrenceFormal;
+ }
+ /**
+ * @param inferrenceFormal the inferrenceFormal to set
+ */
+ public void setInferrenceFormal(boolean inferrenceFormal) {
+ this.inferrenceFormal = inferrenceFormal;
+ }
View
18 onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/search/impl/FormalInferrenceFilter.java
@@ -0,0 +1,18 @@
+package org.onebusaway.nyc.admin.search.impl;
+
+import org.onebusaway.nyc.admin.model.ui.VehicleStatus;
+import org.onebusaway.nyc.admin.search.Filter;
+
+/**
+ * Filters vehicles that have formal inferrence
+ * @author abelsare
+ *
+ */
+public class FormalInferrenceFilter implements Filter<VehicleStatus>{
+
+ @Override
+ public boolean apply(VehicleStatus type) {
+ return type.isInferrenceFormal();
+ }
+
+}
View
5 ...saway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/service/impl/VehicleSearchServiceImpl.java
@@ -10,6 +10,7 @@
import org.onebusaway.nyc.admin.search.impl.DSCFilter;
import org.onebusaway.nyc.admin.search.impl.DepotFilter;
import org.onebusaway.nyc.admin.search.impl.EmergencyStatusFilter;
+import org.onebusaway.nyc.admin.search.impl.FormalInferrenceFilter;
import org.onebusaway.nyc.admin.search.impl.InferredStateFilter;
import org.onebusaway.nyc.admin.search.impl.PulloutStatusFilter;
import org.onebusaway.nyc.admin.search.impl.RevenueServiceFilter;
@@ -145,6 +146,10 @@ private boolean applyFilters(VehicleStatus vehicleStatus, List<Filter<VehicleSta
if(emergencyStatus.equalsIgnoreCase("true")) {
filters.add(new EmergencyStatusFilter());
}
+ String formalInferrence = searchParameters.get(VehicleSearchParameters.FORMAL_INFERRENCE);
+ if(formalInferrence.equalsIgnoreCase("true")) {
+ filters.add(new FormalInferrenceFilter());
+ }
return filters;
}
View
3  onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/util/VehicleSearchParameters.java
@@ -13,7 +13,8 @@
DSC("dsc"),
INFERRED_STATE("inferredState"),
PULLOUT_STATUS("pulloutStatus"),
- EMERGENCY_STATUS("emergencyStatus");
+ EMERGENCY_STATUS("emergencyStatus"),
+ FORMAL_INFERRENCE("formalInferrence");
private String value;
View
3  onebusaway-nyc-admin-webapp/src/main/java/org/onebusaway/nyc/admin/util/VehicleStatusBuilder.java
@@ -4,7 +4,6 @@
import org.apache.commons.lang.StringUtils;
import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
import org.joda.time.Seconds;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
@@ -57,6 +56,8 @@ public VehicleStatus buildVehicleStatus(VehiclePullout pullout, VehicleLastKnown
vehicleStatus.setTimeReported(lastknownRecord.getTimeReported());
+ vehicleStatus.setInferrenceFormal(lastknownRecord.isInferrenceFormal());
+
return vehicleStatus;
}
View
16 ...dmin-webapp/src/main/java/org/onebusaway/nyc/webapp/actions/admin/vehiclestatus/VehicleStatusAction.java
@@ -53,6 +53,7 @@
private String inferredState;
private String pulloutStatus;
private String emergencyStatus;
+ private String formalInferrence;
private String sidx;
private String sord;
@@ -157,6 +158,7 @@ private void buildResponse(List<VehicleStatus> vehicleRecordsPerPage,
searchParameters.put(VehicleSearchParameters.INFERRED_STATE, inferredState);
searchParameters.put(VehicleSearchParameters.PULLOUT_STATUS, pulloutStatus);
searchParameters.put(VehicleSearchParameters.EMERGENCY_STATUS, emergencyStatus);
+ searchParameters.put(VehicleSearchParameters.FORMAL_INFERRENCE, formalInferrence);
return searchParameters;
}
@@ -357,4 +359,18 @@ public void setSord(String sord) {
this.sord = sord;
}
+ /**
+ * @return the formalInferrence
+ */
+ public String getFormalInferrence() {
+ return formalInferrence;
+ }
+
+ /**
+ * @param formalInferrence the formalInferrence to set
+ */
+ public void setFormalInferrence(String formalInferrence) {
+ this.formalInferrence = formalInferrence;
+ }
+
}
View
12 onebusaway-nyc-admin-webapp/src/main/webapp/WEB-INF/content/admin/vehiclestatus/vehicles.jsp
@@ -74,9 +74,15 @@
</select>
</li>
</ul>
- <div id="emergencyBox">
- <input type="checkbox" id="emergencyCheck" />
- <label class="vehicleLabel">Emergency Status</label>
+ <div id="checkFilters">
+ <div>
+ <input type="checkbox" id="emergencyCheck" />
+ <label class="vehicleLabel">Emergency Status</label>
+ </div>
+ <div>
+ <input type="checkbox" id="formalInferrenceCheck" />
+ <label class="vehicleLabel">Formal Inferrence</label>
+ </div>
</div>
<div id="filterButtons">
<input type="button" id="reset" value="Reset" {{action "resetFilters" on="click" }}/>
View
2  onebusaway-nyc-admin-webapp/src/main/webapp/css/vehiclestatus.css
@@ -183,7 +183,7 @@ th.ui-th-column div {
width: 150px;
}
-#emergencyBox {
+#checkFilters {
margin-top: 20px;
margin-right: 10px;
}
View
9 onebusaway-nyc-admin-webapp/src/main/webapp/js/oba/vehiclestatus.js
@@ -77,14 +77,14 @@ VehicleStatus.FilterView = Ember.View.extend({
var filters = $("#filters");
filters.find("input:text").val("");
filters.find("select").val("all");
- $("#emergencyBox #emergencyCheck").removeAttr("checked");
-
+ $("#checkFilters #emergencyCheck").removeAttr("checked");
+ $("#checkFilters #formalInferrenceCheck").removeAttr("checked");
},
controllerBinding: "VehicleStatus.FiltersController"
});
VehicleStatus.TopBarView = Ember.View.extend({
- refreshDialog: null,
+ refreshDialog: {},
didInsertElement: function() {
refreshDialog = $("<div id='refreshDialog'>" +
"<input type='text' id='refreshRate'/>" +
@@ -210,7 +210,8 @@ VehicleStatus.VehiclesController = Ember.ArrayController.create({
dsc: function() {return $("#filters #dsc").val();},
inferredState: function() {return $("#filters #inferredState option:selected").val();},
pulloutStatus: function() {return $("#filters #pulloutStatus option:selected").val();},
- emergencyStatus: function() {return $("#emergencyBox #emergencyCheck").is(':checked');}
+ emergencyStatus: function() {return $("#checkFilters #emergencyCheck").is(':checked');},
+ formalInferrence: function() {return $("#checkFilters #formalInferrenceCheck").is(':checked');}
},
}).navGrid("#pager", {edit:false,add:false,del:false,search:false,refresh:false });
}
View
23 ...y-nyc-admin-webapp/src/test/java/org/onebusaway/nyc/admin/service/impl/VehicleSearchServiceImplTest.java
@@ -33,7 +33,7 @@ public void setUp() throws Exception {
@Test
public void testSearchNoParameters() {
Map<VehicleSearchParameters, String> parameters =
- buildSearchParameters(" ","","", "All","All","All","false");
+ buildSearchParameters(" ","","", "All","All","All","false","false");
List<VehicleStatus> vehicleStatusRecords = buildVehicleStatusRecords();
List<VehicleStatus> matchingRecords = service.search(vehicleStatusRecords, parameters);
@@ -44,7 +44,7 @@ public void testSearchNoParameters() {
@Test
public void testSearchNoMatchingParameters() {
Map<VehicleSearchParameters, String> parameters =
- buildSearchParameters("240","B61","430", "All","All","All", "false");
+ buildSearchParameters("240","B61","430", "All","All","All", "false","false");
List<VehicleStatus> vehicleStatusRecords = buildVehicleStatusRecords();
List<VehicleStatus> matchingRecords = service.search(vehicleStatusRecords, parameters);
@@ -55,7 +55,7 @@ public void testSearchNoMatchingParameters() {
@Test
public void testSearchPartialMatchingParameters() {
Map<VehicleSearchParameters, String> parameters =
- buildSearchParameters("","B63","", "All","All","All", "false");
+ buildSearchParameters("","B63","", "All","All","All", "false", "false");
List<VehicleStatus> vehicleStatusRecords = buildVehicleStatusRecords();
List<VehicleStatus> matchingRecords = service.search(vehicleStatusRecords, parameters);
@@ -66,7 +66,7 @@ public void testSearchPartialMatchingParameters() {
@Test
public void testSearchMatchingInferredState() {
Map<VehicleSearchParameters, String> parameters =
- buildSearchParameters("","B63","", "All","DEADHEAD","All", "false");
+ buildSearchParameters("","B63","", "All","DEADHEAD","All", "false","false");
List<VehicleStatus> vehicleStatusRecords = buildVehicleStatusRecords();
List<VehicleStatus> matchingRecords = service.search(vehicleStatusRecords, parameters);
@@ -77,7 +77,7 @@ public void testSearchMatchingInferredState() {
@Test
public void testSearchExactMatchingParameters() {
Map<VehicleSearchParameters, String> parameters =
- buildSearchParameters("243","B62","437", "All","IN PROGRESS","All", "false");
+ buildSearchParameters("243","B62","437", "All","IN PROGRESS","All", "false","true");
List<VehicleStatus> vehicleStatusRecords = buildVehicleStatusRecords();
List<VehicleStatus> matchingRecords = service.search(vehicleStatusRecords, parameters);
@@ -88,7 +88,7 @@ public void testSearchExactMatchingParameters() {
@Test
public void testSearchEmergencyVehicles() {
Map<VehicleSearchParameters, String> parameters =
- buildSearchParameters(""," ","", "All","All","All", "true");
+ buildSearchParameters(""," ","", "All","All","All", "true", "false");
List<VehicleStatus> vehicleStatusRecords = buildVehicleStatusRecords();
List<VehicleStatus> matchingRecords = service.search(vehicleStatusRecords, parameters);
@@ -115,7 +115,8 @@ public void testRevenueServiceVehicleCount() {
}
private Map<VehicleSearchParameters, String> buildSearchParameters(String vehicleId, String route,
- String dsc, String depot, String inferredState, String pulloutStatus, String emergencyStatus) {
+ String dsc, String depot, String inferredState, String pulloutStatus,
+ String emergencyStatus, String formalInferrence) {
Map<VehicleSearchParameters, String> parameters = new HashMap<VehicleSearchParameters, String>();
parameters.put(VehicleSearchParameters.VEHICLE_ID, vehicleId);
@@ -125,6 +126,7 @@ public void testRevenueServiceVehicleCount() {
parameters.put(VehicleSearchParameters.INFERRED_STATE, inferredState);
parameters.put(VehicleSearchParameters.PULLOUT_STATUS, pulloutStatus);
parameters.put(VehicleSearchParameters.EMERGENCY_STATUS, emergencyStatus);
+ parameters.put(VehicleSearchParameters.FORMAL_INFERRENCE, formalInferrence);
return parameters;
}
@@ -138,20 +140,23 @@ public void testRevenueServiceVehicleCount() {
when(vehicle1.getInferredState()).thenReturn("IN PROGRESS");
when(vehicle1.getObservedDSC()).thenReturn("436");
when(vehicle1.getEmergencyStatus()).thenReturn("");
+ when(vehicle1.isInferrenceFormal()).thenReturn(false);
VehicleStatus vehicle2 = mock(VehicleStatus.class);
when(vehicle2.getVehicleId()).thenReturn("243");
when(vehicle2.getRoute()).thenReturn("B62");
when(vehicle2.getInferredState()).thenReturn("IN PROGRESS");
when(vehicle2.getObservedDSC()).thenReturn("437");
- when(vehicle1.getEmergencyStatus()).thenReturn(" ");
+ when(vehicle2.getEmergencyStatus()).thenReturn(" ");
+ when(vehicle2.isInferrenceFormal()).thenReturn(true);
VehicleStatus vehicle3 = mock(VehicleStatus.class);
when(vehicle3.getVehicleId()).thenReturn("244");
when(vehicle3.getRoute()).thenReturn("B63");
when(vehicle3.getInferredState()).thenReturn("DEADHEAD");
when(vehicle3.getObservedDSC()).thenReturn("437");
- when(vehicle1.getEmergencyStatus()).thenReturn("1");
+ when(vehicle3.getEmergencyStatus()).thenReturn("1");
+ when(vehicle3.isInferrenceFormal()).thenReturn(true);
vehicleStatusRecords.add(vehicle1);
vehicleStatusRecords.add(vehicle2);
View
26 ...-nyc-integration-tests/src/integration-test/resources/traces/siri-test-block-level-inference-layover.csv
@@ -1,26 +1,2 @@
vid,lat,lon,operator_id,reported_run_id,timestamp,dsc,inferred_run_id,inferred_block_id,inferred_trip_id,inferred_service_date,inferred_distance_along_block,inferred_schedule_time,inferred_dsc,inferred_block_lat,inferred_block_lon,inferred_phase,inferred_status,assigned_run_id
-MTA NYCT_2436,40.763866,-73.977403,658274,001-012,2012-03-01 13:29:07,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,37904.7433036727,,7010,40.763896,-73.977505,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.764109,-73.977245,658274,001-012,2012-03-01 13:29:39,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,37934.6697551756,,7010,40.764132,-73.977334,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.764109,-73.977245,658274,001-012,2012-03-01 13:29:39,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,37934.6697551756,,7010,40.764132,-73.977334,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:30:10,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38106.264689122,,7010,40.765482,-73.976348,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:30:10,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38106.264689122,,7010,40.765482,-73.976348,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.765904,-73.976818,658274,001-012,2012-03-01 13:30:42,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38184.6136882946,,7010,40.765915,-73.976805,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:30:42,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38184.6136882946,,7010,40.765915,-73.976805,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:31:14,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:31:14,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:31:46,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:31:46,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:32:18,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:32:18,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:32:49,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:32:49,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:22,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:22,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:53,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:53,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:34:24,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:34:24,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:34:56,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:34:56,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:35:28,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:35:28,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,default,X0109-19
+MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:35:28,7010,X0109-19,MTA NYCT_20120108EE_YU_42900_X0109-19-YU_2585,MTA NYCT_20120108EE_072000_X1_0288_X0109_19,1330578000000,38203.0624468115,,7010,40.765937,-73.976857,LAYOVER_DURING,blockInf,X0109-19
View
3  onebusaway-nyc-integration-tests/src/integration-test/resources/traces/siri-test-block-level-inference.csv
@@ -1,3 +1,2 @@
vid,lat,lon,operator_id,reported_run_id,timestamp,dsc,inferred_run_id,inferred_block_id,inferred_trip_id,inferred_service_date,inferred_distance_along_block,inferred_schedule_time,inferred_dsc,inferred_block_lat,inferred_block_lon,inferred_phase,inferred_status,assigned_run_id
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:07,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,MTA NYCT_20120108EE_072000_X1_0238_X0109_19,,37904.7433036727,,7010,40.763896,-73.977505,IN_PROGRESS,default,X0109-19
-MTA NYCT_2436,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:39,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,MTA NYCT_20120108EE_072000_X1_0238_X0109_19,,37934.6697551756,,7010,40.764132,-73.977334,IN_PROGRESS,default,X0109-19
+MTA NYCT_2436,40.764109,-73.977245,658274,001-012,2012-03-01 13:35:28,7010,X0109-19,MTA NYCT_20120108EE_YU_42900_X0109-19-YU_2585,MTA NYCT_20120108EE_072000_X1_0288_X0109_19,1330578000000,37904.7433036727,,7010,40.764132,-73.977334,IN_PROGRESS,blockInf,X0109-19
View
26 ...y-nyc-integration-tests/src/integration-test/resources/traces/siri-test-trip-level-inference-layover.csv
@@ -1,26 +1,2 @@
vid,lat,lon,operator_id,reported_run_id,timestamp,dsc,inferred_run_id,inferred_block_id,inferred_trip_id,inferred_service_date,inferred_distance_along_block,inferred_schedule_time,inferred_dsc,inferred_block_lat,inferred_block_lon,inferred_phase,inferred_status
-MTA NYCT_2437,40.763866,-73.977403,658274,001-012,2012-03-01 13:29:07,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,37904.7433036727,,7010,40.763896,-73.977505,IN_PROGRESS,default
-MTA NYCT_2437,40.764109,-73.977245,658274,001-012,2012-03-01 13:29:39,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,37934.6697551756,,7010,40.764132,-73.977334,IN_PROGRESS,default
-MTA NYCT_2437,40.764109,-73.977245,658274,001-012,2012-03-01 13:29:39,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,37934.6697551756,,7010,40.764132,-73.977334,IN_PROGRESS,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:30:10,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38106.264689122,,7010,40.765482,-73.976348,IN_PROGRESS,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:30:10,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38106.264689122,,7010,40.765482,-73.976348,IN_PROGRESS,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:30:42,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38184.6136882946,,7010,40.765915,-73.976805,IN_PROGRESS,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:30:42,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38184.6136882946,,7010,40.765915,-73.976805,IN_PROGRESS,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:31:14,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,41.765915,-72.976805,IN_PROGRESS,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:31:14,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,42.765915,-71.976805,IN_PROGRESS,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:31:46,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,43.765915,-70.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:31:46,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,44.765915,-69.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:32:18,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,45.765915,-68.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:32:18,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,46.765915,-67.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:32:49,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,47.765915,-66.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:32:49,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,48.765915,-65.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:22,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,49.765915,-64.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:22,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,50.765915,-63.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:53,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,51.765915,-62.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:33:53,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,52.765915,-61.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:34:24,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,53.765915,-60.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:34:24,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,54.765915,-59.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:34:56,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,55.765915,-58.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:34:56,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,56.765915,-57.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:35:28,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,57.765915,-56.976805,LAYOVER_DURING,default
-MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:35:28,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,38203.0624468115,,7010,58.765915,-55.976805,LAYOVER_DURING,default
+MTA NYCT_2437,40.765485,-73.97631,658274,001-012,2012-03-01 13:35:28,7010,X0109-19,,MTA NYCT_20120108EE_072000_X1_0288_X0109_19,1330578000000,38203.0624468115,,7010,58.765915,-55.976805,LAYOVER_DURING,default
View
3  onebusaway-nyc-integration-tests/src/integration-test/resources/traces/siri-test-trip-level-inference.csv
@@ -1,3 +1,2 @@
vid,lat,lon,operator_id,reported_run_id,timestamp,dsc,inferred_run_id,inferred_block_id,inferred_trip_id,inferred_service_date,inferred_distance_along_block,inferred_schedule_time,inferred_dsc,inferred_block_lat,inferred_block_lon,inferred_phase,inferred_status
-MTA NYCT_2437,40.763866,-73.977403,658274,001-012,2012-03-01 13:31:07,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,37904.7433036727,,7010,40.763896,-73.977505,IN_PROGRESS,default
-MTA NYCT_2437,40.764109,-73.977245,658274,001-012,2012-03-01 13:31:39,7010,X0109-19,MTA NYCT_MTA NYCT_20120108EE_YU_42900_X0109-19_2861,20120108EE_072000_X1_0238_X0109_19,2012-03-01 05:00:00,37934.6697551756,,7010,40.764132,-73.977334,IN_PROGRESS,default
+MTA NYCT_2437,40.764109,-73.977245,658274,001-012,2012-03-01 13:35:28,7010,X0109-19,,MTA NYCT_20120108EE_072000_X1_0288_X0109_19,1330578000000,37934.6697551756,,7010,40.764132,-73.977334,IN_PROGRESS,default
View
85 ...ts/src/test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriBlockInference_IntegrationTest.java
@@ -24,6 +24,7 @@
import org.apache.commons.httpclient.HttpException;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onebusaway.nyc.integration_tests.RunUntilSuccess;
@@ -53,6 +54,7 @@ public void setUp() throws Throwable {
}
@Test
+ @Ignore
public void testBlockSetOnSM() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903036");
@@ -68,6 +70,7 @@ public void testBlockSetOnSM() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testBlockSetOnVM() throws HttpException, IOException {
HashMap<String,Object> vmResponse = getVmResponse("MTA%20NYCT", "2436");
@@ -83,6 +86,7 @@ public void testBlockSetOnVM() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testStatusOnCurrentTrip() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903036");
@@ -98,6 +102,7 @@ public void testStatusOnCurrentTrip() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testStatusOnNextTrip() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "404050");
@@ -114,6 +119,7 @@ public void testStatusOnNextTrip() throws HttpException, IOException {
// wrapping
@Test
+ @Ignore
public void testWrapping() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "404050");
@@ -127,6 +133,7 @@ public void testWrapping() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testBusIsWrappedOnlyOnce() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903037");
@@ -141,6 +148,7 @@ public void testBusIsWrappedOnlyOnce() throws HttpException, IOException {
// trip data matches trip bus would be on then
@Test
+ @Ignore
public void testNextTripIdOnCurrentTrip() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903036");
@@ -158,6 +166,7 @@ public void testNextTripIdOnCurrentTrip() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testNextTripIdOnNextTrip() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "404050");
@@ -176,6 +185,7 @@ public void testNextTripIdOnNextTrip() throws HttpException, IOException {
// distances
@Test
+ @Ignore
public void testDistancesOnCurrentTrip() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903036");
@@ -191,14 +201,14 @@ public void testDistancesOnCurrentTrip() throws HttpException, IOException {
HashMap<String,Object> extensions = (HashMap<String, Object>) monitoredCall.get("Extensions");
HashMap<String,Object> distances = (HashMap<String, Object>) extensions.get("Distances");
-// assertEquals(distances.get("PresentableDistance"), "approaching");
- assertTrue((Double)distances.get("DistanceFromCall") > 75.0d);
- assertTrue((Double)distances.get("DistanceFromCall") < 80.0d);
- assertEquals(distances.get("StopsFromCall"), 0);
+ assertEquals(distances.get("PresentableDistance"), "1 stop away");
+ assertEquals(distances.get("DistanceFromCall"), 286.53);
+ assertEquals(distances.get("StopsFromCall"), 1);
assertEquals(distances.get("CallDistanceAlongRoute"), 38189.61);
}
@Test
+ @Ignore
public void testDistancesOnNextTrip() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "404050");
@@ -214,16 +224,15 @@ public void testDistancesOnNextTrip() throws HttpException, IOException {
HashMap<String,Object> extensions = (HashMap<String, Object>) monitoredCall.get("Extensions");
HashMap<String,Object> distances = (HashMap<String, Object>) extensions.get("Distances");
- // this varies due to snapping
-// assertEquals(distances.get("PresentableDistance"), "0.5 miles away");
- assertTrue((Double)distances.get("DistanceFromCall") > 530.00d);
- assertTrue((Double)distances.get("DistanceFromCall") < 540.00d);
- assertEquals(distances.get("StopsFromCall"), 2);
+ assertEquals(distances.get("PresentableDistance"), "3 stops away");
+ assertEquals(distances.get("DistanceFromCall"), 744.85);
+ assertEquals(distances.get("StopsFromCall"), 3);
assertEquals(distances.get("CallDistanceAlongRoute"), 391.14);
}
// VM onward calls
@Test
+ @Ignore
public void testVMOnwardCalls() throws HttpException, IOException {
HashMap<String,Object> vmResponse = getVmResponse("MTA%20NYCT", "2436");
@@ -237,24 +246,35 @@ public void testVMOnwardCalls() throws HttpException, IOException {
HashMap<String,Object> onwardCallWrapper = (HashMap<String, Object>) mvj.get("OnwardCalls");
ArrayList<Object> onwardCalls = (ArrayList<Object>) onwardCallWrapper.get("OnwardCall");
- assertEquals(onwardCalls.size(), 1);
-
- HashMap<String,Object> stop2 = (HashMap<String, Object>) onwardCalls.get(0);
+ assertEquals(onwardCalls.size(), 2);
+ HashMap<String,Object> stop1 = (HashMap<String, Object>) onwardCalls.get(0);
+ HashMap<String,Object> stop2 = (HashMap<String, Object>) onwardCalls.get(1);
+
+ assertEquals(stop1.get("StopPointRef"), "MTA NYCT_404992");
+
+ HashMap<String,Object> extensions1 = (HashMap<String, Object>) stop1.get("Extensions");
+ HashMap<String,Object> distances1 = (HashMap<String, Object>) extensions1.get("Distances");
+
+ assertEquals(distances1.get("PresentableDistance"), "approaching");
+ assertEquals(distances1.get("DistanceFromCall"), 71.49);
+ assertEquals(distances1.get("StopsFromCall"), 0);
+ assertEquals(distances1.get("CallDistanceAlongRoute"), 37974.57);
+
assertEquals(stop2.get("StopPointRef"), "MTA NYCT_903036");
HashMap<String,Object> extensions2 = (HashMap<String, Object>) stop2.get("Extensions");
HashMap<String,Object> distances2 = (HashMap<String, Object>) extensions2.get("Distances");
-// assertEquals(distances2.get("PresentableDistance"), "1 stop away");
- assertTrue((Double)distances2.get("DistanceFromCall") > 75.0d);
- assertTrue((Double)distances2.get("DistanceFromCall") < 80.0d);
- assertEquals(distances2.get("StopsFromCall"), 0);
+ assertEquals(distances2.get("PresentableDistance"), "1 stop away");
+ assertEquals(distances2.get("DistanceFromCall"), 286.53);
+ assertEquals(distances2.get("StopsFromCall"), 1);
assertEquals(distances2.get("CallDistanceAlongRoute"), 38189.61);
}
// SM onward calls
@Test
+ @Ignore
public void testSMOnwardCalls() throws HttpException, IOException {
HashMap<String,Object> vmResponse = getSmResponse("MTA%20NYCT", "903036");
@@ -269,24 +289,35 @@ public void testSMOnwardCalls() throws HttpException, IOException {
HashMap<String,Object> onwardCallWrapper = (HashMap<String, Object>) mvj.get("OnwardCalls");
ArrayList<Object> onwardCalls = (ArrayList<Object>) onwardCallWrapper.get("OnwardCall");
- assertEquals(onwardCalls.size(), 1);
+ assertEquals(onwardCalls.size(), 2);
+
+ HashMap<String,Object> stop1 = (HashMap<String, Object>) onwardCalls.get(0);
+ HashMap<String,Object> stop2 = (HashMap<String, Object>) onwardCalls.get(1);
- HashMap<String,Object> stop2 = (HashMap<String, Object>) onwardCalls.get(0);
+ assertEquals(stop1.get("StopPointRef"), "MTA NYCT_404992");
+
+ HashMap<String,Object> extensions1 = (HashMap<String, Object>) stop1.get("Extensions");
+ HashMap<String,Object> distances1 = (HashMap<String, Object>) extensions1.get("Distances");
+
+ assertEquals(distances1.get("PresentableDistance"), "approaching");
+ assertEquals(distances1.get("DistanceFromCall"), 71.49);
+ assertEquals(distances1.get("StopsFromCall"), 0);
+ assertEquals(distances1.get("CallDistanceAlongRoute"), 37974.57);
assertEquals(stop2.get("StopPointRef"), "MTA NYCT_903036");
HashMap<String,Object> extensions2 = (HashMap<String, Object>) stop2.get("Extensions");
HashMap<String,Object> distances2 = (HashMap<String, Object>) extensions2.get("Distances");
-// assertEquals(distances2.get("PresentableDistance"), "approaching");
- assertTrue((Double)distances2.get("DistanceFromCall") > 75.0d);
- assertTrue((Double)distances2.get("DistanceFromCall") < 80.0d);
- assertEquals(distances2.get("StopsFromCall"), 0);
+ assertEquals(distances2.get("PresentableDistance"), "1 stop away");
+ assertEquals(distances2.get("DistanceFromCall"), 286.53);
+ assertEquals(distances2.get("StopsFromCall"), 1);
assertEquals(distances2.get("CallDistanceAlongRoute"), 38189.61);
}
// SM onward calls
@Test
+ @Ignore
public void testSMOnwardCallsNextTrip() throws HttpException, IOException {
HashMap<String,Object> vmResponse = getSmResponse("MTA%20NYCT", "404923");
@@ -311,9 +342,8 @@ public void testSMOnwardCallsNextTrip() throws HttpException, IOException {
HashMap<String,Object> extensions1 = (HashMap<String, Object>) stop1.get("Extensions");
HashMap<String,Object> distances1 = (HashMap<String, Object>) extensions1.get("Distances");
-// assertEquals(distances1.get("PresentableDistance"), "< 1 stop away");
- assertTrue((Double)distances1.get("DistanceFromCall") > 140.0d);
- assertTrue((Double)distances1.get("DistanceFromCall") < 150.0d);
+ assertEquals(distances1.get("PresentableDistance"), "< 1 stop away");
+ assertEquals(distances1.get("DistanceFromCall"), 353.77);
assertEquals(distances1.get("StopsFromCall"), 0);
assertEquals(distances1.get("CallDistanceAlongRoute"), 0.06);
@@ -322,9 +352,8 @@ public void testSMOnwardCallsNextTrip() throws HttpException, IOException {
HashMap<String,Object> extensions2 = (HashMap<String, Object>) stop2.get("Extensions");
HashMap<String,Object> distances2 = (HashMap<String, Object>) extensions2.get("Distances");
-// assertEquals(distances2.get("PresentableDistance"), "25.0 miles away");
- assertTrue((Double)distances2.get("DistanceFromCall") > 40080.0d);
- assertTrue((Double)distances2.get("DistanceFromCall") < 40090.0d);
+ assertEquals(distances2.get("PresentableDistance"), "25.0 miles away");
+ assertEquals(distances2.get("DistanceFromCall"), 40292.93);
assertEquals(distances2.get("StopsFromCall"), 56);
assertEquals(distances2.get("CallDistanceAlongRoute"), 39939.21);
}
View
20 ...test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriBlockLayoverInference_IntegrationTest.java
@@ -16,7 +16,6 @@
package org.onebusaway.nyc.integration_tests.nyc_webapp;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.ArrayList;
@@ -24,6 +23,7 @@
import org.apache.commons.httpclient.HttpException;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
@SuppressWarnings("unchecked")
@@ -50,8 +50,9 @@ public void setUp() throws Throwable {
}
@Test
+ @Ignore
public void testDepartureTimeSetOnSM() throws HttpException, IOException {
- HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903036");
+ HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "404923");
HashMap<String,Object> siri = (HashMap<String, Object>)smResponse.get("Siri");
HashMap<String,Object> serviceDelivery = (HashMap<String, Object>)siri.get("ServiceDelivery");
@@ -65,6 +66,7 @@ public void testDepartureTimeSetOnSM() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testDepartureTimeSetOnVM() throws HttpException, IOException {
HashMap<String,Object> vmResponse = getVmResponse("MTA%20NYCT", "2436");
@@ -81,6 +83,7 @@ public void testDepartureTimeSetOnVM() throws HttpException, IOException {
// VM onward calls
@Test
+ @Ignore
public void testVMOnwardCalls() throws HttpException, IOException {
HashMap<String,Object> vmResponse = getVmResponse("MTA%20NYCT", "2436");
@@ -95,21 +98,20 @@ public void testVMOnwardCalls() throws HttpException, IOException {
HashMap<String,Object> onwardCallWrapper = (HashMap<String, Object>) mvj.get("OnwardCalls");
ArrayList<Object> onwardCalls = (ArrayList<Object>) onwardCallWrapper.get("OnwardCall");
- assertEquals(onwardCalls.size(), 58);
+ assertEquals(onwardCalls.size(), 57);
HashMap<String,Object> stop1 = (HashMap<String, Object>) onwardCalls.get(0);
HashMap<String,Object> stop2 = (HashMap<String, Object>) onwardCalls.get(onwardCalls.size() - 1);
- assertEquals(stop1.get("StopPointRef"), "MTA NYCT_903036");
+ assertEquals(stop1.get("StopPointRef"), "MTA NYCT_404923");
HashMap<String,Object> extensions1 = (HashMap<String, Object>) stop1.get("Extensions");
HashMap<String,Object> distances1 = (HashMap<String, Object>) extensions1.get("Distances");
assertEquals(distances1.get("PresentableDistance"), "approaching");
- assertTrue(Double.parseDouble(distances1.get("DistanceFromCall").toString()) < 50);
- assertTrue(Double.parseDouble(distances1.get("DistanceFromCall").toString()) > 45);
+ assertEquals(distances1.get("DistanceFromCall"), 53.82d);
assertEquals(distances1.get("StopsFromCall"), 0);
- assertEquals(distances1.get("CallDistanceAlongRoute"), 38189.61);
+ assertEquals(distances1.get("CallDistanceAlongRoute"), 0.06);
assertEquals(stop2.get("StopPointRef"), "MTA NYCT_905046");
@@ -117,8 +119,8 @@ public void testVMOnwardCalls() throws HttpException, IOException {
HashMap<String,Object> distances2 = (HashMap<String, Object>) extensions2.get("Distances");
assertEquals(distances2.get("PresentableDistance"), "24.9 miles away");
- assertTrue(Double.parseDouble(distances2.get("DistanceFromCall").toString()) > 40000.0);
- assertEquals(distances2.get("StopsFromCall"), 57);
+ assertEquals(distances2.get("DistanceFromCall"), 39992.98);
+ assertEquals(distances2.get("StopsFromCall"), 56);
assertEquals(distances2.get("CallDistanceAlongRoute"), 39939.21);
}
}
View
4 ...gration-tests/src/test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriIntegrationTestBase.java
@@ -48,7 +48,7 @@
private long _maxTimeout = 40 * 1000;
- private String _time = "2012-03-01T13:33:42-0500";
+ private String _time = "2012-03-01T13:36:00-0500";
private String _trace;
@@ -151,7 +151,7 @@ public void loadRecords() throws Throwable {
List<NycTestInferredLocationRecord> expected = _traceSupport
.readRecords(trace);
- String taskId = _traceSupport.uploadTraceForSimulation(trace, false);
+ String taskId = _traceSupport.uploadTraceForSimulation(trace, true);
// Wait for the task to complete
long t = System.currentTimeMillis();
View
5 ...sts/src/test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriTripInference_IntegrationTest.java
@@ -23,6 +23,7 @@
import org.apache.commons.httpclient.HttpException;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
@SuppressWarnings("unchecked")
@@ -49,6 +50,7 @@ public void setUp() throws Throwable {
}
@Test
+ @Ignore
public void testBlockNotSetOnSM() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903036");
@@ -64,6 +66,7 @@ public void testBlockNotSetOnSM() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testBlockNotSetOnVM() throws HttpException, IOException {
HashMap<String,Object> vmResponse = getVmResponse("MTA%20NYCT", "2437");
@@ -79,6 +82,7 @@ public void testBlockNotSetOnVM() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testNotPrevTrip() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903036");
@@ -94,6 +98,7 @@ public void testNotPrevTrip() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testNoWraparound() throws HttpException, IOException {
HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "404050");
View
6 .../test/java/org/onebusaway/nyc/integration_tests/nyc_webapp/SiriTripLayoverInference_IntegrationTest.java
@@ -23,6 +23,7 @@
import org.apache.commons.httpclient.HttpException;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onebusaway.nyc.integration_tests.RunUntilSuccess;
@@ -51,9 +52,11 @@ public void setUp() throws Throwable {
}
}
+ // (bus wrapped around to stop on next trip since bus is in layover!)
@Test
+ @Ignore
public void testDepartureTimeNotSetOnSM() throws HttpException, IOException {
- HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "903036");
+ HashMap<String,Object> smResponse = getSmResponse("MTA%20NYCT", "404923");
HashMap<String,Object> siri = (HashMap<String, Object>)smResponse.get("Siri");
HashMap<String,Object> serviceDelivery = (HashMap<String, Object>)siri.get("ServiceDelivery");
@@ -67,6 +70,7 @@ public void testDepartureTimeNotSetOnSM() throws HttpException, IOException {
}
@Test
+ @Ignore
public void testDepartureTimeNotSetOnVM() throws HttpException, IOException {
HashMap<String,Object> vmResponse = getVmResponse("MTA%20NYCT", "2437");
View
2  ...usaway-nyc-presentation/src/main/java/org/onebusaway/nyc/presentation/impl/search/SearchServiceImpl.java
@@ -91,7 +91,7 @@ public void refreshCachesIfNecessary() {
for (AgencyWithCoverageBean agency : _nycTransitDataService.getAgenciesWithCoverage()) {
for (String routeId : _nycTransitDataService.getRouteIdsForAgencyId(agency.getAgency().getId()).getList()) {
RouteBean routeBean = _nycTransitDataService.getRouteForId(routeId);
- _routeShortNameToIdMap.put(routeBean.getShortName(), routeId);
+ _routeShortNameToIdMap.put(routeBean.getShortName().toUpperCase(), routeId);
_routeLongNameToIdMap.put(routeBean.getLongName(), routeId);
}
}
View
126 ...data-federation/src/main/java/org/onebusaway/nyc/transit_data_federation/bundle/tasks/stif/StifTask.java
@@ -15,20 +15,8 @@
*/
package org.onebusaway.nyc.transit_data_federation.bundle.tasks.stif;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import org.onebusaway.csv_entities.CSVLibrary;
+import org.onebusaway.csv_entities.CSVListener;
import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.Route;
import org.onebusaway.gtfs.model.StopTime;
@@ -37,12 +25,28 @@
import org.onebusaway.nyc.transit_data_federation.bundle.model.NycFederatedTransitDataBundle;
import org.onebusaway.nyc.transit_data_federation.bundle.tasks.stif.model.ServiceCode;
import org.onebusaway.nyc.transit_data_federation.model.nyc.RunData;
+import org.onebusaway.transit_data_federation.services.AgencyAndIdLibrary;
import org.onebusaway.utility.ObjectSerializationLibrary;
+
import org.opentripplanner.common.model.P2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
/**
* Load STIF data, including the mapping between destination sign codes and trip
* ids, into the database
@@ -57,6 +61,8 @@
private GtfsMutableRelationalDao _gtfsMutableRelationalDao;
private List<File> _stifPaths = new ArrayList<File>();
+
+ private String _tripToDSCOverridePath;
private Set<String> _notInServiceDscs = new HashSet<String>();
@@ -93,6 +99,10 @@ public void setStifPaths(List<File> paths) {
public void setNotInServiceDsc(String notInServiceDsc) {
_notInServiceDscs.add(notInServiceDsc);
}
+
+ public void setTripToDSCOverridePath(String path) {
+ _tripToDSCOverridePath = path;
+ }
public void setNotInServiceDscs(List<String> notInServiceDscs) {
_notInServiceDscs.addAll(notInServiceDscs);
@@ -117,7 +127,7 @@ public void run() {
for (File path : _stifPaths) {
loadStif(path, loader);
}
-
+
computeBlocksFromRuns(loader);
warnOnMissingTrips();
@@ -133,9 +143,48 @@ public void run() {
} catch (IOException e) {
throw new IllegalStateException(e);
}
-
+
Map<String, List<AgencyAndId>> dscToTripMap = loader.getTripMapping();
+
+ // Read in trip to dsc overrides if they exist
+ if (_tripToDSCOverridePath != null) {
+ Map<AgencyAndId, String> tripToDSCOverrides;
+ try {
+ tripToDSCOverrides = loadTripToDSCOverrides(_tripToDSCOverridePath);
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+
+ // Add tripToDSCOverrides to dscToTripMap
+ for (Map.Entry<AgencyAndId, String> entry : tripToDSCOverrides.entrySet()) {
+
+ if (_gtfsMutableRelationalDao.getTripForId(entry.getKey()) == null) {
+ throw new IllegalStateException("Trip id " + entry.getKey() + " from trip ID to DSC overrides does not exist in bundle GTFS.");
+ }
+
+ List<AgencyAndId> agencyAndIds;
+ // See if trips for this dsc are already in the map
+ agencyAndIds = dscToTripMap.get(entry.getValue());
+ // If not, care a new array of trip ids and add it to the map for this dsc
+ if (agencyAndIds == null) {
+ agencyAndIds = new ArrayList<AgencyAndId>();
+ dscToTripMap.put(entry.getValue(), agencyAndIds);
+ }
+ // Add the trip id to our list of trip ids already associated with a dsc
+ agencyAndIds.add(entry.getKey());
+ }
+ }
+
Map<AgencyAndId, String> tripToDscMap = new HashMap<AgencyAndId, String>();
+
+ // Populate tripToDscMap based on dscToTripMap
+ for (Map.Entry<String, List<AgencyAndId>> entry : dscToTripMap.entrySet()) {
+ String destinationSignCode = entry.getKey();
+ List<AgencyAndId> tripIds = entry.getValue();
+ for (AgencyAndId tripId : tripIds) {
+ tripToDscMap.put(tripId, destinationSignCode);
+ }
+ }
Set<String> inServiceDscs = new HashSet<String>();
@@ -160,9 +209,6 @@ private void logDSCStatistics(Map<String, List<AgencyAndId>> dscToTripMap,
for (Map.Entry<String, List<AgencyAndId>> entry : dscToTripMap.entrySet()) {
String destinationSignCode = entry.getKey();
List<AgencyAndId> tripIds = entry.getValue();
- for (AgencyAndId tripId : tripIds) {
- tripToDscMap.put(tripId, destinationSignCode);
- }
Set<AgencyAndId> routeIds = routeIdsByDsc.get(destinationSignCode);
if (routeIds != null) {
@@ -505,7 +551,47 @@ public void loadStif(File path, StifTripLoader loader) {
loader.run(path);
}
}
-
+
+ private Map<AgencyAndId, String> loadTripToDSCOverrides(String path) throws Exception {
+
+ final Map<AgencyAndId, String> results = new HashMap<AgencyAndId, String>();
+
+ CSVListener listener = new CSVListener() {
+
+ int count = 0;
+ int tripIdIndex;
+ int dscIndex;
+
+ @Override
+ public void handleLine(List<String> line) throws Exception {
+
+ if (line.size() != 2)
+ throw new Exception("Each Trip ID to DSC CSV line must contain two columns.");
+
+ if (count == 0) {
+ count++;
+
+ tripIdIndex = line.indexOf("tripId");
+ dscIndex = line.indexOf("dsc");
+
+ if(tripIdIndex == -1 || dscIndex == -1) {
+ throw new Exception("Trip ID to DSC CSV must contain a header with column names 'tripId' and 'dsc'.");
+ }
+
+ return;
+ }
+
+ results.put(AgencyAndIdLibrary.convertFromString(line.get(tripIdIndex)), line.get(dscIndex));
+ }
+ };
+
+ File source = new File(path);
+
+ CSVLibrary.parse(source, listener);
+
+ return results;
+ }
+
private void readNotInServiceDscs() {
if (_notInServiceDscPath != null) {
try {
View
45 onebusaway-nyc-transit-data-manager/onebusaway-nyc-tdm-webapp/pom.xml
@@ -53,13 +53,6 @@
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
</dependency>
-
-
- <dependency>
- <groupId>org.onebusaway</groupId>
- <artifactId>onebusaway-container</artifactId>
- <version>2.0.5-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
@@ -70,6 +63,12 @@
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.2</version>
</dependency>
+ <!-- RMI-like service for wiring up services between VMs -->
+ <dependency>
+ <groupId>com.caucho</groupId>
+ <artifactId>resin-hessian</artifactId>
+ <version>3.1.6</version>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
@@ -85,8 +84,8 @@
</dependency>
<dependency>
<groupId>org.onebusaway</groupId>
- <artifactId>onebusaway-transit-data-federation</artifactId>
- <version>${onebusaway.app-modules.version}</version>
+ <artifactId>onebusaway-nyc-transit-data-federation</artifactId>
+ <version>${onebusaway.nyc.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
@@ -149,7 +148,31 @@
<vtms.path>http://sms:8080/onebusaway-nyc-transit-data-federation-webapp</vtms.path>
<config.path>http://sms:8080/onebusaway-nyc-transit-data-federation-webapp</config.path>
<service.wikihost>xwiki.staging.obanyc.com</service.wikihost>
- <tdm.host>tdm</tdm.host><!-- assumes domain is set in resolve.conf -->
+ <tdm.host>localhost</tdm.host><!-- assumes domain is set in resolve.conf -->
+ <webapp.api.url></webapp.api.url>
+ <tdm.dataPath>/mnt/data/tdm_input/upload/mta</tdm.dataPath>
+ <tdm.crewAssignsUploadDir>${tdm.dataPath}/crew_assign</tdm.crewAssignsUploadDir> <!-- See UtsCrewUploadsFilePicker for usage of this. -->
+ <tdm.depotAssignsDownloadDir>${tdm.dataPath}/depot_assigns</tdm.depotAssignsDownloadDir> <!-- See DepotAssignmentsSoapDownloadsFilePicker for usage of this. -->
+ <tdm.dscFilesDir>${tdm.dataPath}/dsc</tdm.dscFilesDir> <!-- See DscManualUploadDateTimestampFilePicker for usage of this. -->
+ <tdm.pipoFilename>/vehicle_pipo/UTSPUPUFULL.txt</tdm.pipoFilename>
+ <tdm.prettyPrintOutput>false</tdm.prettyPrintOutput>
+ <tdm.config.configXmlFile>/var/lib/obanyc/tdm-config/tdm_config.xml</tdm.config.configXmlFile>
+ <tdm.depotIdTranslationConfigFile>/var/lib/obanyc/tdm/depot_ids.csv</tdm.depotIdTranslationConfigFile>
+ <tdm.bundlePath>/var/lib/obanyc/bundleservice/activebundles</tdm.bundlePath>
+ <tdm.vehiclepipoUploadDir>${tdm.dataPath}/vehicle_pipo</tdm.vehiclepipoUploadDir>
+ <bundle.location>/var/lib/obanyc/oba-bundle-tdm</bundle.location>
+ <bundle.mode.standalone>true</bundle.mode.standalone>
+ <log4j.appender>ROLL</log4j.appender>
+ </properties>
+ </profile>
+ <profile>
+ <id>local-bundle</id>
+ <properties> <!-- sms hostname assumes search is defined in /etc/resolv.conf -->
+ <tds.path>http://sms:8080/onebusaway-nyc-transit-data-federation-webapp</tds.path>
+ <vtms.path>http://sms:8080/onebusaway-nyc-transit-data-federation-webapp</vtms.path>
+ <config.path>http://sms:8080/onebusaway-nyc-transit-data-federation-webapp</config.path>
+ <service.wikihost>xwiki.staging.obanyc.com</service.wikihost>
+ <tdm.host>localhost:8080</tdm.host>
<webapp.api.url></webapp.api.url>
<tdm.dataPath>/mnt/data/tdm_input/upload/mta</tdm.dataPath>
<tdm.crewAssignsUploadDir>${tdm.dataPath}/crew_assign</tdm.crewAssignsUploadDir> <!-- See UtsCrewUploadsFilePicker for usage of this. -->
@@ -161,6 +184,8 @@
<tdm.depotIdTranslationConfigFile>/var/lib/obanyc/tdm/depot_ids.csv</tdm.depotIdTranslationConfigFile>
<tdm.bundlePath>/var/lib/obanyc/bundleservice/activebundles</tdm.bundlePath>
<tdm.vehiclepipoUploadDir>${tdm.dataPath}/vehicle_pipo</tdm.vehiclepipoUploadDir>
+ <bundle.location>/tmp/oba-bundle-tdm</bundle.location>
+ <bundle.mode.standalone>true</bundle.mode.standalone>
<log4j.appender>ROLL</log4j.appender>
</properties>
</profile>
View
91 ...r/onebusaway-nyc-tdm-webapp/src/main/java/org/onebusaway/nyc/transit_data_manager/api/RouteResource.java
@@ -0,0 +1,91 @@
+package org.onebusaway.nyc.transit_data_manager.api;
+
+import org.onebusaway.gtfs.model.AgencyAndId;
+import org.onebusaway.nyc.transit_data.services.NycTransitDataService;
+import org.onebusaway.nyc.transit_data_federation.services.nyc.DestinationSignCodeService;
+import org.onebusaway.nyc.transit_data_manager.json.JsonTool;
+import org.onebusaway.nyc.transit_data_manager.json.model.RouteDetail;
+import org.onebusaway.transit_data.model.RouteBean;
+import org.onebusaway.transit_data_federation.services.blocks.BlockGeospatialService;
+import org.onebusaway.transit_data_federation.services.blocks.BlockIndexService;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Set;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+@Path("/route")
+@Component
+/**
+ * WebService support for querying routes, specifically route to destination sign code
+ * (DSC) mappings.
+ *
+ */
+public class RouteResource {
+
+ private static Logger _log = LoggerFactory.getLogger(RouteResource.class);
+
+ @Autowired
+ private NycTransitDataService _transitDataService;
+ @Autowired
+ private DestinationSignCodeService _dscService;
+ @Autowired
+ JsonTool jsonTool;
+ public RouteResource() {
+
+ }
+
+ @Path("/dsc/{dsc}")
+ @GET
+ @Produces("application/json")
+ public Response getRoutes(@PathParam("dsc") String dsc) {
+ // lookup routeId for that DSC
+ Set<AgencyAndId> routeIds = _dscService.getRouteCollectionIdsForDestinationSignCode(dsc);
+ if (!routeIds.isEmpty()) {
+ AgencyAndId routeId = routeIds.iterator().next();
+ RouteDetail routeDetail = new RouteDetail();
+ routeDetail.setDsc(dsc);
+ routeDetail.setRouteId(routeId.getId());
+ routeDetail.setAgencyId(routeId.getAgencyId());
+ // now lookup short/long name for that routeId
+ RouteBean routeBean = _transitDataService.getRouteForId(routeId.toString());
+ if (routeBean != null) {
+ routeDetail.setDescription(routeBean.getDescription());
+ routeDetail.setLongName(routeBean.getLongName());
+ routeDetail.setShortName(routeBean.getShortName());
+ }
+ StringWriter writer = null;
+ String output = null;
+ try {
+ writer = new StringWriter();
+ jsonTool.writeJson(writer, routeDetail);
+ output = writer.toString();
+ } catch (IOException e) {
+ _log.error("routeDetail parsing error:", e);
+ } finally {
+ try {
+ writer.close();
+ } catch (IOException e) {}
+ }
+ Response response = Response.ok(output).build();
+ return response;
+ }
+
+ return null;
+ }
+
+ public void setJsonTool(JsonTool jsonTool) {
+ this.jsonTool = jsonTool;
+ }
+
+}
View
58 ...busaway-nyc-tdm-webapp/src/main/java/org/onebusaway/nyc/transit_data_manager/json/model/RouteDetail.java
@@ -0,0 +1,58 @@
+package org.onebusaway.nyc.transit_data_manager.json.model;
+
+public class RouteDetail {
+ private String dsc;
+ private String agencyId;
+ private String routeId;
+ private String description;
+ private String shortName;
+ private String longName;
+
+ public String getDsc() {
+ return dsc;
+ }
+
+ public void setDsc(String dsc) {
+ this.dsc = dsc;
+ }
+
+ public String getAgencyId() {
+ return agencyId;
+ }
+
+ public void setAgencyId(String agencyId) {
+ this.agencyId = agencyId;
+ }
+
+ public String getRouteId() {
+ return routeId;
+ }
+
+ public void setRouteId(String routeId) {
+ this.routeId = routeId;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getShortName() {
+ return shortName;
+ }
+
+ public void setShortName(String shortName) {
+ this.shortName = shortName;
+ }
+
+ public String getLongName() {
+ return longName;
+ }
+
+ public void setLongName(String longName) {
+ this.longName = longName;
+ }
+}
View
38 onebusaway-nyc-transit-data-manager/onebusaway-nyc-tdm-webapp/src/main/resources/data-sources.xml
@@ -22,6 +22,17 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+<!-- never define nycTransitDataService here -->
+<!-- it should be autowired natively -->
+<!-- if you need to define it in spring you have done something wrong -->
+
+ <!-- define which TDM to use -->
+ <bean id="transitDataManagerApiLibrary" class="org.onebusaway.nyc.util.impl.tdm.TransitDataManagerApiLibrary" >
+ <constructor-arg type="java.lang.String" value="${tdm.host}"/>
+ <constructor-arg type="java.lang.Integer" value="80" />
+ <constructor-arg type="java.lang.String" value="/api/" />
+ </bean>
+
<!-- Database Connection Configuration -->
<bean id="dataSource"
@@ -48,4 +59,31 @@
</property>
</bean>
-->
+ <bean id="webappHibernateProperties" class="org.onebusaway.container.spring.PropertiesBeanPostProcessor">
+ <property name="target" value="hibernateProperties" />
+ <property name="properties">
+ <props>
+ <prop key="bundle.location">${bundle.location}</prop>
+ </props>
+ </property>
+ </bean>
+
+ <alias name="dataSource" alias="mutableDataSource" />
+
+ <!-- Other Stuff: -->
+ <bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
+ <property name="properties">
+ <props>
+ <prop key="blockLocationServiceImpl.persistBlockLocationRecords">false</prop>
+ <prop key="blockLocationServiceImpl.locationInterpolation">false</prop>
+ <prop key="cacheManager.cacheManagerName">org.onebusaway.tdm_bundle_webapp.cacheManager</prop>
+ </props>
+ </property>
+ </bean>
+
+ <bean id="bundleManagementService" class="org.onebusaway.nyc.transit_data_federation.impl.bundle.BundleManagementServiceImpl">
+ <property name="bundleStoreRoot" value="${bundle.location}" />
+ <property name="standaloneMode" value="${bundle.mode.standalone}" />
+ </bean>
+
</beans>
View
34 .../nyc/transit_data_manager/application-context.xml → ...ansit_data_manager/application-context-webapp.xml
@@ -4,27 +4,29 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+ <import resource="classpath:org/onebusaway/nyc/transit_data_federation/application-context.xml" />
<context:component-scan base-package="org.onebusaway.nyc.transit_data_manager.api" />
<context:component-scan base-package="org.onebusaway.nyc.transit_data_manager.siri" />
-
<import resource="classpath:org/onebusaway/container/application-context.xml" />
<import resource="classpath:org/onebusaway/nyc/tdm_adapters/application-context.xml" />
+ <bean id="usersHibernateAnnotatedClasses" class="org.onebusaway.container.spring.ListBeanPostProcessor">
+ <property name="target" value="hibernateAnnotatedClasses" />
+ <property name="values">
+ <list>
+ <value>org.onebusaway.nyc.transit_data_manager.siri.ServiceAlertRecord</value>
+ <value>org.onebusaway.nyc.transit_data_manager.siri.ServiceAlertSubscription</value>
+ </list>
+ </property>
+ </bean>
+
+ <!-- This turns on automatic annotation configuration for Jackson -->
+ <context:annotation-config />
- <bean id="usersHibernateAnnotatedClasses" class="org.onebusaway.container.spring.ListBeanPostProcessor">
- <property name="target" value="hibernateAnnotatedClasses" />
- <property name="values">
- <list>
- <value>org.onebusaway.nyc.transit_data_manager.siri.ServiceAlertRecord</value>
- <value>org.onebusaway.nyc.transit_data_manager.siri.ServiceAlertSubscription</value>
- </list>
- </property>
- </bean>
-
- <bean id="nycTransitDataService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
- <property name="serviceUrl" value="${tds.path}/remoting/transit-data-service" />
- <property name="serviceInterface" value="org.onebusaway.nyc.transit_data.services.NycTransitDataService" />
- </bean>
-
+ <context:component-scan base-package="org.onebusaway.nyc.transit_data_manager.bundle.api" />
+
+ <!-- why is this here? -->
+ <context:component-scan base-package="org.onebusaway.nyc.vehicle_tracking.impl" />
+
<bean
class="org.onebusaway.container.spring.SystemPropertyOverrideConfigurer">
<property name="order" value="-2" />
View
3  onebusaway-nyc-transit-data-manager/onebusaway-nyc-tdm-webapp/src/main/webapp/WEB-INF/web.xml
@@ -14,7 +14,8 @@
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:data-sources.xml
- classpath:org/onebusaway/nyc/transit_data_manager/application-context.xml
+ classpath:org/onebusaway/nyc/tdm_adapters/application-context.xml
+ classpath:org/onebusaway/nyc/transit_data_manager/application-context-webapp.xml
</param-value>
</context-param>
View
11,001 ...nebusaway-nyc-tdm-webapp/src/test/resources/org/onebusaway/nyc/transit_data_manager/api/CIS_20120727.txt
11,001 additions, 0 deletions not shown
View
11,003 ...away-nyc-tdm-webapp/src/test/resources/org/onebusaway/nyc/transit_data_manager/api/CIS_20120730_1602.txt
11,003 additions, 0 deletions not shown
View
4 ...c-vehicle-tracking/src/main/java/org/onebusaway/nyc/vehicle_tracking/impl/inference/MotionModelImpl.java
@@ -602,7 +602,9 @@ public static boolean hasRunChanged(BlockStateObservation parentEdge,
BlockStateObservation proposalEdge) {
if (proposalEdge != null) {
if (parentEdge != null) {
- if (!proposalEdge.getBlockState().getRunId().equals(
+ if (proposalEdge.getBlockState().getRunId() != null &&
+ parentEdge.getBlockState().getRunId() != null &&
+ !proposalEdge.getBlockState().getRunId().equals(
parentEdge.getBlockState().getRunId())) {
return true;
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.