Skip to main content

Python workflow to generate LCZ tiles for rendering in 3D in QGIS

Project description

Cityblocks

Python utility to:

  • Download global LCZ map from Demuzere et al..
  • Extract an area of interest
  • Generate a new dataset where each pixel is replaced by a 2D tile corresponding to the LCZ type

The generated file can be displayed in QGIS to create stunning visualizations in 3D.

How to use

# Install the tool
pip install git+https://github.com/Urban-M4/cityblocks.git

# Download global LCZ data. 
cityblocks download

# Extract area of interest
cityblocks extract "4.724808,52.273620,5.182114,52.458729"

# Convert LCZ data to 2d tiles
cityblocks convert

Data is downloaded in folder where the command is executed.

QGIS styling

Then, import the dataset in QGIS and visualize it. We created a QGIS styling file cityblocks_LCZ.qml, which you can load as follows:

  1. Load layer in QGIS (we used 3.34.8 LTR) Load layer in QGIS

  2. Go to properties: Go to properties

  3. Load Style from cityblocks_LCZ.qml Load style

  4. You can modify the style as you like modify the style

  5. Create a 3D map view Create a 3D map view

  6. Browse through you Local Climate Zones Cityblocks! Go to properties

Note that you can add styled 2D layers in your QGIS environment to show them in your 3D render.

Example output

The file generated by the cityblocks command line utility looks like this when imported in QGIS.

2d version of LCZ tiles

By extruding the surface and applying a bit of styling, we can generate images like below:

3d version of LCZ tiles

The tiles can also be combined with other map layers:

3d tiles with background image

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

cityblocks-0.0.2.tar.gz (69.5 kB view details)

Uploaded Source

Built Distribution

cityblocks-0.0.2-py3-none-any.whl (71.5 kB view details)

Uploaded Python 3

File details

Details for the file cityblocks-0.0.2.tar.gz.

File metadata

  • Download URL: cityblocks-0.0.2.tar.gz
  • Upload date:
  • Size: 69.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cityblocks-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b0b3b2a50b14530622591bb6204f897121c2352481616df18b0b0f88fc7645ae
MD5 5ec5e43024dd7cb11a648eebd6f1abca
BLAKE2b-256 61328955cff9a478f9e867ba1092fff263ca8f5402e743d842c0c06097cc3cbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for cityblocks-0.0.2.tar.gz:

Publisher: pypi.yml on Urban-M4/cityblocks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cityblocks-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: cityblocks-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 71.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cityblocks-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3ed2c065e6e961c237d927d02673d902b41e83547563a03ca4083c573de6851
MD5 095fc65aa94d956662cf838fdf39de31
BLAKE2b-256 9e165865f2cabcf0a22278b1001cea541e6f95f0521139d2f22c8b969b61d476

See more details on using hashes here.

Provenance

The following attestation bundles were made for cityblocks-0.0.2-py3-none-any.whl:

Publisher: pypi.yml on Urban-M4/cityblocks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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