Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

problem making a roper CZML polyline #16

Open
epifanio opened this issue Aug 2, 2015 · 3 comments
Open

problem making a roper CZML polyline #16

epifanio opened this issue Aug 2, 2015 · 3 comments

Comments

@epifanio
Copy link

epifanio commented Aug 2, 2015

I’m trying to visualize a polyline in cesium via czml.
The czml I’m trying to load is available at:

https://gist.github.com/ae4c6bf491949e711ab7

unfortunately, I'm not able to visualize it in cesium.

Is there any way to validate it ?
below an attempt to generate a czml Polyline

http://nbviewer.ipython.org/gist/epifanio/232f1f7ae3212ca68353/cesium-czml-test.ipynb

@epifanio
Copy link
Author

epifanio commented Aug 4, 2015

I manually created a polyline using a simple template:

http://nbviewer.ipython.org/gist/epifanio/c45fa0c6a6cbc98484ea

do you know of any example online on making simple features (point, line, polygons) with python CZML?

@cleder
Copy link
Owner

cleder commented Aug 11, 2015

@epifanio
Copy link
Author

I tried the test code, but i'm not able to generate a proper czml from it.

I tried the following :

from czml import utils
from czml import czml
from pygeoif import geometry

sc = czml.SolidColor(color={'rgba': [0, 255, 127, 55]})
m1 = czml.Material(solidColor=sc)
c1 = geometry.LineString([(0, 0, 0), (10, 0, 0), (70, 0, 0)])
v1 = czml.Positions(cartographicDegrees=c1)
p1 = czml.Polyline(show=True, width=5, followSurface=False, material=m1, positions=v1)
packet = czml.CZMLPacket(id='abc')
packet.polyline = p1

I tried to load : packet.dumps() into the cesium wdget with: cesiumExample = CesiumWidget(width="100%", czml=packet.dumps())

but doesn't load.

Then I tried to make a czml by hand (same data) :

pl = """[
    {
    "version": "1.0",
    "id": "document"
    },
    {
    "polyline": {
        "width":1,
        "material":{
            "solidColor":{
                "color":{
                    "rgba":[0,255,255,255]
                  }
            }
          },
        "positions": {
            "cartographicDegrees": [0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 70.0, 0.0, 0.0]
            }
        }, 
        "id": "test_0", "description":"{'LENGTH': 11200.273438, 'FNODE_': 1}"
        }
 ]
"""

and it works fine.

I'm missing basic steps to use the python interface to czml to generate a complete CZML-string-object wfich can then be loaded using the : cesiumExample = CesiumWidget(width="100%", czml=CZML-string-object

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

No branches or pull requests

2 participants