location table structure

Contents

location table structure#

The Location table holds all the activity and household locations in the model, on which all trips will ultimately start and end.

Given its central importance in the model, this table is connected to multiple other tables, both through data links and geographic ones.

Required by all models.

Table Structure#

Field

Type

NULL allowed

Default Value

Foreign key

Description

location*

INTEGER

NO

Unique ID referencing a particular location in the model

link

INTEGER

NO

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

dir

INTEGER

NO

0

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

offset

REAL

NO

0

Auto-generated value of how far from the location (perpendicular) the link is present.

setback

REAL

NO

0

Auto-generated value of how far from node_a of the link this location is present along the length of the link

zone

INTEGER

YES

Foreign key reference to the zone where this location in situated. Auto-generated through geo-consistency checks.

x

REAL

NO

0

Auto-generated value of the x coordinate of the location specified in meters (UTM transform)

y

REAL

NO

0

Auto-generated value of the y coordinate of the location specified in meters (UTM transform)

area_type

INTEGER

NO

0

Foreign-key reference to Area_Type to define the general characteristic of the area where the location is situated. It is necessarily the same as the zone where the location is situated

lu_area

REAL

NO

0

The area (in ???) of the same land use aggregated around the location

notes

TEXT

YES

“”

Text area to specify notes about the location. Optional.

popsyn_region

BIGINT

NO

0

Foreign key reference to the PopSyn_Region table denoting the collection of locations considered during population synthesis.

county

BIGINT

YES

Counties(county)

County code for the location. Used by the freight model and to compute aggregate statistics

land_use

TEXT

NO

“ALL”

Land_Use(land_use)

Text describing the land use type represented by this location. Values at land_use.

walk_link

BIGINT

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.

walk_setback

REAL

YES

Same as setback above, but for the walk link.

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.

bike_setback

REAL

YES

Same as setback above, but for the bike link.

avg_parking_cost

REAL

YES

0

Average parking cost when visiting the location. Used in the activity planning stage.

res_charging

REAL

YES

Denotes the proportion of households at this location that have residential charging available.

stop_flag

INTEGER

YES

0

Boolean to denote whether or not a location is a TNC stop, primarily for aggregated pickups and drop-offs. May be deprecated.

tod_distance

REAL

NO

0

Walk distance to the closest high-quality transit stop, in meters. The definition of “high quality” is user dependent and can be calculated using the DistanceToTransit class from Polaris-Studio.

geo

POINT

NO

‘’

(* - Primary key)

The SQL statement for table and index creation is below.

create TABLE IF NOT EXISTS Location(
    location         INTEGER NOT NULL PRIMARY KEY,
    link             INTEGER NOT NULL,
    dir              INTEGER NOT NULL DEFAULT 0,
    offset           REAL    NOT NULL DEFAULT 0,
    setback          REAL    NOT NULL DEFAULT 0,
    "zone"           INTEGER,
    x                REAL    NOT NULL DEFAULT 0,
    y                REAL    NOT NULL DEFAULT 0,
    area_type        INTEGER NOT NULL DEFAULT 0,
    lu_area          REAL    NOT NULL DEFAULT 0,
    notes            TEXT             DEFAULT "",
    popsyn_region    BIGINT  NOT NULL DEFAULT 0,
    county           BIGINT                    ,
    land_use         TEXT    NOT NULL DEFAULT "ALL",
    walk_link        BIGINT,
    walk_offset      REAL,
    walk_setback     REAL,
    bike_link        BIGINT,
    bike_offset      REAL,
    bike_setback     REAL,
    avg_parking_cost REAL             DEFAULT 0,
    res_charging     REAL,
    stop_flag        INTEGER          DEFAULT 0,
    tod_distance     REAL    NOT NULL DEFAULT 0,
    CONSTRAINT "land_use_fk" FOREIGN KEY("land_use") REFERENCES "Land_Use"("land_use") DEFERRABLE INITIALLY DEFERRED,
    CONSTRAINT "county_fk" FOREIGN KEY("county") REFERENCES "Counties"("county") DEFERRABLE INITIALLY DEFERRED
);
select AddGeometryColumn( 'Location', 'geo', SRID_PARAMETER, 'POINT', 'XY', 1 );
select CreateSpatialIndex( 'Location' , 'geo');
create INDEX IF NOT EXISTS "notes_idx" ON "Location" ("notes");
create INDEX IF NOT EXISTS "loc_zone" ON "Location" ("zone");
create INDEX IF NOT EXISTS "location_idx" ON "Location" ("location");

Enums#

The following enums are used in this table.

land_use#

Enum Values Description#

Value

Name

Description

0

LU_AGRICULTURE

0

1

LU_ALL

2

LU_BUSINESS

3

LU_CIVIC_RELIGIOUS

4

LU_CULTURAL

5

LU_DISTRIBUTION

5

6

LU_INTERMODAL

7

LU_EDUCATION_PREK

8

LU_EDUCATION_K_8

9

LU_EDUCATION_9_12

10

LU_HIGHER_EDUCATION

used to be 8, now 10

11

LU_HOTEL

12

LU_INDUSTRIAL

used to be 10

13

LU_MANUFACTURING

14

LU_SHOPPING

15

LU_MEDICAL

15

16

LU_MIXED_USE

17

LU_NONE

used to be 15

18

LU_NON_RESIDENTIAL

19

LU_RESIDENTIAL

20

20

LU_RESIDENTIAL_MULTI

20

21

LU_RECREATION

22

LU_SPECIAL_GENERATOR

used to be 20

23

TRANSIT_STOP

24

LU_SERVICE

25

LU_RETAIL

26

LU_RESTAURANT

27

LU_EXTERNAL

27, used to be 25