Giter VIP home page Giter VIP logo

ndovextract's People

Contributors

koch-t avatar skinkie avatar sven4all avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ndovextract's Issues

GVB TimingPointCode vs UserStopCode

I tried to match the TimingPointCode from GTFS exports at http://gtfs.ovapi.nl/gvb/ with the GVB TimingPointCodes from the API.

It looks like it missing in the KV1 data-files, and available in the KV7 files.

How I tested with with TPC 30005033 (UserStopCode 05025):

# MD5 (GVB.20140908.TBM.zip) = a39d7877d6c4b89cb84f7109df3647b6
$ unzip GVB.20140908.TBM.zip
$ grep 30005033 USRSTOPXXX.tmi
# output: (empty)
$ grep 05025 USRSTOPXXX.tmi
# output: USRSTOP|1|I|GVB|050252||Y|Y|N|Centraal Station|Amsterdam||-|||0||

# MD5 (gtfs-kv1gvb-20150517.zip) = a4fda8274052691f5e17f99a269011e7
$ unzip gtfs-kv1gvb-20150517.zip
$ grep 30005033 stops.txt
# output: (empty)
$ grep 05025 stops.txt
# output:
# GVB:05025,05025,"Amsterdam, Centraal Station",52.378216,4.897511,0,stoparea:GVB:05025,,0,F,
# GVB:05026,05026,"Amsterdam, Centraal Station",52.377984,4.89791,0,stoparea:GVB:05025,,1,F,
# GVB:05030,05030,"Amsterdam, Centraal Station",52.377632,4.897767,0,stoparea:GVB:05025,,1,F,
# GVB:05033,05033,"Amsterdam, Centraal Station",52.377705,4.89781,0,stoparea:GVB:05025,,0,F,
# GVB:05034,05034,"Amsterdam, Centraal Station",52.377651,4.89781,0,stoparea:GVB:05025,,0,F,
# stoparea:GVB:05025,,"Amsterdam, Centraal Station",52.3778376,4.8977616,1,,,0,,

compared to CXX TPC 56332350

# MD5 (CXX.20150607.zip) = 178df57f7972273995fafd22bc841b5b
$ unzip CXX.20150607.zip 
$ grep 56332350 USRSTOP.TMI
# output: USRSTOP|1|I|CXX|56332350||true|true|N|Hoofddorp, Wilsonstraat|Hoofddorp||-|||0|||PASSENGER
# MD5 (gtfs-kv1connexxion-20150519.zip) = 31837e755eee36d19934bcb94f7a4715
$ unzip gtfs-kv1connexxion-20150519.zip
$ grep 56332350 stops.txt
# output: CXX:56332350,56332350,"Hoofddorp, Wilsonstraat",52.305609,4.680076,0,,,0,,

Is there any way to "merge" the GVB TimingPointCodes somehow from the KV7 feed to make the GTFS exports consistent with the KV78Turbo API?

Should this still work?

I tried to get this working but it does not seem to work (arriva, cxx, gvb).

PostgreSQL error:

CONTEXT:  COPY link, line 1: "LINK|1|I|ARR|51750070|51750100|2015-03-01|384||BUS"
STATEMENT:  COPY LINK FROM STDIN WITH DELIMITER AS '|' NULL AS '' CSV ENCODING 'UTF-8'

Also it's missing some explanation what you need more (like the Google's transitfeed package) and some functions (which I found in the bliksemintegration repository)

CREATE OR REPLACE FUNCTION 
toseconds(time24 text, shift24 integer) RETURNS integer AS $$
SELECT total AS time
FROM
(SELECT
  (cast(split_part($1, ':', 1) as int4) * 3600)      -- hours
+ (cast(split_part($1, ':', 2) as int4) * 60)        -- minutes
+ CASE WHEN $1 similar to '%:%:%' THEN (cast(split_part($1, ':', 3) as int4)) ELSE 0 END -- seconds when applicable
+ (shift24 * 86400) as total --Add 24 hours (in seconds) when shift occured
) as xtotal
$$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION 
to32time(secondssincemidnight integer) RETURNS text AS $$
SELECT lpad(floor((secondssincemidnight / 3600))::text, 2, '0')||':'||lpad(((secondssincemidnight % 3600) / 60)::text, 2, 
'0')||':'||lpad((secondssincemidnight % 60)::text, 2, '0') AS time
$$ LANGUAGE SQL;
CREATE OR REPLACE FUNCTION add32time(departuretime text, seconds integer) RETURNS text AS $$ SELECT lpad(floor((total / 3600))::text, 2,
'0')||':'||lpad(((total % 3600) / 60)::text, 2, '0')||':'||lpad((total % 60)::text, 2, '0') AS arrival_time FROM (SELECT (cast(split_part($1, ':', 1)
as int4) * 60 + cast(split_part($1, ':', 2) as int4)) * 60 + cast(split_part($1, ':', 3) as int4) + coalesce($2, 0) as total) as xtotal $$ LANGUAGE
SQL;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.