Giter Site home page Giter Site logo

Annotating gv.Path about earthsim HOT 4 CLOSED

kcpevey avatar kcpevey commented on June 3, 2024
Annotating gv.Path

from earthsim.

Comments (4)

philippjfr avatar philippjfr commented on June 3, 2024

The GeoAnnotator classes were really meant as templates, which should be modified and/or expanded depending on a users needs. It should be very straightforward to add a parameter to the GeoAnnotator to switch between gv.Polygons and gv.Path.

from earthsim.

kcpevey avatar kcpevey commented on June 3, 2024

That seems easier said than done, as least for me, but I'm making an attempt.

Do you mention switching between gv.Polygons and gv.Path because BOTH cannot be drawn at the same time (i.e. you can't have two PolyDraw objects on one drawing)?

from earthsim.

philippjfr avatar philippjfr commented on June 3, 2024

In the simple case you could just let a user switch between them by making the following changes/additions to GeoAnnotator:

geometry_type = param.ClassSelector(default=gv.Polygons, class_=gv.Path)

def __init__(self, polys=None, points=None, **params):
    ...
    self.polys = self.geometry_type(polys, crs=ccrs.GOOGLE_MERCATOR)
    ...

If you want to draw and annotate both polygons and paths a slightly more complex implementation would be needed.

from earthsim.

philippjfr avatar philippjfr commented on June 3, 2024

Closed via #46

from earthsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.