Skip to main content

Add your description here

Project description

CrossNM

Python package for downloading, and caching network rail geometry models as GeoPandas GeoDataFrames.

What this package provides

CrossNM has two network model views, both of which use "EPSG: 27700" (https://epsg.io/27700) as a coordinate reference system:

  • Full model

  • Simplified model: produces a single-line representation of the network and is not split by ELR.


Installation

pip install crossnm

Quick start

from crossnm import FullModel, SimplifiedModel

tracks_gdf = FullModel(hasLogs=False).download() # Entire network model loaded, logs are suppressed

subsection_gdf = FullModel().download_many(["AAV","GAE"]) # Subset of ELRs are selected from Entire network model

simplified_tracks_gdf = SimplifiedModel().download()

Cache Behaviour

When available, FullModel().download() will load relevant geometries from a local cache. This is created when the geometry was last downloaded.

The GeoDataFrames are stored as .pkl files alongside cache information as a .json. The cache .json contains information on the life-span of the cache as a unix timestamp, as well as when the geometry was last cached.

On loading the geometry, the cache information is inspected, and if the cache is out of date, the geometry is replaced with a download from the google storage bucket. The cache information is then updated with the new time of cacheing.

Logs

If logs are not required, pass hasLogs=False into the constructor of the loader.

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

crossnm-0.2.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

crossnm-0.2.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file crossnm-0.2.1.tar.gz.

File metadata

  • Download URL: crossnm-0.2.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for crossnm-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5cb74f5377b4f59e8f45d75fe3b291577e17c20c9f24ca918c10380b20650a11
MD5 069358e1cd6b772000ac715723af48db
BLAKE2b-256 70ff522e79b88f74d468d01ea2b20c5f509befce664871bb184d6a958e0cbfe8

See more details on using hashes here.

File details

Details for the file crossnm-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: crossnm-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for crossnm-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c34afd8d4d2ff0054f1066f17cc9b62d4f70b50491f7e1e4c3a76b645b62e542
MD5 4737aeb019e651fb84a4618590b21580
BLAKE2b-256 e9824678e55dd74fde26dea57d897b06a081ff387a44976cb356ae43331ecf09

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