3dbag-viewer icon indicating copy to clipboard operation
3dbag-viewer copied to clipboard

Use a web API to request building attributes

Open Ylannl opened this issue 4 years ago • 1 comments

Instead of relying on the B3DM attributes, which does not contain all the 3DBAG attributes. In addition we could also show the standard BAG attributes.

Ylannl avatar Feb 26 '21 12:02 Ylannl

This can be achieved through WFS based on the identificatie attribute, eg:

let url = "https://data.3dbag.nl/api/BAG3D_v2/wfs?service=wfs&version=2.0.0&request=GetFeature&typeNames=BAG3D_v2:lod22&outputFormat=json&filter=";
let filter = "<Filter><PropertyIsEqualTo><PropertyName>identificatie</PropertyName><Literal>NL.IMBAG.Pand.0329100000002936</Literal></PropertyIsEqualTo></Filter>";
url = url + encodeURIComponent( filter );

fetch( url )
.then( response => response.json() )
.then( data => console.log( data ) );
}

But this is very slow; ~9s vs <1s for a GetFeature request on the FeatureId (which is the gid in the database, not accessible in b3dm). In addition: several features might be returned (roofparts, buildingparts of same building), and which one should we show for the building? Not entirely clear.

In short, I'm leaving this for now.

Ylannl avatar Mar 22 '21 19:03 Ylannl