This assignment consists of the following parts:
In this step, you will replace the remote WFS service with a local WFS you shall create. Set up your own WFS service for ‘pand’ data as follows:
data/pand_delft.zip directory into
.../webapps/geoserver/data/data (make sure you go down into the second
data directory.)pand_2d_4326.shp via Add store, then publish the layer💡 Map looking funny?
Is your map looking skewed, perhaps something is wrong with the CRS? We’ve encountered this before.
💡 JSON Parser Plug-ins
Reading JSON (or GeoJSON, for that matter) can be a bit tough. There are browser / IDE plugins that parse and present the contents in a prettier way.
❓ Question / Result #1
- Include with your report as separate file: The GeoJSON output of the WFS preview
lab6/index.html (edit with text editor)url_wfs, featuretype and geometryName so that the WFS request will go to http://localhost:8080/geoserver to load your ‘pand’ layer. Note: these values will depend on your local Geoserver settings for the layer, for example the namespace/workspace of the layer (=featuretype)Test if the changed WFS request works (refresh your browser, or if that does
not help: tick disable cache inside web developer tools or clear the browser
cache)
❓ Question / Result #2
Include in your report:
- The adapted code in
index.html- The url of at least one relevant WFS request to localhost (there can be more) as seen in the Web developer tool
- Explain how the data is organized spatially (in other words: How does the client know which parts of the data currently to be displayed in the view port can be retrieved)? Relate your answer to the relevant parts of the Javascript code that are responsible for determining which data needs to be visible, when a user pans or zooms.
We will now select only a part of the WFS layer (adapt .../osm_buildings/index.html).
In case you have issues with the CQL query, visit and read: https://en.wikipedia.org/wiki/Percent-encoding. For example: %2F is same as / and a space between characters can be encoded as + or %20.
Test whether the CQL query works as intended by you (refresh the page).
💡 Tip: CQL query parameters
The parameters you can query / filter by are limited to the field names of the features. There are various ways to find the available field names (QGIS, GeoServer, the output of the click-query on the map).
❓ Question / Result #3
Include in your report:
- The adapted CQL-query string
- A screenshot of the result
- Reflect in a structured way on what you would improve? This is just a basic web app to visualize buildings in a city, based on extrusion. What aspects would you improve (besides more realistic height)? Include in your report:
- Your suggested improvements
- For which group or groups of users would these improvements be especially useful?
- Add examples of publicly available 3D geodata web apps you also like: Mention them (with reference and/or URL).
In your browser go to http://localhost:8080/geoweb/lab6/3d_tiles/, this will load 3D Tiles from the tileset directory inside Cesium, a 3D globe application.
The 3D buildings are coloured according to tax values for the year 2020 (totVal2020) of the buildings.
Read the web page Styling and Filtering 3D Tiles in Cesium.
Now edit index.html and colour the buildings according to ‘number of floor’ (KAT_SAYISI) attribute.
Use at least three different colour intervals (e.g. 0-3, 3-6, 6+).
A website like https://colorbrewer2.org can be useful to obtain a colour
scheme.
💡 Tip
The order of your conditions matter!
Go to the tileset folder, open tileset.json with a text editor of your choice and investigate the structure of tileset.json file.
Also open one of the (smaller) .b3dm files with a simple text editor, but not Sublime.
Now answer the following Question.
❓ Question / Result #4
Include in your report:
- The adapted
index.html- A screenshot of the result
- For the
tileset.json: Using the OGC 3D Tiles Specification 1.0 (http://docs.opengeospatial.org/cs/18-053r2/18-053r2.html), interpret the tileset and tile properties (e.g. asset, properties, geometricError, root, refine, children, etc.) of the tileset.json file with your own words.- For the
.b3dmfile: Which parts are human readable, and which parts are not? What information do the parts contain? Also, relate these parts to their name from the specification (hint: Section 9). If you’re curious, you can open the file with Sublime too and notice the way the text is rendered is a bit less chaotic.
For this part, we will work with the contents of .../lab6/potree/.
Add into index.html, the following Javascript code to add 2 layers with Pointcloud data into the viewer (hint: the ‘viewer’ instance already needs to be defined):
Potree.loadPointCloud("http://ahn2.pointclouds.nl/potree_data/tile_all/cloud.js", "AHN-2 (processed by TU Delft)", function(e){
viewer.scene.addPointCloud(e.pointcloud);
let material = e.pointcloud.material;
material.size = 0.8;
material.minSize = 2.0;
material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
material.shape = Potree.PointShape.CIRCLE;
material.activeAttributeName = "elevation";
material.elevationRange = [-1, 65];
e.pointcloud.position.x += 3;
e.pointcloud.position.y -= 3;
e.pointcloud.position.z += 4;
viewer.fitToScreen();
});
Potree.loadPointCloud("http://ahn2.pointclouds.nl/ahn2-hwh/metadata.json", "AHN-2 (processed by Het Waterschapshuis)", function(e){
e.pointcloud.visible = false
viewer.scene.addPointCloud(e.pointcloud);
let material = e.pointcloud.material;
material.size = 0.8;
material.minSize = 2.0;
material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
material.shape = Potree.PointShape.CIRCLE;
material.activeAttributeName = "elevation";
material.elevationRange = [-1, 65];
e.pointcloud.position.x += 3;
e.pointcloud.position.y -= 3;
e.pointcloud.position.z += 4;
viewer.fitToScreen();
});
Once you’ve modified index.html, visit: http://localhost:8080/geoweb/lab6/potree/ and familiarize yourself with the Potree interface (on the left, you find the menu, that has folded regions, which can be opened by clicking on their heading).
Under ‘Appearance’ one can adjust how many points will be rendered at once (useful if your laptop is not that powerful). If the above modifications were made properly, then under ‘Scene’ → ‘Point Clouds’ the two layers show up.
The data for the two Pointcloud layers were processed in two different ways to obtain a nested Octree structure with points (see References below). As a result, how the Octree actually is stored in files on the web server is different. We will look at the differences in the following Question.
❓ Question / Result #5
Compare the web requests the viewer makes for fetching the point cloud data, in the Octree structure as pre-processed by TU Delft and by Het Waterschapshuis.
Answer the following two questions:
For both Pointcloud layers: Which requests are responsible for the Octree hierarchy and which requests are responsible for the data? Any other relevant requests for fetching the (meta)data (hint: how does Potree ‘know’ the layout of the Octree to visit nodes, when the user zooms or pans)?
What are the differences between the requests made for the two layers? Look at least at: For which URL is the request made? What are the
HTTPstatus codes and what headers do you see (specifically look for presence ofContent-LengthandContent-Rangeheader). Hint: https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests.
In case you want to know more about how the Octree datasets were generated, you can read the following 2 research papers:
Submit Lab 6 together with the result of Lab 5.
For this Lab 6, you submit (on Brightspace):