3dcitydb / 3dcitydb-web-map

Cesium-based 3D viewer and JavaScript API for the 3D City Database
Apache License 2.0
377 stars 125 forks source link

Issues with retireval and visualisation of attributes #56

Closed gioagu closed 4 years ago

gioagu commented 4 years ago

Hi!

I am retrieving attributes via PostgREST. Some issues I have notices in the current version (1.8.3):

1) The labels (and associated behavious) seem inverted: you choose horizontal, and you get a vertical view (see attached images).

2) The vertical (i.e. horizontal) one seems broken (see example).

Annotation1

Annotation2

Son-HNguyen commented 4 years ago

Hi!

Can you give an example of how the JSON response of your PostgreSQL REST service looks like?

Son-HNguyen commented 4 years ago

You can fetch the JSON response directly from the browser using for example the following URL: http://<HOST>/<TABLE>?gmlid=eq.<GMLID> where <HOST>, <TABLE> and <GMLID> should be replaced by corresponding values.

gioagu commented 4 years ago

Hi,

the JSON response is:

[{"gmlid":"PandID_0363100012233523","address":"Hobbemakade 6","postcode":"1071XK","class":"Non-residential (multi-function)","bag_function":null,"usage":"Kantoor; Opslag / Distributie; Recreatie / Sportcentrum","year_of_construction":1912,"measured_height":"13.36 m","bag_footprint_area":"1814 m^2","ahn3_gross_volume":"24234 m^3"}]

It's coming from a view exposed via PostgREST (6.0.2).

BR

Son-HNguyen commented 4 years ago

It seems that you have a "horizontal" table hosted by PostgREST (all object attributes in one row), so by selecting the table type All object attributes in one row, such JSON responses can be displayed correctly. Selecting the table type One row per object attribute would result in an error, since the table type here is incompatible. Note that the two options All object attributes in one row and One row per object attribute both refer to the structure of the tables stored in PostgreSQL and not how they are displayed in the web client.

gioagu commented 4 years ago

Thanks for the explanation, this is a detail I had completely missed.