parking table structure

parking table structure#

The parking table lists all parking facilities available in the model. It includes dedicated parking structures, as well as parking lots attached to business, residences and other activity locations.

Table Structure#

Field

Type

NULL allowed

Default Value

Foreign key

Description

parking*

INTEGER

NO

The parking facility identifier

link

INTEGER

NO

Foreign key reference to one link that is the closest spatially to the location

dir

INTEGER

NO

The direction of the link (ab or ba) that is closest to the parking. Can be used to infer which side of the link this location may lie (but not trivial)

zone

INTEGER

NO

Zone(zone)

The zone to which this parking facility belong

offset

REAL

YES

Auto-generated value of how far from the parking (perpendicular) the link is present (meters)

setback

INTEGER

YES

Auto-generated value of how far from node_a of the link this parking is present along the length of the link (meters)

type

TEXT

YES

The parking type: garage, lot, metered, street, etc.

start

REAL

YES

The offset of where segment begins (meters) (not currently used)

end

REAL

YES

The offset of where segment ends (meters) (not currently used)

space

INTEGER

NO

The capacity of this parking facility

time_in

REAL

YES

The start time from which this parking facility can be used

time_out

REAL

YES

The end time till which this parking facility can be used

hourly

REAL

NO

The hourly parking rate ($)

daily

REAL

NO

The daily parking rate ($)

monthly

REAL

YES

The monthly parking rate ($)

walk_link

INTEGER

YES

Foreign key reference to the nearest walk link from the Transit_Walk table

walk_offset

REAL

YES

Same as offset above, but for the walk link (meters)

bike_link

INTEGER

YES

Foreign key reference to the nearest bike link from the Transit_Bike table

bike_offset

REAL

YES

Same as offset above, but for the bike link (meters)

geo

POINT

NO

‘’

(* - Primary key)

The SQL statement for table and index creation is below.

create TABLE IF NOT EXISTS "Parking" (
    "parking"      INTEGER NOT NULL  NOT NULL PRIMARY KEY,
    "link"         INTEGER NOT NULL,
    "dir"          INTEGER NOT NULL,
    "zone"         INTEGER NOT NULL,
    "offset"       REAL,
    "setback"      INTEGER,
    "type"         TEXT,
    "start"        REAL,
    "end"          REAL,
    "space"        INTEGER NOT NULL,
    "time_in"      REAL,
    "time_out"     REAL,
    "hourly"       REAL    NOT NULL,
    "daily"        REAL    NOT NULL,
    "monthly"      REAL,
    "walk_link"    INTEGER,
    "walk_offset"  REAL,
    "bike_link"    INTEGER,
    "bike_offset"  REAL,

    CONSTRAINT "zone_fk" FOREIGN KEY("zone") REFERENCES "Zone"("zone") DEFERRABLE INITIALLY DEFERRED
);

select AddGeometryColumn( 'Parking', 'geo', SRID_PARAMETER, 'POINT', 'XY', 1);
select CreateSpatialIndex( 'Parking' , 'geo' );

create INDEX IF NOT EXISTS "parking_idx" ON "Parking" ("parking");
create INDEX IF NOT EXISTS "park_zone" ON "Parking" ("zone");