-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completely rewrote geometry handling #244
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, though my eyes glaze over for code like that...
@@ -65,6 +81,34 @@ def project_extents(extents, src_proj, dest_proj, tol=1e-6): | |||
return geom_in_crs.bounds | |||
|
|||
|
|||
def geom_dict_to_array_dict(geom_dict, coord_names=['Longitude', 'Latitude']): | |||
""" | |||
Converts a dictionary containing an geometry key to a dictionary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a geometry
|
||
For array conversion the following conventions are applied: | ||
|
||
* Any nan separated array are converted into a MultiPolygon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arrays
979e96c
to
0f87755
Compare
This PR completely overhauls handling of paths, polygons and geometries in GeoViews. First of all it introduces a
GeomDictionaryInterface
which can process shapely geometries in the form:This means that the
MultiInterface
interface can process lists of these objects, providing a native representation of geometries and value dimensions without relying on geopandas. Conversion from geopandas to this new format is as simple as:Secondly it provides utilities to convert all supported types of path/polygon data to this format, which hugely simplifies the projection operations since everything can now uniformly operate on shapely geometries.
Lastly this PR adds support for handling polygon holes, which has been a longstanding limitation.