Comments (9)
Yo @misonishiki!
First of all, welcome to the CityJSON world. 🙏
I am not entirely sure that I understand your question. Semantic roof values aren't points or lines. They are attributes attached to the polygons of the roofs themselves.
I am, also, not sure why you are getting duplicate geometries. You said you filtered for roof surfaces only? Keep in mind that, whilst the data are 3D QGIS processing cannot cope with it correctly most of the times so it treats the geometries as 2D. So, if you left there both roof and ground surfaces, QGIS might be treating them as duplicates (because they have the same 2D projection).
Which model is this one? Could you possibly share the data? You might, also, want to inspect the geometry itself in 3D through ninja, to get a better understanding of how the geometry is stored.
from cityjson-qgis-plugin.
Nice, that's exactly what I mean by I'm not sure what is going on here. I can rephrase, the question is why are there double geometries?
I uploaded the CityJSON model via the plugin on QGIS. It's tile 3693 from the 3DBag. I extracted polygons by attribute = roofsurface, which is stored in the LoD2.2 layer. So QGIS is processing only what polygon/feature is labelled roof surface. So I don't think I have both roof and ground surfaces, I merely extracted only 'roof' features. Which is why I'm a bit confused on the double geometries. Essentially I'm using it to calculate the surface area of the roofs
I converted a DEM of the area of interest with SAGA's real surface area and then used zonal statistics to sum up the surface area pixels within each roof polygon. I assume I could do this directly using cjio but it's definitely not my forte...maybe if I had help but yeah...with the double geometries, I'm trying to figure how to fix the error on QGIS to get more accurate results
from cityjson-qgis-plugin.
Thanks for clarifying.
I just downloaded the dataset and checked and couldn't find any duplicate geometries. Here are my steps:
- Import the dataset from the processing toolbox with the following parameters:
processing.run("cityjsonloader:loadcityjson", {'INPUT':'/Users/liberostelios/Downloads/3dbag_v210908_fd2cee53_3693.json','DIVIDE_BY_OBJECT_TYPE':False,'LOD_AS':2,'LOAD_SEMANTIC_SURFACES':True,'STYLE_BY_SEMANTIC_SURFACES':False,'SRID':QgsCoordinateReferenceSystem('EPSG:28992'),'BBOX':None,'OBJECT_TYPE':[]})
- Extract by attribute (only for the LoD2.2 layer):
processing.run("native:extractbyattribute", {'INPUT':'memory://MultiPolygon?crs=EPSG:28992&uid={299850c6-62b8-48ca-80ce-023336c01264}','FIELD':'surface.type','OPERATOR':0,'VALUE':'RoofSurface','OUTPUT':'TEMPORARY_OUTPUT'})
- Delete duplicate geometries:
processing.run("native:deleteduplicategeometries", {'INPUT':'memory://MultiPolygon?crs=EPSG:28992&field=uid:string(0,0)&field=type:string(0,0)&field=parents:string(1000,0)&field=children:string(1000,0)&field=attribute.dak_type:string(0,0)&field=attribute.data_area:string(0,0)&field=attribute.data_coverage:string(0,0)&field=attribute.documentnummer:string(0,0)&field=attribute.geconstateerd:string(0,0)&field=attribute.gid:string(0,0)&field=attribute.h_dak_50p:string(0,0)&field=attribute.h_dak_70p:string(0,0)&field=attribute.h_dak_max:string(0,0)&field=attribute.h_dak_min:string(0,0)&field=attribute.h_maaiveld:string(0,0)&field=attribute.identificatie:string(0,0)&field=attribute.kas_warenhuis:string(0,0)&field=attribute.lod11_replace:string(0,0)&field=attribute.ondergronds_type:string(0,0)&field=attribute.oorspronkelijkbouwjaar:string(0,0)&field=attribute.pw_actueel:string(0,0)&field=attribute.pw_bron:string(0,0)&field=attribute.reconstructie_methode:string(0,0)&field=attribute.reconstruction_skipped:string(0,0)&field=attribute.rmse_lod12:string(0,0)&field=attribute.rmse_lod13:string(0,0)&field=attribute.rmse_lod22:string(0,0)&field=attribute.rn:string(0,0)&field=attribute.status:string(0,0)&field=attribute.t_run:string(0,0)&field=attribute.val3dity_codes_lod12:string(0,0)&field=attribute.val3dity_codes_lod13:string(0,0)&field=attribute.val3dity_codes_lod22:string(0,0)&field=attribute.voorkomenidentificatie:string(0,0)&field=lod:string(0,0)&field=surface.type:string(0,0)&field=surface.on_footprint_edge:string(0,0)&uid={6510ee43-46fe-4a82-bf8e-4a5f01317a45}','OUTPUT':'TEMPORARY_OUTPUT'})
I got 3805 geometries for the whole tile after extracting only the roof surfaces and same number of features after I deleted the duplicates. Can you reproduce?
from cityjson-qgis-plugin.
Step 1: Uploading via processing toolbox
And then got a python error! already...damn. :(
So I reinstalled the plugin, but python error keeps occurring. This is only the case when I open it through the processing toolbox.
2022-06-15T10:57:27 WARNING Traceback (most recent call last):
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/AlgorithmDialog.py", line 273, in runAlgorithm
'parameters': self.algorithm().asMap(parameters, self.context)
Exception: unknown
from cityjson-qgis-plugin.
This is weird. Which QGIS version is this?
from cityjson-qgis-plugin.
QGIS Version 3.24.3-Tisler
from cityjson-qgis-plugin.
You are right, I just checked. There seems to be an issue with QGIS 3.24.3 on macOS. Not sure if this has something to do with the plugin or the specific release of QGIS. Thanks for figuring it out! 🙏
Regarding the original issue, though, I can reproduce the same results as I posted before even going through the old dialog import way, that I suppose you used before. This is what I get:
from cityjson-qgis-plugin.
Yes! I also get 3805 <3 Will try the operation once more to see the surface area, thanks Stelios! Not sure if it'll be the further operations that may create double geometries but I'll keep you updated if so
from cityjson-qgis-plugin.
Awesome! Glad that I was helpful. 🙏
Yes, please, if you can find out which part of your workflow created the duplicates I'd be interested to know.
Also, please be aware that you cannot trust QGIS's area
function as it only computes the 2D area of a geometry (i.e., the area of the projected polygon on the horizontal plane).
Here is the difference between a true 3D area calculation (on the left) and QGIS's original area calculation (on the right) for the specific 3D BAG tile:
If you want to know how I calculated the 3D area, I have this prototype plugin of 3D operations that I've built last summer which I can share with you. Please, feel free to contact me about this. If you have another way to compute the area in 3D, I'd be curious to know it.
from cityjson-qgis-plugin.
Related Issues (20)
- Semantic surfaces being dissolved
- Moving to PostGIS? HOT 1
- Multi LoD file adds empty attributes to all layers HOT 3
- Convert from CityGML bevor use HOT 1
- Write support for CityJSON datasets HOT 1
- Breaks on CityObject without geometry HOT 3
- Geometry-less city objects aren't loaded when choosing to load per LoD
- CityJSON v1.1 not supported HOT 1
- Add support for CityJSONFeature
- adding attributes per surface HOT 1
- Extracting only semantic roof surfaces for QGIS
- Import aglorithm is broken in 3.24.3 (macOS) HOT 1
- Qgis crashes HOT 3
- Change Altitude Clamping from Relative to Absolute HOT 2
- `referenceSystem` breaks if the url provided is an http
- `referenceSystem` breaks when it starts with `http://` instead of `https://`
- address information is not loaded HOT 1
- AttributeError: 'QgsPolygon3DSymbol' HOT 2
- Missing info
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cityjson-qgis-plugin.