akireserrano86 / googletransitdatafeed

Automatically exported from code.google.com/p/googletransitdatafeed
0 stars 0 forks source link

MERGE.EXE ---- The service periods could not be merged since they are not disjoint. #283

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
=======================================
1.Merging two gtfs feeds by different sub-operators for the same time period 
returns an error message.
We are the mother-company and the rest are affiliates. We have to concat rather 
big files (no other ovelapping information - nor
trips nor stop_times. Affiliate companies share stops.txt and same dates in 
calendar.txt. 

What is the expected output? What do you see instead?
=======================================================
------------------------------------
calendar.txt/calendar_dates.txt

   1. The service periods could not be merged since they are not disjoint.
------------------------------------

I would like to see a successful result.
Merging feeds by hand is laborious. The service periods could not be merged 
since they are not disjoint. I suppose we have to develop an inhouse merger 
with series of commands like the following
more +2 file2.txt > temp
type temp file1.txt > Total.txt
etc

What version of the product are you using? On what operating system?
transitfeed-windows-binary-1.2.6 - MS windows XP SP3

Please provide any additional information below.
not applicable -

Original issue reported on code.google.com by mpai...@gmail.com on 30 Mar 2011 at 10:19

Attachments:

GoogleCodeExporter commented 8 years ago
Just an example of the merging code I use should anyone need something similar
==============================================================================
In local drive I have one directory with gtfs files for every sub-operator 
under our control. I.E. one folder for ETHEL, one for HSAP, one for TRAM, one 
for PROASTIAKOS, one for METRO.

echo off
REM         MERGE for OASA files
REM          working directory for example in C:\GTFS_FILES_2011-03-30
REM          one directory per affiliate company - ETHEL, HSAP, METRO, TRAM, 
PROASTIAKOS
REM         2011-03-30 mpaigni

set /p WorkingDir= What is the working directory?
c:
cd %WorkingDir%
REM PAUSE
echo on

REM  BUILDING TRIPS.TXT
REM 
================================================================================
=================
more +1 ".\HSAP\trips.txt" > ".\trips1.txt"
type ".\ETHEL\trips.txt" ".\trips1.txt" > ".\trips2.txt"
REM PAUSE
more +1 ".\METRO\trips.txt" > ".\trips1.txt"
type ".\trips2.txt" ".\trips1.txt" > ".\trips3.txt"
REM PAUSE
more +1 ".\TRAM\trips.txt" > ".\trips1.txt"
type ".\trips3.txt" ".\trips1.txt" > ".\trips2.txt"
REM PAUSE
more +1 ".\PROASTIAKOS\trips.txt" > ".\trips1.txt"
type ".\trips2.txt" ".\trips1.txt" > ".\ALL\trips.txt"

del ".\trips1.txt" /q
del ".\trips2.txt" /q
del ".\trips3.txt" /q

REM  BUILDING ROUTES.TXT
REM 
================================================================================
=================
PAUSE
more +1 ".\HSAP\routes.txt" > ".\routes1.txt"
type ".\ETHEL\routes.txt" ".\routes1.txt" > ".\routes2.txt"
REM PAUSE
more +1 ".\METRO\routes.txt" > ".\routes1.txt"
type ".\routes2.txt" ".\routes1.txt" > ".\routes3.txt"
REM PAUSE
more +1 ".\TRAM\routes.txt" > ".\routes1.txt"
type ".\routes3.txt" ".\routes1.txt" > ".\routes2.txt"
REM PAUSE
more +1 ".\PROASTIAKOS\routes.txt" > ".\routes1.txt"
type ".\routes2.txt" ".\routes1.txt" > ".\ALL\routes.txt"

del ".\routes1.txt" /q
del ".\routes2.txt" /q
del ".\routes3.txt" /q

REM  BUILDING calendar.TXT
REM 
================================================================================
=================
PAUSE
more +1 ".\HSAP\calendar.txt" > ".\calendar1.txt"
type ".\ETHEL\calendar.txt" ".\calendar1.txt" > ".\calendar2.txt"
REM PAUSE
more +1 ".\METRO\calendar.txt" > ".\calendar1.txt"
type ".\calendar2.txt" ".\calendar1.txt" > ".\calendar3.txt"
REM PAUSE
more +1 ".\TRAM\calendar.txt" > ".\calendar1.txt"
type ".\calendar3.txt" ".\calendar1.txt" > ".\calendar2.txt"
REM PAUSE
more +1 ".\PROASTIAKOS\calendar.txt" > ".\calendar1.txt"
type ".\calendar2.txt" ".\calendar1.txt" > ".\ALL\calendar.txt"

del ".\calendar1.txt" /q
del ".\calendar2.txt" /q
del ".\calendar3.txt" /q

REM  BUILDING CALENDAR_DATES.TXT
REM 
================================================================================
=================
PAUSE
more +1 ".\HSAP\calendar_dates.txt" > ".\calendar_dates1.txt"
type ".\ETHEL\calendar_dates.txt" ".\calendar_dates1.txt" > 
".\calendar_dates2.txt"
REM PAUSE
more +1 ".\METRO\calendar_dates.txt" > ".\calendar_dates1.txt"
type ".\calendar_dates2.txt" ".\calendar_dates1.txt" > ".\calendar_dates3.txt"
REM PAUSE
more +1 ".\TRAM\calendar_dates.txt" > ".\calendar_dates1.txt"
type ".\calendar_dates3.txt" ".\calendar_dates1.txt" > ".\calendar_dates2.txt"
REM PAUSE
more +1 ".\PROASTIAKOS\calendar_dates.txt" > ".\calendar_dates1.txt"
type ".\calendar_dates2.txt" ".\calendar_dates1.txt" > 
".\ALL\calendar_dates.txt"

del ".\calendar_dates1.txt" /q
del ".\calendar_dates2.txt" /q
del ".\calendar_dates3.txt" /q

REM  BUILDING SHAPES.TXT
REM 
================================================================================
=================
PAUSE
more +1 ".\HSAP\shapes.txt" > ".\shapes1.txt"
type ".\ETHEL\shapes.txt" ".\shapes1.txt" > ".\shapes2.txt"
REM PAUSE
more +1 ".\METRO\shapes.txt" > ".\shapes1.txt"
type ".\shapes2.txt" ".\shapes1.txt" > ".\shapes3.txt"
REM PAUSE
more +1 ".\TRAM\shapes.txt" > ".\shapes1.txt"
type ".\shapes3.txt" ".\shapes1.txt" > ".\shapes2.txt"
REM PAUSE
more +1 ".\PROASTIAKOS\shapes.txt" > ".\shapes1.txt"
type ".\shapes2.txt" ".\shapes1.txt" > ".\ALL\shapes.txt"

del ".\shapes1.txt" /q
del ".\shapes2.txt" /q
del ".\shapes3.txt" /q

REM  BUILDING STOP_TIMES.TXT
REM 
================================================================================
=================
PAUSE
more +1 ".\HSAP\stop_times.txt" > ".\stop_times1.txt"
type ".\ETHEL\stop_times.txt" ".\stop_times1.txt" > ".\stop_times2.txt"
REM PAUSE
more +1 ".\METRO\stop_times.txt" > ".\stop_times1.txt"
type ".\stop_times2.txt" ".\stop_times1.txt" > ".\stop_times3.txt"
REM PAUSE
more +1 ".\TRAM\stop_times.txt" > ".\stop_times1.txt"
type ".\stop_times3.txt" ".\stop_times1.txt" > ".\stop_times2.txt"

REM gia na glitoso ligo xoro mporo na sviso to 3 
del ".\stop_times3.txt" /q

REM PAUSE
more +1 ".\PROASTIAKOS\stop_times.txt" > ".\stop_times1.txt"
type ".\stop_times2.txt" ".\stop_times1.txt" > ".\ALL\stop_times.txt"

del ".\stop_times1.txt" /q
del ".\stop_times2.txt" /q
del ".\stop_times3.txt" /q

Original comment by mpai...@gmail.com on 30 Mar 2011 at 12:46

GoogleCodeExporter commented 8 years ago
Looks like you are okay fiddling with code. Check out 
require_disjoint_calendars in 
http://code.google.com/p/googletransitdatafeed/source/browse/trunk/python/merge.
py

Could you make the change to expose this as a merge tool command line option? 
We didn't make it available initially because the validator didn't have very 
good detection of duplicate data but I think that has improved a bit.

Original comment by tom.brow...@gmail.com on 30 Mar 2011 at 5:49

GoogleCodeExporter commented 8 years ago
Hi Tom,

never dealt with Python although it seems so promissing (google apps, gtfs 
tools, Quantum GIS all use python... Suppose it is time for me to deal that 
beast too)

At the moment I am really busy with the final details of going live with Athens 
Greece Public transportation GTFS. As soon as Planner Mrs Vasileiou and myself 
finish
with the removal of the last warnings (we are more than two months behind 
schedule - problems arose that we had not thought about - At least Mr Rogers 
and Garima show great support and understanding), I promise I will have a look 
at it 

(never contributed to google projects though, it sounds daunting...)

Regards,
Michail

Original comment by mpai...@gmail.com on 30 Mar 2011 at 6:23

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
https://github.com/google/transitfeed/issues/283

Original comment by bdfer...@google.com on 7 Oct 2014 at 7:35