Skip to content

Commit

Permalink
Add a /filesize/ page
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed Oct 5, 2023
1 parent 727c831 commit 58d95e0
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 6 deletions.
10 changes: 9 additions & 1 deletion _data/datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
json-size: 7.0
gml: 9-284-556.gml
gml-size: 57
gml-size-wo: 40
# textures: none
validity: 98% buildings valid
details: "Buildings in LoD 0, 1.2, 1.3, 2.2; multiple attributes"
Expand All @@ -15,6 +16,7 @@
json-size: 293
gml: Zurich_Building_LoD2_V10.gml
gml-size: 2990
gml-size-wo: 2100
# textures: none
validity: 76% buildings valid
details: "Buildings in LoD2"
Expand All @@ -26,6 +28,7 @@
json-size: 2.7
gml: DenHaag_01.xml
gml-size: 30
gml-size-wo: 19
# textures: none
validity: 62% features valid
details: "'Tile 01', Buildings (in LoD2) and Terrain are merged"
Expand All @@ -37,6 +40,7 @@
json-size: 5.6
gml: VM05_2009.gml
gml-size: 75
gml-size-wo: 53
# textures: none
validity: 86% buildings valid
details: Tile 'VM05'. Buildings in LoD2
Expand All @@ -48,6 +52,7 @@
json-size: 110
gml: DA13_3D_Buildings_Merged.gml
gml-size: 980
gml-size-wo: 682
# textures: none
validity: 99.9% buildings are valid (only 21 are invalid)
details: Tile 'DA13'. Buildings in LoD2
Expand All @@ -59,6 +64,7 @@
json-size: 2.7
gml: 3-20-DELFSHAVEN.xml
gml-size: 25
gml-size-wo: 18
textures: 3-20-DELFSHAVEN.zip
validity: 76% buildings valid
details: Neighbourhood 'Delfshaven'. Buildings in LoD2
Expand All @@ -70,6 +76,7 @@
json-size: 4.5
gml: LoD3_Railway.gml
gml-size: 50
gml-size-wo: 39
textures: LoD3_Railway.zip
validity: 74% features valid
details: CityGML demo. Buildings, Railway, Terrain, Vegetation (with Geometry Templates), Water, Tunnels
Expand All @@ -81,6 +88,7 @@
json-size: 5.6
gml: Vienna_102081.gml
gml-size: 58
# textures: none
gml-size-wo: 40
textures: none
validity: 98.5% buildings valid
details: Buildings in LoD2
4 changes: 2 additions & 2 deletions datasets/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Please be aware that we simply converted the datasets, some datasets contain (ge
<table >
<tr>
<th>dataset</th>
<th>CityGML file (size)</th>
<th>CityGML-XML file (size)</th>
<th>CityJSON file (size)</th>
<th>textures</th>
<th><a href="https://github.com/tudelft3d/val3dity">geometric validity</a></th>
Expand All @@ -78,7 +78,7 @@ Please be aware that we simply converted the datasets, some datasets contain (ge
{% endfor %}
</table>

<i class="fas fa-exclamation-circle"></i> It should be observed that on average CityJSON compresses ~6X a CityGML, and that without any loss of information ([see details](https://github.com/cityjson/specs/wiki/Compression-factor-for-a-few-open-CityGML-datasets)).
<i class="fas fa-exclamation-circle"></i> On average CityJSON compresses ~7X a CityGML-XML file, and that without any loss of information ([see more details]({{ '/filesize/' | prepend: site.baseurl }})).

<i class="fas fa-exclamation-circle"></i> We performed the geometric validation with [val3dity](https://github.com/tudelft3d/val3dity) and report the overall result in the column 'validity'. To understand the errors, we suggest validating the files ([how to do this]({{ '/tutorials/validation/' | relative_url }})) yourself.

Expand Down
67 changes: 67 additions & 0 deletions filesize/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
layout: default
title: File size
nav_exclude: true
permalink: /filesize/
---

# File size

## Table of contents
{: .no_toc .text-delta }

1. TOC
{:toc}

---


## CityJSON vs CityGML-XML: 7X compression

{% assign ds = site.data.datasets | sort: 'name' %}

<table >
<tr>
<th>dataset</th>
<th>CityJSON v2.0</th>
<th>CityGML-XML v3.0</th>
<th>textures</th>
<th>details</th>
<th>compression</th>
</tr>
{% for i in ds %}
<tr>
<td><a href="{{ i.url }}">{{ i.name }}</a></td>
<td>{{ i.json-size }}MB (<a href="https://3d.bk.tudelft.nl/opendata/cityjson/3dcities/v2.0/{{ i.json }}">download)</a></td>
<td>{{ i.gml-size-wo }}MB (<a href="https://3d.bk.tudelft.nl/opendata/cityjson/3dcities/citygml/{{ i.gml }}">download</a>)</td>
<td>
{% if i.textures %}
<a href="https://3d.bk.tudelft.nl/opendata/cityjson/3dcities/citygml/{{ i.textures }}">[ZIP]</a>
{% else %}
none
{% endif %}
</td>
<td>{{ i.details }}</td>
<td><b>{{ i.gml-size-wo | divided_by: i.json-size | round: 1 }}X</b></td>
</tr>
{% endfor %}
</table>

<i class="fas fa-exclamation-circle"></i> Observe that the file size doesn't take into account the size of the textures files (PNG, JPG, etc) since CityJSON refers to the same ones.

<i class="fas fa-exclamation-circle"></i> CityGML-XML files have all the carriage returns, tabs and spaces removed with this script, for a fair estimation of the compression factor.

<i class="fas fa-exclamation-circle"></i> CityJSON files do not contain CR or spaces or any formatting.


- - -

## CityJSON compared to traditional computer graphic formats

This very nice study ([evaluation of file formats in the context of geo-referenced 3D geometries](https://github.com/FHOOEAIST/geofiles)) compares several file formats for 3D geometries, with a focus on geographical datasets.

The outcome is that CityJSON is nearly as compact as much simpler formats (OBJ, STL, OFF), and it still allows different CRS, textures, complex attributes, complex geometries, etc.

The [summary graph](https://github.aist.science/geofiles/) is particulary nice, click to get an interactive graph!

[![](summary.png)](https://github.aist.science/geofiles/)
Binary file added filesize/summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ It was designed with programmers in mind, so that tools and APIs supporting it c
We believe that you should use CityJSON because:

1. its simplicity means adding CityJSON support to your software is easy, [many software already support it]({{ "/software/" | prepend: site.baseurl }})
2. you can in one-click convert CityGML files to CityJSON files, and vice versa, with the open-source tool [citygml-tools](https://github.com/citygml4j/citygml-tools); we even have a [tutorial]({{ "/tutorials/conversion/" | prepend: site.baseurl }})
3. files are on average [6X more compact](https://github.com/cityjson/specs/wiki/Compression-factor-for-a-few-open-CityGML-datasets) than their CityGML equivalent
4. you can automatically convert to/from CityGML v3.0 XML files with the excellent [citygml-tools](https://github.com/citygml4j/citygml-tools)
2. you can in one-click convert CityGML-XML files to CityJSON files, and vice versa, with the open-source tool [citygml-tools](https://github.com/citygml4j/citygml-tools); we even have a [tutorial]({{ "/tutorials/conversion/" | prepend: site.baseurl }})
3. files are on average [7X more compact]({{ '/filesize/' | prepend: site.baseurl }}) than their CityGML-XML equivalent
4. you can automatically convert to/from CityGML-XML v3.0 files with the excellent [citygml-tools](https://github.com/citygml4j/citygml-tools)
5. there is a [web-viewer](https://viewer.cityjson.org) where you can drag-and-drop a file
6. you can easily manipulate files with [cjio](https://github.com/cityjson/cjio), you can for instance merge files, remove/filter objects, change the CRS, manage the textures, etc.
7. you can *easily* define [Extensions]({{ "/extensions/" | prepend: site.baseurl }}) to the core model
Expand Down

0 comments on commit 58d95e0

Please sign in to comment.