Пример #1
0
 def __init__(self, polys=None, points=None, crs=None, **params):
     super(GeoAnnotator, self).__init__(**params)
     plot_opts = dict(height=self.height, width=self.width)
     self.tiles = WMTS(self.tile_url,
                       extents=self.extent,
                       crs=ccrs.PlateCarree()).opts(plot=plot_opts)
     polys = [] if polys is None else polys
     points = [] if points is None else points
     crs = ccrs.GOOGLE_MERCATOR if crs is None else crs
     tools = [CheckpointTool(), RestoreTool(), ClearTool()]
     opts = dict(tools=tools,
                 finalize_hooks=[initialize_tools],
                 color_index=None)
     if not isinstance(polys, Path):
         polys = self.path_type(polys, crs=crs).options(**opts)
     self.polys = polys.options(**opts)
     self.poly_stream = PolyDraw(source=self.polys,
                                 data={},
                                 show_vertices=True)
     self.vertex_stream = PolyEdit(source=self.polys)
     if isinstance(points, Points):
         self.points = points
     else:
         self.points = Points(points, self.polys.kdims,
                              crs=crs).options(**opts)
     self.point_stream = PointDraw(source=self.points, data={})
Пример #2
0
 def __init__(self, obj, paths=None, **params):
     super(LineCrossSection, self).__init__(**params)
     self.obj = obj
     paths = [] if paths is None else paths
     self.path = Path(paths, crs=ccrs.GOOGLE_MERCATOR)
     self.path_stream = PolyDraw(source=self.path)
     PolyEdit(source=self.path)
     self.sections = Dynamic(self.obj,
                             operation=self._sample,
                             streams=[self.path_stream])
     self.tiles = WMTS(self.tile_url)
Пример #3
0
 def __init__(self, polys=None, points=None, crs=None, **params):
     super(GeoAnnotator, self).__init__(**params)
     plot_opts = dict(height=self.height, width=self.width)
     self.tiles = WMTS(self.tile_url,
                       extents=self.extent,
                       crs=ccrs.PlateCarree()).opts(plot=plot_opts)
     polys = [] if polys is None else polys
     points = [] if points is None else points
     crs = ccrs.GOOGLE_MERCATOR if crs is None else crs
     self.polys = self.path_type(polys, crs=crs)
     self.poly_stream = PolyDraw(source=self.polys, data={})
     self.vertex_stream = PolyEdit(source=self.polys)
     self.points = Points(points, self.polys.kdims, crs=crs)
     self.point_stream = PointDraw(source=self.points, data={})
Пример #4
0
 def __init__(self, polys=None, points=None, crs=None, **params):
     super(GeoAnnotator, self).__init__(**params)
     plot_opts = dict(height=self.height, width=self.width)
     self.tiles = WMTS(self.tile_url,
                       extents=self.extent,
                       crs=ccrs.PlateCarree()).opts(plot=plot_opts)
     polys = [] if polys is None else polys
     points = [] if points is None else points
     crs = ccrs.GOOGLE_MERCATOR if crs is None else crs
     self._tools = [CheckpointTool(), RestoreTool(), ClearTool()]
     if not isinstance(polys, Path):
         polys = self.path_type(polys, crs=crs)
     self._init_polys(polys)
     if not isinstance(points, Points):
         points = Points(points, self.polys.kdims, crs=crs)
     self._init_points(points)