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

Fix/geos threadsafe #186

Closed
wants to merge 7 commits into from
Closed
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
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cmake_minimum_required (VERSION 3.16)
project( val3dity )


add_definitions(-std=c++14)
add_definitions(-std=c++17)

set( CMAKE_BUILD_TYPE "Release")
set( CMAKE_CXX_FLAGS "-O2" )
Expand All @@ -25,7 +25,6 @@ endif(MSVC)
# CGAL
find_package( CGAL QUIET COMPONENTS )
if ( CGAL_FOUND )
include( ${CGAL_USE_FILE} )
message(STATUS "CGAL found")
message(STATUS ${CGAL_LIBRARIES})
message(STATUS ${CGAL_3RD_PARTY_LIBRARIES})
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ In short, it verifies whether a 3D primitive respects the definition as given in

The validation of the following 3D primitives is fully supported:

- ``MultiSurface``
- ``CompositeSurface``
- ``Solid``
- ``MultiSolid``
- ``CompositeSolid``
* ``MultiSurface``
* ``CompositeSurface``
* ``Solid``
* ``MultiSolid``
* ``CompositeSolid``

Unlike many other validation tools in 3D GIS, inner rings in polygons/surfaces are supported and so are cavities in solids (also called voids or inner shells).

Expand All @@ -23,13 +23,13 @@ There is no plan to support these geometries.

val3dity accepts as input:

- [CityJSON](http://www.cityjson.org)
- [CityJSON Sequences (CityJSONSeq)](https://www.cityjson.org/cityjsonseq/)
- [tu3djson](https://github.com/tudelft3d/tu3djson)
- [JSON-FG (OGC Features and Geometries JSON)](https://github.com/opengeospatial/ogc-feat-geo-json)
- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)
- [OFF](https://en.wikipedia.org/wiki/OFF_(file_format))
- [IndoorGML](http://indoorgml.net/)
* [CityJSON](http://www.cityjson.org)
* [CityJSON Sequences (CityJSONSeq)](https://www.cityjson.org/cityjsonseq/)
* [tu3djson](https://github.com/tudelft3d/tu3djson)
* [JSON-FG (OGC Features and Geometries JSON)](https://github.com/opengeospatial/ogc-feat-geo-json)
* [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)
* [OFF](https://en.wikipedia.org/wiki/OFF_(file_format))
* [IndoorGML](http://indoorgml.net/)

For the CityJSON and IndoorGML formats, extra validations are performed (specific to the format), eg the overlap between different parts of a building, or the validation of the navigation graph in IndoorGML.

Expand All @@ -46,7 +46,7 @@ The simplest, if you have [Homebrew](http://brew.sh/), is:
You can also get the code, and compile it yourself.
You first need to install the following free libraries:

1. [CGAL v5.4+](http://www.cgal.org)
1. [CGAL v5.4+](http://www.cgal.org) (CGAL 6.0 works too)
1. [Eigen library](http://eigen.tuxfamily.org)
1. [GEOS](http://trac.osgeo.org/geos/)
1. [CMake](http://www.cmake.org)
Expand Down Expand Up @@ -133,6 +133,7 @@ In the folder `tools/viz3dity/`, there is a simple Python script where you can l
However, it's not possible to see where in an object the error is (eg which surface is not planar).
This tool helps to quickly visualise where the errors are in a large dataset, for instance a city.


## Documentation and help

Read the full documentation at [https://val3dity.rtfd.io](https://val3dity.rtfd.io).
Expand Down
2 changes: 1 addition & 1 deletion bumpver.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpver]
current_version = "2.5.0"
current_version = "2.5.1"
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
commit = false
tag = false
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
## [Unreleased]
- validation of topological relationships between features, eg ensuring that buildings in a city do not overlap

## [2.5.1] - 2024-10-02
### Changed
- CGAL 6.0 can be used (small changes to the `CMakeLists.txt`)
- fix a buggy report for complex geom types
- improves the description of the validation report in the docs

## [2.5.0] - 2024-07-17
### Added
Expand Down
1 change: 1 addition & 0 deletions docs/_static/report_diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
# built documents.
#
# The short X.Y version.
version = u'2.5.0'
version = u'2.5.1'
# The full version, including alpha/beta/rc tags.
release = u'2.5.0'
release = u'2.5.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
135 changes: 0 additions & 135 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,141 +19,6 @@ This tests, among many others, the following:
You can read more about the `details <https://github.com/tudelft3d/val3dity/blob/main/tests/README.md>`_, or check the `complete list of tested geometries <https://github.com/tudelft3d/val3dity/blob/main/data/test_metadata.yml>`_


How to interpret the report?
----------------------------

With the option ``--report`` a JSON report is output.

The report lists the errors at two levels:

1. errors with the input files (errors 9xx)
2. all other errors, per feature (eg for each Building the list of errors is given)

The report contains several properties, one example:

.. code-block:: json

{
"type": "val3dity_report",
"time": "2024-05-21T12:16:50 (CEST)",
"input_file": "/home/elvis/myfile.city.json",
"input_file_type": "CityJSON",
"val3dity_version": "2.5.0",
"validity": false,
"parameters": {
"overlap_tol": -1.0,
"planarity_d2p_tol": 0.01,
"planarity_n_tol": 20.0,
"snap_tol": 0.001
},
"all_errors": [102, 104, 203, 601],
"dataset_errors": [],
"features_overview": [
{
"total": 644,
"type": "Building",
"valid": 324
},
{
"total": 1,
"type": "TINRelief",
"valid": 1
}
],
"primitives_overview": [
{
"total": 1490,
"type": "Solid",
"valid": 1305
},
{
"total": 1,
"type": "CompositeSurface",
"valid": 1
}
],
"features": []
}


The property ``"validity"`` is used to report whether the file is 100% valid, or not.
If it's invalid, then ``"all_errors"`` lists all the error codes present in the input file (the list is empty if the file is valid).

``"dataset_errors"`` lists all the errors related to the input file (errors 9xx).

``"features_overview"`` gives you an overview of the features in the file, in this case there were 644 Buildings and 1 TINRelief.

``"primitives_overview"`` gives you, similarly, an overview of the geometric primitives.

The ``"features"`` property list all the features in the file, and for each the errors are reported, if any.
An example is as follows:

.. code-block:: json

{
"features": [
{
"id": "GUID_0048B9B9-8028-4C01-9D55-6D96F0AB3A15",
"type": "Building",
"validity": true,
"errors": []
},
{
"id": "GUID_00D36CED-764E-4631-B88C-EA98528BA782",
"type": "Building",
"validity": false,
"errors": [
{
"code": 203,
"description": "NON_PLANAR_POLYGON_DISTANCE_PLANE",
"id": "coid=GUID_00D36CED-764E-4631-B88C-EA98528BA782_1|geom=0|shell=0|face=4",
"info": "distance to fitted plane: 0.0122035 (tolerance=0.01)"
}
]
},
{
"id": "GUID_00723D18-2A2C-47B4-ACF3-F5B6F4EC7224",
"type": "Building",
"validity": true,
"errors": [],
},
{
"id": "GUID_032A685A-1262-4157-A797-C9ED49A65725",
"type": "Building",
"validity": false
"errors": [
{
"code": 601,
"description": "BUILDINGPARTS_OVERLAP",
"id": "coid=GUID_032A685A-1262-4157-A797-C9ED49A65725_1|geom=0&&coid=GUID_032A685A-1262-4157-A797-C9ED49A65725_2|geom=0",
"info": "geometries are lod=2",
"type": "Error"
}
],
},
]
}


For each primitive, its identifier is (``"id"``) is given, its ``"type"``, and its ``"validity"``.
The ``"errors"`` property is always listed, and it is an array of the errors; it is an empty array if the feature is valid.

Because a feature (eg a Building) can contain several geometries and children (eg the BuildingPart of a Building), we report the error by giving extra information about its location.
``coid=`` tells you the City Object identifier.
``geom=0`` tells you that it's the first geometry in the list of geometries (if CityJSON is used), and similarly ``solid=1`` would indicate the second solid in a MultiSolid, ``shell=1`` would indicate that the 2nd shell in the Solid has an issue, and ``face=13`` would mean the 14th surface listed in the primitive has an issue.
A 0-based system is used for reporting.

You can navigate this report with a JSON browser (eg drag it into an empty window in Firefox) or by loading it to the `val3dity report browser <http://geovalidation.bk.tudelft.nl/val3dity/browser/>`_:

.. image:: _static/report1.png
:width: 49%
.. image:: _static/report2.png
:width: 49%

There you get an overview of the statistics per features and primitives, and each feature has its errors as children.



I get many errors 203 and 204, but my planes look planar to me. Why is that?
----------------------------------------------------------------------------

Expand Down
140 changes: 140 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,146 @@ The formal definitions of the 3D primitives, along with explanations, are given
:width: 60%


How to interpret the report?
----------------------------

With the option ``--report`` a JSON report is output.

The report lists the errors at two levels:

1. errors with the input files (errors 9xx)
2. all other errors, per feature (eg for each Building the list of errors is given)

This is a diagram of the structure of the report; watch out not all options for the properties are shown.

.. image:: _static/report_diagram.svg
:width: 100%


The report contains several properties, one example:

.. code-block:: json

{
"type": "val3dity_report",
"time": "2024-05-21T12:16:50 (CEST)",
"input_file": "/home/elvis/myfile.city.json",
"input_file_type": "CityJSON",
"val3dity_version": "2.5.0",
"validity": false,
"parameters": {
"overlap_tol": -1.0,
"planarity_d2p_tol": 0.01,
"planarity_n_tol": 20.0,
"snap_tol": 0.001
},
"all_errors": [102, 104, 203, 601],
"dataset_errors": [],
"features_overview": [
{
"total": 644,
"type": "Building",
"valid": 324
},
{
"total": 1,
"type": "TINRelief",
"valid": 1
}
],
"primitives_overview": [
{
"total": 1490,
"type": "Solid",
"valid": 1305
},
{
"total": 1,
"type": "CompositeSurface",
"valid": 1
}
],
"features": []
}


The property ``"validity"`` is used to report whether the file is 100% valid, or not.
If it's invalid, then ``"all_errors"`` lists all the error codes present in the input file (the list is empty if the file is valid).

``"dataset_errors"`` lists all the errors related to the input file (errors 9xx).

``"features_overview"`` gives you an overview of the features in the file, in this case there were 644 Buildings and 1 TINRelief.

``"primitives_overview"`` gives you, similarly, an overview of the geometric primitives.

The ``"features"`` property list all the features in the file, and for each the errors are reported, if any.
An example is as follows:

.. code-block:: json

{
"features": [
{
"id": "GUID_0048B9B9-8028-4C01-9D55-6D96F0AB3A15",
"type": "Building",
"validity": true,
"errors": []
},
{
"id": "GUID_00D36CED-764E-4631-B88C-EA98528BA782",
"type": "Building",
"validity": false,
"errors": [
{
"code": 203,
"description": "NON_PLANAR_POLYGON_DISTANCE_PLANE",
"id": "coid=GUID_00D36CED-764E-4631-B88C-EA98528BA782_1|geom=0|shell=0|face=4",
"info": "distance to fitted plane: 0.0122035 (tolerance=0.01)"
}
]
},
{
"id": "GUID_00723D18-2A2C-47B4-ACF3-F5B6F4EC7224",
"type": "Building",
"validity": true,
"errors": [],
},
{
"id": "GUID_032A685A-1262-4157-A797-C9ED49A65725",
"type": "Building",
"validity": false,
"errors": [
{
"code": 601,
"description": "BUILDINGPARTS_OVERLAP",
"id": "coid=GUID_032A685A-1262-4157-A797-C9ED49A65725_1|geom=0&&coid=GUID_032A685A-1262-4157-A797-C9ED49A65725_2|geom=0",
"info": "geometries are lod=2",
"type": "Error"
}
]
}
]
}


For each primitive, its identifier is (``"id"``) is given, its ``"type"``, and its ``"validity"``.
The ``"errors"`` property is always listed, and it is an array of the errors; it is an empty array if the feature is valid.

Because a feature (eg a Building) can contain several geometries and children (eg the BuildingPart of a Building), we report the error by giving extra information about its location.
``coid=`` tells you the City Object identifier.
``geom=0`` tells you that it's the first geometry in the list of geometries (if CityJSON is used), and similarly ``solid=1`` would indicate the second solid in a MultiSolid, ``shell=1`` would indicate that the 2nd shell in the Solid has an issue, and ``face=13`` would mean the 14th surface listed in the primitive has an issue.
A 0-based system is used for reporting.

You can navigate this report with a JSON browser (eg drag it into an empty window in Firefox) or by loading it to the `val3dity report browser <http://geovalidation.bk.tudelft.nl/val3dity/browser/>`_:

.. image:: _static/report1.png
:width: 49%
.. image:: _static/report2.png
:width: 49%

There you get an overview of the statistics per features and primitives, and each feature has its errors as children.



Options for the validation
--------------------------
Expand Down
1 change: 0 additions & 1 deletion src/Feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ json Feature::get_report_json()
for (auto& e : _errors[std::get<0>(err)])
{
json jj;
jj["type"] = "Error";
jj["code"] = std::get<0>(err);
jj["description"] = ALL_ERRORS[std::get<0>(err)];
jj["id"] = std::get<0>(e);
Expand Down
Loading
Loading