analyticalgraphicsinc / czml-writer Goto Github PK
View Code? Open in Web Editor NEWA library for writing CZML content for use with Cesium.
License: Other
A library for writing CZML content for use with Cesium.
License: Other
Cesium added support for PolylineVolume a few months ago, in CesiumGS/cesium#8841, but it's not listed on the wiki. As far as I can tell, that's still the authoritative place to go for CZML syntax, right?
Added to entities, but apparently overlooked for CZML.
Currently, values specified via interval always implicitly include the start and stop times, and subsequent intervals always replace previous intervals.
That is, if you have value 1
from t1
to t2
, and value 2
from t2
to t3
, there is no way to indicate that the value at t2
should be 1
rather than 2
.
Cesium has isStartIncluded and isStopIncluded flags which already handle this on the client. Not sure what the syntax should be. Perhaps ISO interval syntax has a way to do this, though I doubt it.
We've gotten a few questions recently on the mailing list about what parts of KML we support. We should have a wiki page that details this. It will be a good resources for folks evaluating our support and could encourage some contributions.
@mrmattf are you up for this?
When i want to create a sensor, i need to set the orientation peoperty,and the result shuld be like that
"orientation":{ "interpolationAlgorithm":"LINEAR", "interpolationDegree":1, "epoch":"2012-03-14T16:00:00Z", "unitQuaternion":[ 0,0.5442469787907219,-0.3930414943582269,0.6791273595332279,0.29681583401707096, 60,0.5568574961878456,-0.3795119068692525,0.6694276502158563,0.31264526641282253, 120,0.5690856027377934,-0.3657216971011263,0.6592682247294563,0.32825999586928906, 180,0.5809229010307843,-0.3516803352070495,0.6486560598580954,0.3436492992805397, 240,0.5923612620368607,-0.33739746381396746,0.637598443295639,0.3588026083475122, 300,0.603392830688339,-0.3228828914006865,0.6261029686410711,0.3737095168355816, 360,0.614010031274122,-0.3081465855620958,0.6141775301837412,0.38835978772083696, 420,0.6242055726421669,-0.2931986661641189,0.6018303174821175,0.402743360220153, 480,0.633972453206541,-0.2780493983940966,0.5890698097397695,0.41685035670023496, 540,0.6433039657556208,-0.262709185711373,0.5759047699824437,0.4306710894608867, 600,0.6521937020581379,-0.24718856270292594,0.5623442390402289,0.4441960673878469 ] }
but when i use czml-writer to create the orientation property, there is no way to write the epoch
There is a LICENSE.md in the DotNet directory, but not in the others. We should add a root-level LICENSE.md, even if it just points to the file in the DotNet directory and says it doesn't cover the schema.
Include:
For related discussion, see https://groups.google.com/forum/#!topic/cesium-dev/TcaCJAbgsCE.
The following tests fail on my machine:
CesiumLanguageWriterTests.TestGregorianDate.TestToStringThreadFormatProvider:
Expected string length 24 but was 23. Strings differ at index 16.
Expected: "Monday, January 01, 2001"
But was: "Monday, January 1, 2001"
---------------------------^
CesiumLanguageWriterTests.TestGregorianDateFormatting.TestToString:
Expected string length 14 but was 13. Strings differ at index 8.
Expected: "February, 2002"
But was: "February 2002"
-------------------^
version
property on the document object.1.0 push
I test the sample.czml in the Cesium\Apps\SampleData,and i want to konw meaning of the number in the leadTime and trailTime.
I guess that "number":[0,3000.546684141998,3000.546684141998,0] is used to correct the orbit of the satelite after some time.but i am not sure,and i want to know the meaning of the 4 number and how to caculate them.
Thank you....
Hi All,
i want to change image which rotating in czml.html.
Also the name, and location
Hi,
I'm following the quickstart guide https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Quick-Start
trying to build the cezium language converter, using MonoDevelop under ubuntu 14.04.
The object CesiumLanguageConverter
does not appear in the list, and the directory
DotNet/CesiumLanguageConverter
does not seem to exist.
Added in CesiumGS/cesium/pull/3989
This has come up on the forum a bunch lately, I think it should be pretty simple but @shunter you would know better.
We should probably look into CesiumGS/cesium#5079 as well before doing this, because I believe that PR is what makes Components and Cesium line up (right now you need to negate Heading and pitch to match Components I think).
I would like to move my camera smoothly around my aircraft. With viewer.trackedEntity = airplane, I have tried including multiple camera positions in czml:
"viewFrom" : {
"epoch" : "2012-08-04T16:00:00Z",
"cartesian" : [
0, 100.0, 100.0, 100.0,
100, 200.0, 200.0, 200.0
]
}
But the camera stays locked in one position. Shouldn't this work? (https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/ViewFrom says "Interpolatable: yes")
Or is there a way to animate viewer.camera.position dynamically?
For both leadTime
and trailTime
it says
By default, the value is unlimited, which effectively results in drawing the entire available path of the object.
https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Path
However, if a value is not set it doesn't appear to display either the trail or the lead at all.
Based on the documentation, I would expect to display the complete trail or lead for the path if they're not set.
According to the docs the default value is undefined
which seems to be what is actually happening.
https://cesium.com/docs/cesiumjs-ref-doc/PathGraphics.html
It would be nice for the document
object, which contains the version number, to also explicitly mention Cesium
or Cesium Language
or CZML
so that any human inspecting such a stream can easily distinguish it from other types of JSON.
When we write samples, we use the first sample time as the epoch time, and blindly use epoch seconds for all remaining samples. When the duration since the epoch increases past some maximum allowed duration (user configurable), we should either fall back to ISO strings for sample times, or close the packet and reopen a new packet with a new epoch time.
If trying to create CZML from behind HTTP Proxy with network resource then CesiumStreamWriter fails.
Example:
BillboardCesiumWriter billboard = packet.openBillboardProperty();
billboard.writeColorProperty(123, 67, 0, 255);
billboard.writeImageProperty(URI.create("http://cesiumjs.org/images/CesiumHeaderLogo.png"), CesiumResourceBehavior.EMBED);
billboard.close();
One simple fix is adding check if http.proxy of https.proxy system property are set in System.property
then define in proxy before creating HttpWebRequest in CesiumFormattingHelper.
a/Java/CesiumLanguageWriter/translatedSrc/cesiumlanguagewriter/advanced/CesiumFormattingHelper.java
+++ b/Java/CesiumLanguageWriter/translatedSrc/cesiumlanguagewriter/advanced/CesiumFormattingHelper.java
@@ -16,6 +16,7 @@ import agi.foundation.compatibility.WebResponse;
import cesiumlanguagewriter.*;
import java.awt.image.RenderedImage;
import java.io.InputStream;
+import java.net.Proxy;
/**
*
@@ -105,6 +106,21 @@ public final class CesiumFormattingHelper {
return uri;
}
WebRequest request = WebRequest.create(uri);
+
+ // patch starts here
+ final boolean isHttps = uri.startsWith("https");
+ String proxyHost = System.getProperty(isHttps ? "https.proxyHost" : "http.proxyHost", "");
+ if (!proxyHost.isEmpty()) {
+ String proxyPort = System.getProperty(isHttps ? "https.proxyPort" : "http.proxyPort", "");
+ if (!proxyPort.isEmpty()) {
+ int port = Integer.parseInt(proxyPort);
+ Proxy proxy = new Proxy(Proxy.Type.HTTP, new java.net.InetSocketAddress(proxyHost, port));
+ request.setProxy(proxy);
+ }
+ }
+ // patch ends here
+
HttpWebRequest httpWebRequest = (request instanceof HttpWebRequest) ? (HttpWebRequest) request : null;
if (httpWebRequest != null) {
httpWebRequest.setUserAgent("CesiumWriter");
I exported a kml track from Google My Tracks. When I ran it through the converter I got the 2 end points but no track data.
This was added in Cesium 1.23.
The valid values are
https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Cylinder
It ssems like the position argument is missing on the cylinder?
this method sometimes renders the decimal in local notation, which breaks JSON.
Line 65 was replaced, which fixes the problem
writer.Write(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:R}", value));
//writer.Write("{0:R}", value);
Maybe there are other occurances which exhibit similar problems.
Quick start has a small typo so that it reads ##Java.
Error: Server responded to https://api.github.com/repositories/3606738/releases/latest with status code 403:
Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required). Check https://developer.github.com for other possible causes.
var res = request('GET', 'https://api.github.com/repos/AnalyticalGraphicsInc/cesium/releases/latest', { headers: { 'User-Agent': "my git account" }, });
Maven repositories are extremely important to Java developers. As a Java developer I would like to be able to access the required czml-writer artifacts from Maven Central. You support nuget for .NET, why not support Maven for Java?
in the samples the color for a path is a property right below it
"path":{
"color":[
{
"rgba":[
255,255,0,255
]
}
],
...
},
but in Code I find no representation for this. I tried the following, which renders complex JSON, but will not format the path accordingly
//doesn't work (no error, but visual no effect):
var path = packet.OpenPathProperty();
{
var w = path.OpenMaterialProperty();
{
var c = w.OpenSolidColorProperty();
c.WriteColorProperty(System.Drawing.Color.Yellow);
c.Close();
}
w.Close();
}
Instead I had to manually render it (which works, but is bloated code):
path.Output.WritePropertyName("color");
path.Output.WriteStartSequence();
path.Output.WriteStartObject();
path.Output.WritePropertyName("rgba");
path.Output.WriteStartSequence();
path.Output.WriteValue(255);
path.Output.WriteValue(255);
path.Output.WriteValue(0);
path.Output.WriteValue(128);
path.Output.WriteEndSequence();
path.Output.WriteEndObject();
path.Output.WriteEndSequence();
path.Output.WriteLineBreak();
is this a missing feature or did I miss something?
regards, Tilli
Cesium master
now has polylines on terrain, what should change in this repo?
See CesiumGS/cesium#6706.
Hi,
Is there any way to add multi polygon or PolygonCollection in the same packet?
Do I have to create a new packet for each new polygon?
I need something like that.
[
{
"id": "document",
"version": "1.0",
"name": "Cities"
},
{
"id": "34",
"name": "Istanbul",
"polylineCollection": [
{
"positions": "x position",
"followSurface": true,
"clampToGround": true,
"width": 5,
"material": "black outline color"
},
{
"positions": "y position",
"followSurface": true,
"clampToGround": true,
"width": 5,
"material": "black outline color"
}
],
"polygonCollection": [
{
"positions": "somewhere inside x position polyline",
"material": "red"
},
{
"positions": "somewhere inside x position polyline",
"material": "yellow"
},
{
"positions": "somewhere inside y position polyline",
"material": "blue"
}
],
"position": []
}
]
When I select root directory \czml-writer\Java
, I can't click "finish" button. And eclipse remind me "no projects are found to import".
Then I add .classpath
and .project
file to \czml-writer\Java
. It works, I can click "finish" button now. But I can't click "Build All" button. I have no idea with this problem. Hope someone can help me. Thanks!
The content in .classpath
and .project
is listed below:
.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-13">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
.project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Java</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Let's write a concise bird's eye architecture guide for the czml-writer library, similar to the guide for Cesium, to help developers write converters.
Focus on how to use czml-writer, but also briefly describe how the code for the library is generated from the schema.
This guide is strategically important because we want wide-spread adoption of CZML, which requires external contributions of converters. This guide will make the barrier to entry for writing a converter very low.
I recommend Inkscape for creating diagrams.
My team here at JHU-APL found a bug in the czml-writer, specifically the CachingCesiumUrlResolver.java file throws a null pointer exception. It seems to happen when our application writes out the same icon many times. I'm attaching my fix, perhaps it can be considered for submission.
-Jon Carmack
in CachingCesiumUrlResolver.java:
public final String resolveUrl(String url) {
LinkedListNode<cesiumlanguagewriter.advanced.CachingCesiumUrlResolver.CacheItem> node = null;
LinkedListNode<cesiumlanguagewriter.advanced.CachingCesiumUrlResolver.CacheItem>[] out$node_1 = new LinkedListNode[] {
null
};
boolean temp_0 = MapHelper.tryGetValue(m_dictionary, url, out$node_1);
node = out$node_1[0];
if (temp_0) {
//if node is head, just read head
if(m_lruList.getFirst() == node){
return node.getValue().ResolvedUrl;
}
//move to front
else{
m_lruList.remove(node);
m_lruList.addFirst(node);
return node.getValue().ResolvedUrl;
}
}
//load image into data URI
String resolvedUrl = CesiumFormattingHelper.downloadUrlIntoDataUri(url);
addUrl(url, resolvedUrl);
return resolvedUrl;
}
The CZML property for ImageMaterial.alpha now maps to a property that was deprecated in CesiumGS/cesium#3766
the property name should be polylineArrow rather than arrow
the property type is a SolidColorMaterial, not a color
btw: how do I edit the wiki to file a PR?
Hello,
is there any free converter from czml to kml or shp ?
Here is my problem,
I am using Java to take a message passed in from a server and use that to write changes to CZML. we have our orientation property working fine, but we are using colors to determine a models temperature.
The czml writer will write the color property with and epoch and dates following, but the colors are interpolated and we need them to be changed immediately (time is of the essence, and colors are blue and red no aqua).
I have noticed there is no time interval with say color properties. I need to be able to write:
"color": [
{
"interval" : "2012-08-04T16:00:00Z/2012-08-04T16:05:00Z",
"rgbaf" : [1, 0, 0, 1]
}, {
"interval" : "2012-08-04T16:01:00Z/2012-08-04T16:05:00Z",
"rgbaf" : [0, 1, 0, 1]
}, {
"interval" : "2012-08-04T16:02:00Z/2012-08-04T16:05:00Z",
"rgbaf" : [0, 0, 1, 1]
},
],
could this be done given a list of intervals and a list of colors?? i.e
IntervalWithProperty(List dates, List);
OR
IntervalWithProperty(List dates, PropertyType type, List value);
Or is there a workaround that I can do to make this work?
The quaternion order calls from W,X,Y,Z but according to my CZML testing the order is X,Y,Z,W
https://github.com/AnalyticalGraphicsInc/czml-writer/blob/master/DotNet/CesiumLanguageWriter/UnitQuaternion.cs
Hi,
We are building a proof of concept using Cesium and using the czml-writer. The latest version (master download (zip)), does not have the Polygon algorithms included and also the Shapefile projects have been removed from the project. Is the functionality like "eliminateHoles" to serialize data into a polygon with holes moved or how is this supported going forward with the project?
I have read previous forum posts that this is supported, can you please give me direction regarding this.
Thanks
Jannie
.net framework is dying, January 10, 2023
https://stackoverflow.com/questions/58732338/when-is-end-of-life-for-dotnet-framework-4-5-2
Please update to the latest .net standard and .net Core library.
When I converted a kml track file (generated via Google My Tracks) the altitude values in the resulting .czml file were all 0 (zero). Quick debug session showed that the individual tracks were treated as clampToGround
even though they contained absolute
altitude values. It looks like the MultiTrack specified the altitude but the setting is never passed into the individual tracks.
<gx:MultiTrack> <altitudeMode>absolute</altitudeMode> <gx:interpolate>1</gx:interpolate> <gx:Track> <when>2013-02-02T16:39:29.131Z</when> <gx:coord>-111.628725 40.567083 3222.300048828125</gx:coord> <when>2013-02-02T16:39:59.466Z</when>
...
I use the. Net version of czml-writer.
I can run this, but I don’t know how to create a simple satellite trajectory.
Can we get its trajectory by some formula instead of listing it?
In order to properly render CZML on the client, we need some form of Z-ordering in the specification itself. I believe this can easily be accomplished by giving each graphical type (Billboard/Point/Polyline/etc..) a constant value zOrder property. zOrder would start at 0 (bottom of the stack) and go up from there. Higher numbers are drawn on top of lower numbers. If no zOrder property is specified, it is assumed to be 0.
Cesium doesn't actually have support for z-ordering yet, but adding it to the spec now is easy enough and will help other clients who wish to use CZML.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.