rectangle through CZML

Hello Mathew/Patrick,

what is the equivalent of the below code in CZML

var greenRectangle = viewer.entities.add({

name : ‘Green translucent, rotated, and extruded rectangle at height with outline’,

rectangle : {

coordinates : Cesium.Rectangle.fromDegrees(-100.0, 30.0, -90.0, 40.0),

material : Cesium.Color.GREEN.withAlpha(0.5),

rotation : Cesium.Math.toRadians(45),

extrudedHeight : 300000.0,

height : 100000.0,

outline : true,

outlineColor : Cesium.Color.GREEN

}

});

i have seen agi_rectangularSensor in the CZML CONTENT given , but i think it is not the one . could u please guide me the equivalent one for rectangle in CZML.

thanks and regards

chandrika

I found some good discussions on creating rectangles via CZML and the Entity API in this thread.

Below is a complete example of a rectangle in CZML. All parameters are optional, except for coordinates, which are provided in west-south-east-north degrees. Alternatively you can provide them in radians by using ‘wsen’ instead of ‘wsenDegrees’. My recommendation is to not specify a parameter unless you know you need it, I included them all for clarity and completeness.

[{
“id” : “document”,
“version” : “1.0”
}, {

“rectangle” : {
“coordinates” : {
“wsenDegrees” : [0, 1, 2, 3]
},

   "material" : {
       "solidColor" : {
           "color" : {
               "rgbaf" : [1.0, 1.0, 1.0, 1.0]
           }
       }
   },
   "height" : 0,
   "extrudedHeight" : 1000,
   "granularity" : 0.1,
   "rotation" : 0.4,
   "stRotation" : 0.4,
   "closeBottom" : true,
   "closeTop" : true,
   "show" : true,
   "outline" : true,
   "outlineColor" : {
       "rgbaf" : [0, 0, 0, 1.0]
   },
   "outlineWidth" : 2

}
}]

``

Hello Mike,

thank u so much , that was very informative indeed.

But in CZMLWriter provided there is no Rectangle entity, so we are thinking of adding to czmlWriter the Rectangle. please let me know whether i am going in the right track .

Or is there any upgraded version of CZML writer other than the one which is provided in this link below:

https://github.com/AnalyticalGraphicsInc/czml-writer

if so please let us know the upgraded version of CZMLwriter.thank u so much.

thanks and regards

chandrika

czml-writer needs some much needed attention but with everything else going on we haven’t had a chance to keep it as up to take with Cesium as we would like. I do plan on makin surre it has parity with Cesium again before the end of the year, but I don’t have an exact time frame.

Just discovered this issue in czml-writer.

My use-case is illustrated like so:

{
“id” : “XHAG - Catch”,
“name” : “XHAG Catch Details”,
“description” : “This is the html description of the catch @ XHAG”,
“rectangle” : {
“availability”:“2007-07-14T00:00:00Z/2007-07-31T23:59:59Z”,
“show” : true,
“coordinates” : {“wsenDegrees” : [-61,-50,-60.5,-49.75]},
“height” : {
“interpolationAlgorithm”:“LAGRANGE”,
“interpolationDegree”:1,
“epoch”:“2007-07-14T00:00:00Z”,
“number”:[
0,0,
86400,5000,
172800,10000,
259200,21060,
345600,31060,
432000,51060,
1339140,84060
]
},
“extrudedHeight” : 0,
“fill” : true,
“material” : {“solidColor” : {“color”: {“rgba” : [0, 255, 255, 25]}}
},
“outline” : true,
“outlineColor” : {“rgba” : [127, 127, 127, 50]}
}
}

In other words, the height of the rectangle varies with time… This POC works beautifully - but writer does not support it.
It would be awesome if you could also do something like this:

86400,+5000, so that the value is added to the existing value - don’t know how realistic that is though.

cheers,

Brian