Skip to content

OSMnx 2.0 Migration Guide #1123

Open
Open
@gboeing

Description

Overview

OSMnx 2.0.0 was released in November 2024. This major release includes some breaking changes (including removing previously deprecated functionality) that are not backwards compatible with v1. This issue provides guidance on migrating from v1 to v2.

Migrating to v2

If you want to ensure your code is fully compatible with OSMnx v2 before upgrading to it, you can install the latest v1 release (currently 1.9.4), then run your code. The latest v1 release will remain compatible with the v1 API, but any deprecated functionality you're using will issue a FutureWarning with simple guidance to make it v2 compatible. Additionally, you can:

  • refer to the new official OSMnx reference paper up-to-date for v2
  • check out the Examples Gallery, which has been updated for v2 compatibility if you're looking for sample code
  • see the changelog for details

Key changes

The three biggest overarching changes in 2.0 are:

  1. The package is now fully type-annotated throughout.
  2. Several modules have been refactored or wholly rewritten for performance optimization.
  3. Flexible and customizable graph simplification and node consolidation.
  4. The package's API has been streamlined and made more consistent, including some breaking changes and some moved/renamed functions.

In addition to these, there have been many smaller enhancements, fixes, and changes. See the changelog for details and see the latest documentation for an up-to-date user reference.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions