Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.7.5 #144

Merged
merged 103 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
10145ae
cjio-9 subset more than one type: `subset --cotype Building,TINRelief…
balazsdukai Jan 5, 2022
724ce05
cjio-10 BBOX subset in a loop has unreliable behaviour
balazsdukai Jan 5, 2022
a156e69
cjio-19 cityjson.load() crashes when reading a geom of type "Geometry…
balazsdukai Jan 5, 2022
98a21a1
Fixes #83
balazsdukai Jan 5, 2022
24d2b49
Merge branch 'master' into develop
balazsdukai Jan 6, 2022
10be4d0
Merge branch 'develop' into cjio-20
balazsdukai Jan 6, 2022
ddcec74
Update glb export to v1.1
balazsdukai Jan 6, 2022
db9ac34
Fix glb export when CityObject does not have geometry
balazsdukai Jan 6, 2022
0b0352b
Fix coordinate system on glb export
balazsdukai Jan 6, 2022
b52015b
Update triangulate method fixtures to parameterized fixtures
balazsdukai Jan 10, 2022
ccbad37
Revert get_normal_newell so that it also returns the boolean
balazsdukai Jan 10, 2022
8734e51
Fix materials merge test
balazsdukai Jan 10, 2022
b9d8365
cjio-35 Make export format an argument not an option
balazsdukai Jan 10, 2022
654d2d1
Test fixtures have function scope instead of session
balazsdukai Jan 10, 2022
c91054a
Fix the removal of texture and material from the geometry
balazsdukai Jan 10, 2022
0cdccdd
loop on co without geometry
gperonato Jan 13, 2022
62b8648
Merge pull request #129 from gperonato/co-nogeom
hugoledoux Jan 14, 2022
9faee89
Revert conditional NumPy import (Fixes #42)
balazsdukai Jan 19, 2022
362e038
Remove unused imports and the unused remove_textures module
balazsdukai Jan 19, 2022
2424e26
Numpy is a hard requirement
balazsdukai Jan 19, 2022
556bbef
dockerignore
balazsdukai Jan 21, 2022
abbf191
Change entrypoint to root path
balazsdukai Jan 21, 2022
3d52def
Exclude pycharm run dir
balazsdukai Jan 21, 2022
24b26a5
Ubuntu based docker image with image stripping
balazsdukai Jan 21, 2022
95a10dc
dockerignore
balazsdukai Jan 21, 2022
f2bd872
Change entrypoint to root path
balazsdukai Jan 21, 2022
35afc95
Exclude pycharm run dir
balazsdukai Jan 21, 2022
78344f3
Debian based multi-stage docker build
balazsdukai Jan 25, 2022
e8e6f7a
Remove Travis-CI
balazsdukai Jan 25, 2022
5dd5806
Docker build on master
balazsdukai Jan 25, 2022
9463deb
Add docker image labels
balazsdukai Jan 25, 2022
8692da8
Merge pull request #133 from cityjson/docker-ubuntu
balazsdukai Jan 25, 2022
048ec28
Merge remote-tracking branch 'origin/develop' into develop
balazsdukai Jan 25, 2022
a531920
Merge branch 'master' into develop
balazsdukai Jan 25, 2022
fba7107
Remove code for older versions of cityjson
hugoledoux Feb 3, 2022
1c50328
WIP to handle metadata & +metadata-extended better
hugoledoux Feb 3, 2022
2710503
Formatting code
hugoledoux Feb 3, 2022
7cee766
Remove functions in metadata not needed
hugoledoux Feb 3, 2022
b068f39
clean code, remove unused function
hugoledoux Feb 3, 2022
31879f7
Do not select parent of COs in subset, just children
hugoledoux Feb 3, 2022
1a27024
WIP to refactor subset functions
hugoledoux Feb 3, 2022
e955ee2
WIP again on subset
hugoledoux Feb 3, 2022
0ce2134
Add parents+siblings for subset
hugoledoux Feb 3, 2022
22823ba
Add subset/radius operator
hugoledoux Feb 4, 2022
eb426c9
Add version for MetadataExtended, define once and reuse
hugoledoux Feb 4, 2022
4b2ac0d
Clean code: remove unused variables
hugoledoux Feb 4, 2022
b3c5688
Fix bug in metadata-extended generation when CO has no "geometry"
hugoledoux Feb 4, 2022
e80044a
Output of `info --long` has things sorted
hugoledoux Feb 4, 2022
aa94699
Fix the crs_translate ops that didn't work with --values for compress…
hugoledoux Feb 23, 2022
4ff241e
WIP with Shewchuk Triangle
hugoledoux Feb 25, 2022
d3f151d
WIP triangulation with Shewchuk
hugoledoux Feb 25, 2022
bf94da0
still WIP
hugoledoux Feb 25, 2022
9e9cbdc
Fix crashes, 3dbag tile of Delft is working!
hugoledoux Feb 25, 2022
e9727ad
Clean the code for triangulation of faces
hugoledoux Feb 25, 2022
138a25f
Fix bug where Triangle segfault with duplicate points
hugoledoux Mar 9, 2022
88689e5
Output a fixed number of digits (based on "transform") for OBJ export
hugoledoux Mar 15, 2022
45242a8
Fix bug with invalid data when triangulating, but still segfault...
hugoledoux Mar 16, 2022
87d3d31
Put back the mapbox-earcut triangulator, this is now the option '--sl…
hugoledoux Mar 17, 2022
dd60d73
Deep copy from source CM in subset
balazsdukai Mar 25, 2022
4d0abb3
Merge branch 'master' into develop
balazsdukai Apr 3, 2022
2e2c6a5
Fix random subset
balazsdukai Apr 3, 2022
c5bc17f
Add triangle library to install extras; Fix stl export test
balazsdukai Apr 3, 2022
ebc357d
Get meaningful error message from cityjson.get_epsg
balazsdukai Apr 3, 2022
b93175e
Fix issue with broken change in click 8.1.0
liberostelios Jun 20, 2022
ac9c57b
Merge branch 'master' into develop
hugoledoux Jun 20, 2022
1f8af7c
Fix issue where `lod_filter` wouldn't work for number-like lods
liberostelios Jun 20, 2022
2295ec5
Merge branch 'develop' of github.com:cityjson/cjio into develop
liberostelios Jun 20, 2022
cb509f2
Merge branch 'master' into develop
hugoledoux Jul 11, 2022
3d9b923
Merge branch 'master' into develop
hugoledoux Aug 8, 2022
367ac5d
Add draft function to read CityJSONL from stdin
hugoledoux Aug 8, 2022
74cc469
Fix error in setup.py, comma missing
hugoledoux Aug 8, 2022
9ec5ce8
Merge branch 'develop' into feature/jsonl
hugoledoux Aug 8, 2022
1016125
Add a flat --suppress_msg to the reader operator so that nothing is s…
hugoledoux Aug 8, 2022
044b6ac
Add stdout to save command
hugoledoux Aug 8, 2022
52d5250
Add stdout to export command
hugoledoux Aug 8, 2022
a2e71b9
Clean and format code
hugoledoux Aug 8, 2022
a36bea7
Put new email Balázs
hugoledoux Aug 8, 2022
56d9e08
Remove validate for reading jsonl because it's an optional package
hugoledoux Aug 8, 2022
fa41e31
Terminate the function to read jsonl from stdin with "appearances"
hugoledoux Aug 8, 2022
74ed273
Cosmetic changes
hugoledoux Aug 8, 2022
2b5ad28
Fix metadata lineage
hugoledoux Aug 9, 2022
8aa6b51
Fix and upgrade all test files to cityjson v1.1
hugoledoux Aug 9, 2022
10db3c1
Add python script to upgrade all test files
hugoledoux Aug 9, 2022
dc7711f
Comment out some unused things for the API, caused issues
hugoledoux Aug 9, 2022
5fadf94
Fix bug when geometry property not present
hugoledoux Aug 9, 2022
718f626
Add back dummy and dummy_noappearance for the pytest
hugoledoux Aug 9, 2022
514f7cc
Fix pytest about metadata generation
hugoledoux Aug 9, 2022
17d3055
Misc formatting of code
hugoledoux Aug 9, 2022
c212209
Fix some parts of the readme
hugoledoux Aug 9, 2022
f8bb163
Add a section about stdin and stdout in the readme
hugoledoux Aug 9, 2022
53caa61
Fix errors in the readme commands to use std/in/out
hugoledoux Aug 9, 2022
f343dd1
Fix copyrights and year
hugoledoux Aug 9, 2022
9366b34
Fix links in the readme
hugoledoux Aug 9, 2022
a390b3a
Refactor warnings and CityJSON version checking
balazsdukai Aug 26, 2022
c381252
Merge pull request #143 from cityjson/check-version
balazsdukai Aug 26, 2022
2f14897
Switch to pyproj TransformerGroup
balazsdukai Aug 29, 2022
56bcbb5
Add reproject method to API Geometry
balazsdukai Aug 29, 2022
8f77049
Suppress alert too
balazsdukai Aug 29, 2022
ce2c0aa
Require pyproj 3.0.0
balazsdukai Aug 30, 2022
2af9763
Remove dummy/dummy-triangulated.json from tests
balazsdukai Aug 30, 2022
cbde59e
Update CHANGELOG.md
balazsdukai Aug 30, 2022
09b0b2e
Bump version: 0.7.4 → 0.7.5
balazsdukai Aug 30, 2022
9ced881
Fix glb converter
balazsdukai Aug 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
venv
.pytest_cache
.git
.run
docs
tests
tmp
cjio.egg-info
18 changes: 18 additions & 0 deletions .github/workflows/docker-image-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag tudelft3d/cjio:latest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ ENV/

# PyCharm
.idea*
/.run/

# KDE
.directory
Expand Down
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# Changelog


## [0.7.5] – 2022-08-80
### Added
- Subset more than one CityObject type (#9)
- `models.Geometry.reproject()` for reprojecting dereferenced geometry boundaries
- Read from `stdin` and save to `stdout`
- `--suppress_msg` to suppress all messages. Required when saving to `stdout`

### Fixed
- Subset with BBOX does not modify the input model anymore (#10)
- `cityjson.load()` does not fail on a `GeometryInstance`, however it does not load it either (#19)
- Fixes to the *glb* exporter (#20, #57, #83), and fixed the coordinate system
- `texture` and `material` are correctly removed from the geometries of the CityObjects with `textures/materials_remove`
- `vertex-texture` is removed from the CityJSON with `textures_remove`
- Docker image build (#77, #132)
- Other minor fixes

### Changed
- Export format is an argument, not an option (#35), e.g. `cjio ... export obj out.obj`
- NumPy is a hard requirement
- Require pyproj >= 3.0.0 (#142)
- Refactor warnings and alert printing (#143)

## [0.7.4] - 2022-06-20
### Fixed
- crash wiht new version of Click (>=8.1) (#140)
- crash with new version of Click (>=8.1) (#140)
### Added
- templates for bug reporting

Expand Down
119 changes: 35 additions & 84 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,98 +1,50 @@
FROM alpine:3.10
FROM python:3.8.12-slim-bullseye AS builder

#
# Install proj4
#
ARG PROJ_VERSION=6.2.0
RUN apk --update add sqlite libstdc++ sqlite-libs libgcc && \
apk --update add --virtual .proj4-deps \
make \
RUN useradd -u 1001 -G root app && \
chgrp -R 0 /etc/passwd && \
chmod -R g=u /etc/passwd && \
mkdir /app && \
chgrp -R 0 /app && \
chmod -R g=u /app

RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
gcc \
g++ \
file \
sqlite-dev \
unzip && \
cd /tmp && \
wget http://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz && \
tar xfvz proj-${PROJ_VERSION}.tar.gz && \
rm -f proj-${PROJ_VERSION}.tar.gz && \
wget http://download.osgeo.org/proj/proj-datumgrid-1.8.zip && \
unzip proj-datumgrid-1.8.zip -d proj-${PROJ_VERSION}/nad/ && \
rm -f proj-datumgrid-1.8.zip && \
wget http://download.osgeo.org/proj/proj-datumgrid-europe-1.1.zip && \
unzip proj-datumgrid-europe-1.1.zip -d proj-${PROJ_VERSION}/nad/ && \
rm -f proj-datumgrid-europe-1.1.zip && \
wget http://download.osgeo.org/proj/proj-datumgrid-north-america-1.1.zip && \
unzip proj-datumgrid-north-america-1.1.zip -d proj-${PROJ_VERSION}/nad/ && \
rm -f proj-datumgrid-north-america-1.1.zip && \
wget http://download.osgeo.org/proj/proj-datumgrid-oceania-1.0.zip && \
unzip proj-datumgrid-oceania-1.0.zip -d proj-${PROJ_VERSION}/nad/ && \
rm -f proj-datumgrid-oceania-1.0.zip && \
cd proj-${PROJ_VERSION} && \
./configure && \
make -j 4 && \
make install && \
echo "Entering root folder" && \
cd / &&\
echo "Cleaning dependencies tmp and manuals" && \
apk del .proj4-deps && \
libgeos-3.9.0 \
libproj19

ARG PIP_VERSION="pip==21.3.1"
ARG SETUPTOOL_VERSION="setuptools==60.5.0"
COPY setup.py setup.cfg README.rst LICENSE CHANGELOG.md /app/
COPY cjio /app/cjio
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN cd /app && \
python3 -m pip install ${PIP_VERSION} ${SETUPTOOL_VERSION} && \
pip install .[export,validate,reproject] && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
proj
cjio --version

# Install geos
ARG GEOS_VERSION=3.7.1
RUN apk --update add --virtual .geos-deps \
which \
make \
gcc \
g++ \
file \
git \
autoconf \
automake \
libtool && \
cd /tmp && \
git clone https://git.osgeo.org/gitea/geos/geos.git geos && \
cd geos && \
git checkout ${GEOS_VERSION} && \
./autogen.sh && \
./configure && \
make -j 4 && \
make install && \
cd ~ && \
apk del .geos-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man
FROM python:3.8.12-slim AS cjio
LABEL org.opencontainers.image.authors="Balázs Dukai <[email protected]>"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.url="https://github.com/cityjson/cjio"
LABEL org.opencontainers.image.description="Python CLI to process and manipulate CityJSON files. The different operators can be chained to perform several processing operations in one step, the CityJSON model goes through them and different versions of the CityJSON model can be saved as files along the pipeline."
LABEL org.opencontainers.image.title="cjio"

RUN adduser -u 1001 -G root -s /bin/bash -D app && \
RUN useradd -u 1001 -G root -s /bin/bash app && \
chgrp -R 0 /etc/passwd && \
chmod -R g=u /etc/passwd && \
mkdir /app && \
chgrp -R 0 /app && \
chmod -R g=u /app && \
apk --update add \
gcc \
bash \
make \
git \
libc-dev \
python3
chmod -R g=u /app

ARG PIP_VERSION="pip==19.2.1"
ARG SETUPTOOL_VERSION="setuptools==41.0.1"
RUN cd /app && \
apk --update add --virtual .cjio-build-deps \
musl-dev \
python3-dev && \
python3 -m venv .venv --system-site-packages && \
.venv/bin/pip3 install ${PIP_VERSION} ${SETUPTOOL_VERSION} cjio shapely && \
apk del .cjio-build-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
.venv/bin/cjio --help
COPY --from=builder /opt/venv /opt/venv

COPY --chown=1001:0 uid_entrypoint.sh /usr/local/bin/
ENV PATH="/opt/venv/bin:$PATH"

RUN mkdir /data && \
chown 1001 /data && \
Expand All @@ -107,5 +59,4 @@ USER 1001

ENTRYPOINT ["/usr/local/bin/uid_entrypoint.sh"]

CMD ["/bin/bash"]

CMD ["cjio"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 3D geoinformation group at TU Delft (https://3d.bk.tudelft.nl)
Copyright (c) 2022 3D geoinformation group at TU Delft (https://3d.bk.tudelft.nl)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 25 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ To install the latest release:

pip install cjio

.. note:: The commands ``export``, ``reproject``, and ``validate`` require extra packages
.. note:: The commands ``export``, ``triangulate``, ``reproject``, and ``validate`` require extra packages
that are not install by default. You can install these packages by specifying the
commands for pip.

.. code:: console

pip install 'cjio[export,reproject]'
pip install 'cjio[export,reproject,validate]'

To install the development branch, and still develop with it:

Expand Down Expand Up @@ -62,7 +62,7 @@ Supported CityJSON versions
---------------------------

The operators (``cjio --version``) expect that your file is using the latest version `CityJSON schema <https://www.cityjson.org/specs/overview/>`_.
If your file uses an earlier version, you can upgrade it with the ``upgrade`` operator.
If your file uses an earlier version, you can upgrade it with the ``upgrade`` operator: ``cjio old.json upgrade save newfile.city.json``


Usage of the CLI
Expand All @@ -82,7 +82,7 @@ possibilities:
crs_reproject Reproject to a new EPSG.
crs_translate Translate the coordinates.
export Export to another format.
info Output info in simple JSON.
info Output information about the dataset.
lod_filter Filter only one LoD for a dataset.
materials_remove Remove all materials.
merge Merge the current CityJSON with other ones.
Expand All @@ -100,7 +100,6 @@ possibilities:
validate Validate the CityJSON: (1) against its schemas (2)...
vertices_clean Remove duplicate vertices + orphan vertices


Or see the command-specific help by calling ``--help`` after a command:

.. code:: console
Expand Down Expand Up @@ -143,6 +142,25 @@ Operators like ``info`` and ``validate`` output information in the console and j
cjio myfile.city.json merge '/home/elvis/temp/*.city.json' save all_merged.city.json


stdin and stdout
----------------

Starting from v0.8, cjio allows to read/write from stdin/stdout (standard input/output streams).

For reading, it accepts at this moment only `CityJSONL (text sequences with CityJSONFeatures) <https://www.cityjson.org/specs/#text-sequences-and-streaming-with-cityjsonfeature>`_.
Instead of putting the file name, ``stdin`` must be used.

For writing, both CityJSON files and `CityJSONL files <https://www.cityjson.org/specs/#text-sequences-and-streaming-with-cityjsonfeature>`_ can be piped to stdout.
Instead of putting the file name, ``stdout`` must be used.
Also, the different operators of cjio output messages/information, and those will get in the stdout stream, to avoid this add the flat ``--suppress_msg`` when reading the file, as shown below.

.. code:: console

cat myjsonlfile.txt | cjio --suppress_msg stdin remove_materials save stdout
cjio --suppress_msg myfile.city.json remove_materials export jsonl stdout | less
cat myfile.city.json | cjio --suppress_msg stdin crs_reproject 7415 export jsonl mystream.txt


Generating Binary glTF
----------------------

Expand All @@ -151,14 +169,14 @@ Convert the CityJSON ``example.city.json`` to a glb file

.. code:: console

cjio example.json export --format glb /home/elvis/gltfs
cjio example.json export glb /home/elvis/gltfs

Convert the CityJSON ``example.city.json`` to a glb file
``/home/elvis/test.glb``

.. code:: console

cjio example.city.json export --format glb /home/elvis/test.glb
cjio example.city.json export glb /home/elvis/test.glb

Usage of the API
----------------
Expand Down
2 changes: 1 addition & 1 deletion cjio/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.7.4'
__version__ = '0.7.5'
Loading