Skip to main content

A Python module for calculating and analyzing three types of congestion—Road, PM, and Pedestrian congestion.

Project description

ewha-congestions

A Python module for calculating and analyzing three types of congestion—Road, PM, and Pedestrian congestion—using trajectory data collected from CCTV systems. It includes safety-aware adjustments based on pedestrian-vehicle and pedestrian-pedestrian interactions.

How to use

'''python from ewha_congestions.three_congestions import processing_congestions

df = your data. data index must be DatetimeIndex as "dtct_dt". data must has point geometry as "geomatry", "snr_id", "distance", "speed", "acceleration", "traj_id", "direction", "mf_type", and "apr_code"

road_shp = your road data. road data must has Polygon geometry of roads as "geometry" and CCTV ID as "snr_id".

road_shp = road_shp.to_crs("EPSG:5179") for calculate road area

road_cong, ped_cong, pm_cong = processing_congestions(df, road_shp, 3600).call()

''' df: includes object tracking data with fields like snr_id, mf_type, apr_code, geometry, dtct_dt, speed, and acceleration.

road_df: includes road information with fields snr_id and geometry.

interval: time window (in seconds) over which congestion is aggregated and computed.

Output

Each output (road_cong, ped_cong, pm_cong) is a DataFrame with:

CCTV_ID: unique identifier for each camera

time: timestamp of the congestion record

congestion_level: integer from 0 to 4

0: Excellent (≤ 0.2)

1: Good (≤ 0.4)

2: Normal (≤ 0.6)

3: Crowded (≤ 0.8)

4: Very Crowded (> 0.8)

Congestion Types Type | Description Road Congestion | Combined area occupied by all moving objects divided by the road polygon area PM Congestion | PM area only, normalized by unoccupied space (excluding pedestrian & vehicle) Pedestrian Congestion | Road congestion adjusted using pedestrian-pedestrian and pedestrian-vehicle conflicts

Requirements

numpy pandas geopandas movingpandas tqdm shapely geopy

License

This project is licensed under the JiyoonLee License.

Contact

0197black@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ewha_congestions-0.1.8.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ewha_congestions-0.1.8-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file ewha_congestions-0.1.8.tar.gz.

File metadata

  • Download URL: ewha_congestions-0.1.8.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for ewha_congestions-0.1.8.tar.gz
Algorithm Hash digest
SHA256 78f5d237baa2c80b0480e331680ee325ffb1e1e21952f083aee359272462b4d3
MD5 4925a2b63de8c53225f704e6a1b8aa5f
BLAKE2b-256 981d87ff9a0df1c5fff3ccaa293538758d84f524fd84f9287abcf94a7c70e9c3

See more details on using hashes here.

File details

Details for the file ewha_congestions-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for ewha_congestions-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5b52d8e7b5b626245617d78de440adfbc6e73feaa7d5b21d3f09c24f4cdfac15
MD5 d7f23c820c5ce587267a5f9057e4c922
BLAKE2b-256 2ee1c91f23ed412f708feaaf65343db42ccab5550c9483e9d0075affd15687c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page