Open ChrisBarker-NOAA opened 9 years ago
Perhaps a more flexible numpy dtype system would help here. :stuck_out_tongue_winking_eye:
how so? an easier/more robust way to subclass ndarray would help, though ti seems it's been decided that that's pretty much impossible, and delegation is the way to go...
though my bounding box class is, in fact, a subclass of ndarray -- and it seems to work so far...
how so?
Hopefully it's obvious I wasn't being completely serious, but with all the recent fuss about dtypes it seemed like an interesting case where an "array of polygons" might be nicer to work with than an Nx2 array of numbers.
yes it was obvious ;-)
-- but you're right, not totally off the map.
In fact, I do have what I call a polygon set, which is, kind of, an array of polygons. It needs some work to make it more powerful and flexible, but I'm not at all sure that making a polygon dtype would be the way to do that -- even with the up and coming all-powerful-and-flexible-dtype-system :-)
In writing even the very start of an API, I"ve found that I need to specify things like bounding rectangles, polygons, etc....
Perhaps we need to specify some of the low-level API conventions, for instance:
We may also want some higher-level objects to represent some of these concepts -- for instance, I have a Bounding Box class that is a numpy array as above, but also has a bunch of handy functionality built in.
Also a PolygonSet object...