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

Revert "v0.7.5" #145

Merged
merged 1 commit into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 8 deletions .dockerignore

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/docker-image-master.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ ENV/

# PyCharm
.idea*
/.run/

# KDE
.directory
Expand Down
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
sudo: required

language: cpp

services:
- docker

install: skip

script:
- echo "skipping tests"
- docker login --username ${DOCKER_USERNAME} --password ${DOCKER_PASSWORD}
- docker pull tudelft3d/cjio:latest || true
- docker build . --cache-from tudelft3d/cjio:latest -t tudelft3d/cjio:latest


deploy:
- provider: script
script: docker push tudelft3d/cjio:latest
skip_cleanup: true
on:
branch: master
- provider: script
script: docker tag tudelft3d/cjio:latest tudelft3d/cjio:dev ; docker push tudelft3d/cjio:dev
skip_cleanup: true
on:
branch: develop
- provider: script
script: docker tag tudelft3d/cjio:latest tudelft3d/cjio:${TRAVIS_TAG} ; docker push tudelft3d/cjio:${TRAVIS_TAG}
skip_cleanup: true
on:
tags: true
24 changes: 1 addition & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
# 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 with new version of Click (>=8.1) (#140)
- crash wiht new version of Click (>=8.1) (#140)
### Added
- templates for bug reporting

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

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 \
#
# Install proj4
#
ARG PROJ_VERSION=6.2.0
RUN apk --update add sqlite libstdc++ sqlite-libs libgcc && \
apk --update add --virtual .proj4-deps \
make \
gcc \
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] && \
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 && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
cjio --version
proj

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"
# 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

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

COPY --from=builder /opt/venv /opt/venv
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 --chown=1001:0 uid_entrypoint.sh /usr/local/bin/
ENV PATH="/opt/venv/bin:$PATH"

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

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

CMD ["cjio"]
CMD ["/bin/bash"]

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) 2022 3D geoinformation group at TU Delft (https://3d.bk.tudelft.nl)
Copyright (c) 2018 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: 7 additions & 25 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``, ``triangulate``, ``reproject``, and ``validate`` require extra packages
.. note:: The commands ``export``, ``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,validate]'
pip install 'cjio[export,reproject]'

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: ``cjio old.json upgrade save newfile.city.json``
If your file uses an earlier version, you can upgrade it with the ``upgrade`` operator.


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 information about the dataset.
info Output info in simple JSON.
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,6 +100,7 @@ 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 @@ -142,25 +143,6 @@ 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 @@ -169,14 +151,14 @@ Convert the CityJSON ``example.city.json`` to a glb file

.. code:: console

cjio example.json export glb /home/elvis/gltfs
cjio example.json export --format 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 glb /home/elvis/test.glb
cjio example.city.json export --format 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.5'
__version__ = '0.7.4'
Loading