transit bike table structure

transit bike table structure#

For now, this table is an exact copy of the Transit_Walk table

Table Structure#

Field

Type

NULL allowed

Default Value

Foreign key

Description

bike_link*

INTEGER

NO

Bike link ID

from_node

INTEGER

NO

starting node for the link. Can be a regular network node or a virtual node created to articulate the network

to_node

INTEGER

NO

same as the from_node but for the end of the link

bearing_a

INTEGER

NO

0

Geographic bearing at the start of the link

bearing_b

INTEGER

NO

0

Geographic bearing at the end of the link

length

REAL

NO

Length of the link in meters

ref_link

INTEGER

NO

0

Reference to the link in the roadway network (link table), if any

geo

LINESTRING

NO

‘’

(* - Primary key)

The SQL statement for table and index creation is below.

CREATE TABLE IF NOT EXISTS "Transit_Bike" (
    bike_link    INTEGER  NOT NULL PRIMARY KEY AUTOINCREMENT,
    from_node    INTEGER  NOT NULL,
    to_node      INTEGER  NOT NULL,
    bearing_a    INTEGER  NOT NULL DEFAULT 0,
    bearing_b    INTEGER  NOT NULL DEFAULT 0,
    length       REAL     NOT NULL,
    ref_link     INTEGER  NOT NULL default 0
);

SELECT AddGeometryColumn('Transit_Bike', 'geo', SRID_PARAMETER, 'LINESTRING', 'XY', 1);
SELECT CreateSpatialIndex('Transit_Bike' , 'geo');

UPDATE SQLITE_SEQUENCE SET seq = 4000000 WHERE name = 'Transit_Bike';

CREATE INDEX IF NOT EXISTS transit_bike_from_node ON Transit_Bike (from_node);
CREATE INDEX IF NOT EXISTS transit_bike_to_node ON Transit_Bike (to_node);