Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Tilers accepting various input formats (OBJ, 3DCity databases, GeoJson, IFC) and producing 3DTiles tilesets.

License

LGPL-2.1, Unknown licenses found

Licenses found

LGPL-2.1
LICENSE
Unknown
LICENSE.md
NotificationsYou must be signed in to change notification settings

VCityTeam/py3dtilers

Repository files navigation

⚠️ Arrested development⚠️

Alas, starting on January 2025, the current Py3dTilers development team will move on to new projects. Py3dTilers will thus no longer be developed nor maintained.Thecurrent repository owners are thus looking for a community (a set of individuals, teams or corporations) that would be willing to adopt py3dTilers in order to pursue the development activity.This transition could take the form of adding new developers and transmitting the MAINTAINER role (at the repository level).But, as allowed by theLICENSE, the transmission could go as far as relinquishing the repository ownership to another responsible organization.

At this stage, some contacts were made with some public or private organizations (currently using and/or contributing to py3dTilers). If the future of py3dTilers interests you, and you would willing to engage some resources to take the lead onmaintaining/developing py3dTilers, please providein this issue some sketchy declaration of intention and possibly a coarse roadmap.

Deciding the actual form of transmission will be based on the result of the public discussion happeningin this issue.


Build StatusDocumentation Status

Python 3.9Python 3.10Python 3.11Python 3.12

Py3DTilers is a Python tool and library allowing to build3D Tiles tilesets out of various geometrical formats e.g.OBJ,GeoJSON,IFC orCityGML through3DCityDB databases.

Py3DTilers usesPy3DTiles python library for its in memory representation of tilesets.

Py3DTilers can only produceBatched 3D Models (B3DM). If you want to producePoint Clouds (PNTS), seePy3DTiles CLI.

An article that presents the tool is available in the ISPRS annalshere.

Demo

Find 3D Tiles created with Py3DTilers inthis online demo.

CLI Features

  • Common features: features shared by all tilers
  • ObjTiler: converts OBJ files to a 3D Tiles tileset
  • GeojsonTiler: converts GeoJson files to a 3D Tiles tileset
  • IfcTiler: converts IFC files to a 3D Tiles tileset
  • CityTiler: converts CityGML features (e.g buildings, water bodies, terrain...) extracted from a 3dCityDB database to a 3D Tiles tileset
  • TilesetReader: read, merge or transform 3DTiles tilesets

Installation from sources

Seesupported Python versions

For Unix

Install binary sub-dependencies with your platform package installer e.g. for Ubuntu use

apt-get install -y libpq-dev# required usage of psycopg2 within py3dtilersapt-get install python3 python3-dev

Install Py3DTilers in a safepython virtual environment (not mandatory yet quite recommended)

apt-get install virtualenv gitgit clone https://github.com/VCityTeam/py3dtilerscd py3dtilersvirtualenv -p python3 venv. venv/bin/activate(venv)$ pip install -e.

For Windows

In order to install Py3DTilers from sources use:

git clone https://github.com/VCityTeam/py3dtilerscd py3dtilerspython3 -m venv venv. venv/Scripts/activate(venv)$ pip install -e.

Usage

In order to access to the different flavors of tilers, refer to the corresponding readmes to discover their respective usage and features:

Useful tutorials:

Develop with Py3DTilers

Before commiting, pleaserun tests and make surecoding style is respected.

Running the tests

After the installation, if you additionally wish to run unit tests, use

(venv)$ pip install -e .[dev,prod](venv)$ pytest

To run CityTiler's tests, you need to install PostgreSQL and Postgis.

To setup PostgreSQL with Postgis on Windows, follow the first step (1. Download PostgreSQL/PostGIS) of3DCityDB tutorial.
For Ubuntu, followthis tutorial.

Coding style

First, install the additional dev requirements

(venv)$ pip install -e .[dev]

To check if the code follows the coding style, runflake8

(venv)$ flake8.

You can fix most of the coding style errors withautopep8

(venv)$ autopep8 --in-place --recursive py3dtilers/

If you want to applyautopep8 from root directory, exclude thevenv directory

(venv)$ autopep8 --in-place --exclude='venv*' --recursive.

Developing Py3DTilers together with py3dtiles

By default, the Py3DTilers'setup.py build stage usesgithub's version of py3dtiles (as opposed to usingOslandia's version on Pypi.When developing one might need/wish to use a local version of py3dtiles (located on host in another directory e.g. by cloning the original repository) it is possible

  1. to first install py3dtiles by following theinstallation notes
  2. then within the Py3DTilers (cloned) directory, comment out (or delete)the line reference to py3dtiles.

This boils down to :

$ git clone https://github.com/VCityTeam/py3dtiles$cd py3dtiles$ ...$source venv/bin/activate(venv)$cd ..(venv)$ git clone https://github.com/VCityTeam/py3dtilers(venv)$cd py3dtilers(venv)$# Edit setup.py and comment out py3dtiles reference(venv)$ pip install -e.(venv)$ pytest

Concerning CityTiler

  • For developers, somedesign notes
  • Credentials: CityTiler original code is due to Jeremy Gaillard (when working at LIRIS, University of Lyon, France)

Configuring your IDE

When configuring your IDE to run a specific tiler, you must indicate the module you want to run (e.g. py3dtilers.CityTiler.CityTiler) and not the path to the file (i.e. not ${workspace_root}/py3dtilers/CityTiler/CityTiler.py), otherwise python will not be able to resolve the relative import of the Tilers to the Common package of Py3DTilers. An example of launch configuration in VSCode:

{"version":"0.2.0","configurations": [    {"name":"<launch_config_name>",// e.g. "CityTiler" or "bozo""type":"python","request":"launch","module":"<tiler_module>",// e.g. py3dtilers.CityTiler.CityTiler"args": ["--db_config_path","${workspaceRoot}/py3dtilers/CityTiler/<my_config_file.yml>"      ],"console":"integratedTerminal"    }  ]}

Profiling

Python standard modulecProfile allows to profile Python code.

In code

Import modules:

importcProfileimportpstats

Profile the code betweenenable() anddisable():

cp=cProfile.Profile()cp.enable()# Start profiling# code herecp.disable()# Stop profilingp=pstats.Stats(cp)p.sort_stats('tottime').print_stats()# Sort stats by time and print them

In command line

cProfile can be run in the shell with:

python -m cProfile script.py

About

Tilers accepting various input formats (OBJ, 3DCity databases, GeoJson, IFC) and producing 3DTiles tilesets.

Topics

Resources

License

LGPL-2.1, Unknown licenses found

Licenses found

LGPL-2.1
LICENSE
Unknown
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp