@@ -124,43 +124,19 @@ class CloudJS{
124124 Value version (this ->version .c_str (), (rapidjson::SizeType)this ->version .size ());
125125 Value octreeDir (" data" );
126126 Value projection (this ->projection .c_str (), (rapidjson::SizeType)this ->projection .size ());
127+
127128 Value boundingBox (rapidjson::kObjectType );
128129 {
129- // Value min(rapidjson::kArrayType);
130- // min.PushBack(this->boundingBox.min.x, d.GetAllocator());
131- // min.PushBack(this->boundingBox.min.y, d.GetAllocator());
132- // min.PushBack(this->boundingBox.min.z, d.GetAllocator());
133- //
134- // Value max(rapidjson::kArrayType);
135- // max.PushBack(this->boundingBox.max.x, d.GetAllocator());
136- // max.PushBack(this->boundingBox.max.y, d.GetAllocator());
137- // max.PushBack(this->boundingBox.max.z, d.GetAllocator());
138- //
139- // boundingBox.AddMember("min", min, d.GetAllocator());
140- // boundingBox.AddMember("max", max, d.GetAllocator());
141-
142130 boundingBox.AddMember (" lx" , this ->boundingBox .min .x , d.GetAllocator ());
143131 boundingBox.AddMember (" ly" , this ->boundingBox .min .y , d.GetAllocator ());
144132 boundingBox.AddMember (" lz" , this ->boundingBox .min .z , d.GetAllocator ());
145133 boundingBox.AddMember (" ux" , this ->boundingBox .max .x , d.GetAllocator ());
146134 boundingBox.AddMember (" uy" , this ->boundingBox .max .y , d.GetAllocator ());
147135 boundingBox.AddMember (" uz" , this ->boundingBox .max .z , d.GetAllocator ());
148136 }
137+
149138 Value tightBoundingBox (rapidjson::kObjectType );
150139 {
151- // Value min(rapidjson::kArrayType);
152- // min.PushBack(this->tightBoundingBox.min.x, d.GetAllocator());
153- // min.PushBack(this->tightBoundingBox.min.y, d.GetAllocator());
154- // min.PushBack(this->tightBoundingBox.min.z, d.GetAllocator());
155- //
156- // Value max(rapidjson::kArrayType);
157- // max.PushBack(this->tightBoundingBox.max.x, d.GetAllocator());
158- // max.PushBack(this->tightBoundingBox.max.y, d.GetAllocator());
159- // max.PushBack(this->tightBoundingBox.max.z, d.GetAllocator());
160- //
161- // tightBoundingBox.AddMember("min", min, d.GetAllocator());
162- // tightBoundingBox.AddMember("max", max, d.GetAllocator());
163-
164140 tightBoundingBox.AddMember (" lx" , this ->tightBoundingBox .min .x , d.GetAllocator ());
165141 tightBoundingBox.AddMember (" ly" , this ->tightBoundingBox .min .y , d.GetAllocator ());
166142 tightBoundingBox.AddMember (" lz" , this ->tightBoundingBox .min .z , d.GetAllocator ());
@@ -174,8 +150,17 @@ class CloudJS{
174150 pointAttributes.SetArray ();
175151 for (int i = 0 ; i < this ->pointAttributes .size (); i++){
176152 PointAttribute attribute = this ->pointAttributes [i];
177- Value str (attribute.name .c_str (), d.GetAllocator ());
178- pointAttributes.PushBack (str, d.GetAllocator ());
153+
154+
155+ Value vAttribute (rapidjson::kObjectType );
156+ vAttribute.AddMember (" name" , Value (attribute.name .c_str (), d.GetAllocator ()), d.GetAllocator ());
157+ vAttribute.AddMember (" size" , attribute.byteSize , d.GetAllocator ());
158+ vAttribute.AddMember (" elements" , attribute.numElements , d.GetAllocator ());
159+ vAttribute.AddMember (" elementSize" , attribute.byteSize / attribute.numElements , d.GetAllocator ());
160+ vAttribute.AddMember (" type" , Value (attribute.type .c_str (), d.GetAllocator ()), d.GetAllocator ());
161+ vAttribute.AddMember (" description" , Value (attribute.description .c_str (), d.GetAllocator ()), d.GetAllocator ());
162+
163+ pointAttributes.PushBack (vAttribute, d.GetAllocator ());
179164 }
180165 }else if (outputFormat == OutputFormat::LAS){
181166 pointAttributes = " LAS" ;
0 commit comments