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.
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 parking |
||
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 parking 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. |
||
space |
INTEGER |
NO |
The capacity of this parking facility |
||
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) |
||
walk_setback |
REAL |
YES |
Same as setback above, but for the walk link (meters) |
||
bike_link |
BIGINT |
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) |
||
bike_setback |
REAL |
YES |
Same as setback above, but for the bike link (meters) |
||
num_escooters |
INTEGER |
YES |
0 |
Number of e-scooters available at this parking |
|
close_time |
INTEGER |
YES |
864000 |
Garage closing working time stamp, if 24/7 set as an arbitrarily (10 days default) large number (seconds) |
|
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 PRIMARY KEY,
link INTEGER NOT NULL,
dir INTEGER NOT NULL,
zone INTEGER NOT NULL,
offset REAL,
setback INTEGER,
"type" TEXT,
space INTEGER NOT NULL,
walk_link INTEGER,
walk_offset REAL,
walk_setback REAL,
bike_link BIGINT,
bike_offset REAL,
bike_setback REAL,
num_escooters INTEGER DEFAULT 0,
close_time INTEGER DEFAULT 864000,
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 "idx_polaris_parking" ON "Parking" ("parking");
create INDEX IF NOT EXISTS "idx_polaris_parking_zone" ON "Parking" ("zone");