Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONTENT_VALIDATION_ERROR #27

Open
Ananthu-Prakash opened this issue Sep 5, 2024 · 9 comments
Open

CONTENT_VALIDATION_ERROR #27

Ananthu-Prakash opened this issue Sep 5, 2024 · 9 comments

Comments

@Ananthu-Prakash
Copy link

Hello,
I have successfully generated 3d tiles using following command
java -jar /home/akshay/Desktop/mago_1.8/mago-3d-tiler-1.8.1-natives-linux.jar --input "/home/akshay/Desktop/mago_1.8/bhavnagar/water_line_z/bhavnagr_water_z.shp" --inputType shp -c 32643 -hc pipe_depth -dc pipe_dia_i --output "/home/akshay/Desktop/mago_1.8/bhavnagar/water_3d/"

I am trying to visualise it using cesium, there it is giving me this error
A 3D tile failed to load: http://192.168.20.66:5501/PCMC/data/pcmc_water/data/R00C31.b3dm

so I tried to use this command to check if tiles are in proper format
npx 3d-tiles-validator --tilesetFile data/pcmc_water/tileset.json

there i get this in response which states 'The feature table binary must be aligned to 8 bytes'

this is the response for single tile for showing purpose, similar responses can also be seen for other tiles
{
"type": "CONTENT_VALIDATION_ERROR",
"path": "data/R00C20.b3dm",
"message": "data/R00C20.b3dm caused validation errors",
"severity": "ERROR",
"causes": [
{
"type": "BINARY_INVALID_ALIGNMENT",
"path": "data/R00C20.b3dm",
"message": "The feature table binary must be aligned to 8 bytes",
"severity": "ERROR"
}
]
}

How can it be corrected, this is the sample shapefile data that I am using to generate 3d tiles
selected_water_line.zip

@sdson
Copy link
Contributor

sdson commented Sep 5, 2024

Hi @Ananthu-Prakash !

The error produced in the b3dm conversion of "selected_water_line" is an error of the Mago3DTiler.
This is error is produced when the input data has less than 100 water-pipe-lines.
This error is produced by the progress-bar made by us.

Probably the b3dm you made has no geometry data.
if your "selected_water_lines" file has more than 100 water-pipe-lines, there are no error.

You must convert the water-pipes-lines as always.

Wait few days to correct this error in the release version.

@Ananthu-Prakash
Copy link
Author

Hello,
Thanks for the response.
Actually no. of pipelines that I am converting is more than 100, but for only showing purpose I shared limited data.
I am trying to avail the selective visibility of 3d pipelines, based on certain criteria entered by the user for that in cesium, I am using following code

tileset.tileLoad.addEventListener(function (tile) {
const content = tile.content;

for (let i = 0; i < content.innerContents.length; i++) {
const innerContent = content.innerContents[i];
const groupMetadata = innerContent.group?.metadata;
if (Cesium.defined(groupMetadata)) {
const diameter = groupMetadata.getProperty("pipe_depth");
if (Cesium.defined(diameter)) {
console.log('diameter do exists')
}
}

when i try to run this code, it is giving me error
A 3D tile failed to load: http://192.168.20.66:5501/PCMC/data/pcmc_water/data/R00C31.b3dm

even though I can see the 3d tiles on the screen, this might be probably because innerContents inside content is coming undefined when i try to see content by console logging it.

I want to know like is it really a possibility or is there any other thing that I can try.

Thank you.

@sdson
Copy link
Contributor

sdson commented Sep 6, 2024

Hi @Ananthu-Prakash !

Ok. We reproduced the same error.

"A 3D tile failed to load: http://localhost/f4d/3dtiles/selected_water_line.shp/data/RC0.b3dm
Cesium3DTileset.js:2648 Error: Cannot read properties of undefined (reading 'length')"

wait a little please

@Ananthu-Prakash
Copy link
Author

Thank you sir. Please let me know when it is done.

@sdson
Copy link
Contributor

sdson commented Sep 6, 2024

Using this script :

tileset.tileLoad.addEventListener(function (tile) {  
const content = tile.content;

let featuresLength = content.featuresLength;
for(let j=0; j<featuresLength; j++){
	let feature = content.getFeature(j);
	if(feature instanceof Cesium.Cesium3DTileFeature){
		let propertyNames = feature.getPropertyIds();
		for(let i=0; i<propertyNames.length; i++){
			let propertyName = propertyNames[i];
			let propertyValue = feature.getProperty(propertyName);
			console.log(propertyName + " : " + propertyValue);
		}
	}
}
});

you can obtain all propertieNames & propertiesValues.

The output in the console :
image

this is useful?

@Ananthu-Prakash
Copy link
Author

Hello sir,
Thanks for the response.
Yesterday I tried with the above code and it was giving me tile-wise attribute info also, but actually I do not know as to how can I lead this to visualising only that portion of the pipeline that satisfies criteria given by user based on this attribute info. So that's why I consider earlier approach, but I am also fine with this one.

It will be really helpful if you could guide me as to how can I lead this info to selective visualisation.

updateModelRotation(finalLongitude, finalLatitude,
278.53668, 0, 0)

currently I am using above cesium function through which I am able to zoom to pipe location that is satisfying given criteria, but now I want only that particular pipe visble, but currently all pipes are visible and it is only zooming to pipe satisfying the criteria.
Thank you.

@sdson
Copy link
Contributor

sdson commented Sep 6, 2024

I really no expert in cesium, but you can go to webpage "https://cesium.com/learn/cesiumjs-learn/cesiumjs-3d-tiles-styling/" and there are ways to filter objects by the propertiy.

in the webpage there are a sandcastle example and you can see the code. There are a script to filter objects by property.

In the example code, filters objects and shows only objects that are "residential" or "apartments" :

// Show features based on property
function showFeaturesWithProperty() {
  osmBuildingsTileset.style = new Cesium.Cesium3DTileStyle({
    show: "${feature['building']} === 'residential' || ${feature['building']} === 'apartments'",
  });
}

@Ananthu-Prakash
Copy link
Author

ok sir, I will try this.

@sdson
Copy link
Contributor

sdson commented Sep 6, 2024

ok. The web page :
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants