holoviz-topics / EarthSim

Tools for working with and visualizing environmental simulations.
https://earthsim.holoviz.org
BSD 3-Clause "New" or "Revised" License
65 stars 21 forks source link

PolyAndPointAnnotator not populating poly_stream correctly #225

Closed kcpevey closed 5 years ago

kcpevey commented 5 years ago

Given this:

coord_system = ccrs.UTM(17)
display_extent = (-95, 25, -55, 50)
annot = PolyAndPointAnnotator(polys=[], path_type=gv.Path, crs=coord_system, extent=display_extent)
(annot.tiles * annot.polys * annot.points + annot.point_table + annot.vertex_table).cols(1)

When I draw paths, they don't appear in the point_table.

The same thing happens with

annot = PolyAndPointAnnotator(
    path_type=gv.Path, polys=[])
(annot.tiles * annot.polys * annot.points + annot.point_table + annot.vertex_table).cols(1)

but using annot.view() works correctly.

kcpevey commented 5 years ago

When I draw paths, they don't appear in the point_table.

Not entirely sure where my head was at when I wrote that. There doesn't appear to be an issue when I use annot.poly_table to visualize the polys table.

At any rate, I still have an issue. Which is to say that if I draw a path on this drawing:

coord_system = ccrs.UTM(17)
display_extent = (-95, 25, -55, 50)
annot = PolyAndPointAnnotator(polys=[], path_type=gv.Path, crs=coord_system, extent=display_extent)
(annot.tiles * annot.polys * annot.points + annot.poly_table + annot.vertex_table).cols(1)

the annot.poly_stream remains empty.

annot.poly_stream  
PolyDraw(data={'Group': [], 'xs': [], 'ys': []})  

However, the annot.poly_stream populates correctly with this:

annot = PolyAndPointAnnotator(
    path_type=gv.Path, polys=[])
(annot.tiles * annot.polys * annot.points + annot.point_table + annot.vertex_table).cols(1)
kcpevey commented 5 years ago

@philippjfr Can you weigh in on this?

philippjfr commented 5 years ago

I can't reproduce any issues with the example unfortunately.

philippjfr commented 5 years ago

Again my versions are:

GeoViews: '1.5.4a8.post2+g400b850' HoloViews: ''1.11.0a5.post12'

kcpevey commented 5 years ago

My hv was the same as yours, but my gv was slightly behind. Updated and now everything works like it should!