3DBAG / 3dbag-viewer

https://3dbag.nl
GNU General Public License v3.0
35 stars 10 forks source link

Use a web API to request building attributes #47

Open Ylannl opened 3 years ago

Ylannl commented 3 years ago

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 commented 3 years ago

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.