[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"readme:city2graph":3},"\u003Ch1>City2Graph: Geospatial Graphs for Network Analysis and GNNs\u003C\u002Fh1>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fcity2graph.net\u002Flatest\u002F\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fcity2graph.net\u002Flatest\u002Fassets\u002Flogos\u002Fsocial_preview_city2graph.png\" alt=\"City2Graph\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\u003Cp>\u003Cstrong>City2Graph\u003C\u002Fstrong> is a Python library that turns buildings, streets, public\ntransport feeds, origin–destination matrices, zones, and points of interest\ninto spatial and heterogeneous graphs. It bridges\n\u003Ca href=\"https:\u002F\u002Fgeopandas.org\u002F\" rel=\"nofollow ugc noopener\">GeoPandas\u003C\u002Fa>, \u003Ca href=\"https:\u002F\u002Fnetworkx.org\u002F\" rel=\"nofollow ugc noopener\">NetworkX\u003C\u002Fa>, and\n\u003Ca href=\"https:\u002F\u002Fpytorch-geometric.readthedocs.io\u002Fen\u002Flatest\u002F\" rel=\"nofollow ugc noopener\">PyTorch Geometric\u003C\u002Fa> so the\nsame geospatial data can support network analysis, urban research, and Graph\nNeural Networks (GNNs). See the\n\u003Ca href=\"https:\u002F\u002Fcity2graph.net\u002Flatest\u002F\" rel=\"nofollow ugc noopener\">documentation\u003C\u002Fa> for installation, tutorials,\nand the Python API reference.\u003C\u002Fp>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Fcity2graph\u002F\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Fcity2graph.svg\" alt=\"PyPI version\" \u002F>\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Fcity2graph\u002F\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Fcity2graph\u002Fbadges\u002Fversion.svg\" alt=\"conda-forge Version\" \u002F>\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fpepy.tech\u002Fprojects\u002Fcity2graph\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fstatic.pepy.tech\u002Fbadge\u002Fcity2graph\" alt=\"PyPI Downloads\" \u002F>\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fdoi.org\u002F10.1016\u002Fj.compenvurbsys.2026.102492\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDOI-10.1016%2Fj.compenvurbsys.2026.102492-blue?logo=doi&amp;logoColor=white\" alt=\"DOI\" \u002F>\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fc2g-dev\u002Fcity2graph\u002Fblob\u002Fmain\u002FLICENSE\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-BSD_3--Clause-blue.svg\" alt=\"License\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Fcity2graph\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fanaconda.org\u002Fconda-forge\u002Fcity2graph\u002Fbadges\u002Fplatforms.svg\" alt=\"Platform\" \u002F>\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002Fc2g-dev\u002Fcity2graph\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fcodecov.io\u002Fgh\u002Fc2g-dev\u002Fcity2graph\u002Fgraph\u002Fbadge.svg?token=2R449G75Z0\" alt=\"codecov\" \u002F>\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fruff\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fendpoint?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fastral-sh\u002Fruff\u002Fmain\u002Fassets\u002Fbadge\u002Fv2.json\" alt=\"Ruff\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\u003Ch2>Features\u003C\u002Fh2>\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fcity2graph.net\u002Flatest\u002F\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fcity2graph.net\u002Flatest\u002Fassets\u002Ffigures\u002Fscope.png\" alt=\"City2Graph workflow from geospatial data to graph analysis\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Morphology:\u003C\u002Fstrong> Graphs of buildings, streets, and tessellated urban fabric from OpenStreetMap and Overture Maps.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Transportation:\u003C\u002Fstrong> GTFS public transport and GBFS shared-mobility feeds loaded\ninto DuckDB, with GTFS aggregated into stop-to-stop transit graphs.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Mobility:\u003C\u002Fstrong> Origin–destination matrices and flow data — migration, bike-sharing, pedestrian counts — as weighted spatial graphs.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Proximity and Contiguity:\u003C\u002Fstrong> KNN, Delaunay, Gilbert, and Waxman graphs plus queen\u002Frook contiguity, under Euclidean, Manhattan, or network distances.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Heterogeneous Graphs and Metapaths:\u003C\u002Fstrong> Multiple node and edge types in one graph, with metapath-derived edges composing relations across them.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>GNN-ready Tensors:\u003C\u002Fstrong> Round-trip conversion between GeoDataFrames, NetworkX, and PyTorch Geometric \u003Ccode>Data\u003C\u002Fcode>\u002F\u003Ccode>HeteroData\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>Installation\u003C\u002Fh2>\n\u003Ch3>Using pip\u003C\u002Fh3>\n\u003Ch4>Basic Installation\u003C\u002Fh4>\n\u003Cp>City2Graph supports Python 3.12–3.14. The simplest way to install it is via pip:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">pip install city2graph\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>This installs the core functionality without PyTorch and PyTorch Geometric.\u003C\u002Fp>\n\u003Ch4>With PyTorch (CPU)\u003C\u002Fh4>\n\u003Cp>If you need the Graph Neural Networks functionality, install with the \u003Ccode>cpu\u003C\u002Fcode> option:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">pip install \"city2graph[cpu]\"\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>This will install PyTorch and PyTorch Geometric with CPU support, suitable for development and small-scale processing.\u003C\u002Fp>\n\u003Ch4>With PyTorch + CUDA (GPU)\u003C\u002Fh4>\n\u003Cp>For GPU acceleration, you can install City2Graph with a specific CUDA version extra. For example, for CUDA 13.0:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">pip install \"city2graph[cu130]\"\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Supported CUDA versions are \u003Ccode>cu126\u003C\u002Fcode>, \u003Ccode>cu128\u003C\u002Fcode>, and \u003Ccode>cu130\u003C\u002Fcode>.\nThe \u003Ccode>cpu\u003C\u002Fcode>, \u003Ccode>cu126\u003C\u002Fcode>, and \u003Ccode>cu130\u003C\u002Fcode> extras use PyTorch 2.13 or newer. Because\nPyTorch no longer publishes CUDA 12.8 wheels past 2.11, \u003Ccode>cu128\u003C\u002Fcode> uses PyTorch 2.11.\u003C\u002Fp>\n\u003Ch3>Using conda\u003C\u002Fh3>\n\u003Ch4>Basic Installation\u003C\u002Fh4>\n\u003Cp>You can also install City2Graph using conda from conda-forge:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">conda install -c conda-forge city2graph\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>This installs the core functionality without PyTorch and PyTorch Geometric.\u003C\u002Fp>\n\u003Ch4>With PyTorch (CPU)\u003C\u002Fh4>\n\u003Cp>To use PyTorch and\u003C\u002Fp>\n",1787445486854]