tudelft3d / val3dity

Validation of 3D primitives according to the international standard ISO19107
GNU General Public License v3.0
92 stars 23 forks source link

A CityJSON with an empty Solid reported as valid #84

Closed balazsdukai closed 6 years ago

balazsdukai commented 6 years ago

The test pytest -k "empty_primitive" -v tests various files with empty primitives. Among them, two cityjson that contain a CompositeSolid with two Solids. In both cityjson, one of the Solids is empty, but both reported valid. I think they should report 902. Both files are valid according to cityjson-valschema

empty_primitive.json

  "CityObjects": {
    "id-1":{
      "type": "GenericCityObject",
      "geometry": [{
        "type": "CompositeSolid",
        "lod": 1,
        "boundaries": [
          [ 
            [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]], [[1, 2, 6, 5]], [[2, 3, 7, 6]], [[3, 0, 4, 7]] ]
          ],
          [ 
          ]
        ]
      }] 
    }
  },

empty_primitive_1.json

  "CityObjects": {
    "id-1":{
      "type": "GenericCityObject",
      "geometry": [{
        "type": "CompositeSolid",
        "lod": 1,
        "boundaries": [
          [ 
            [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]], [[1, 2, 6, 5]], [[2, 3, 7, 6]], [[3, 0, 4, 7]] ]
          ],
          [ [ ]
          ]
        ]
      }] 
    }
  },
hugoledoux commented 6 years ago

hmmm, but your composite solid has 2 solid: one that is valid and the other empty... thus their interaction is fine. That was my reasoning. But I see your point, although if a Shell of a Solid is empty, returning 902 too?

balazsdukai commented 6 years ago

That's what i thought, because in these cases there is a reference to a geometry that doesn't exist. By reference i understand the empty Shell, Solid declarations in boundaries. So i think this case would represent 902, because the Solid is declared, but its empty.

hugoledoux commented 6 years ago

you're right, 902 should be returned for that case too.

Now fixed, all types return 902 at validation time if a solid is empty (in a MSol and CSol too thus)

ce150c4f447a6c34b9c1278c9987e24bb6568005