Skip to content

Type error when calling intersection on polygon with crs #401

@meggart

Description

@meggart

When calling intersection on two polygons where one contains the other, and the contained polygon has a crs added to the polygon type, an error is thrown. Any suggestions for a fix/workaround? Here is an MWE

import GeoInterface as GI
import GeometryOps as GO
import GeoFormatTypes as GFT
import Proj

outerpoly = GI.Polygon([GI.LinearRing(GI.Point.([(0.0,0.0),(5.0,0.0),(5.0,5.0),(0.0,5.0)]))])
innerpoly = GI.Polygon([GI.LinearRing(GI.Point.([(1.0,1.0),(2.0,1.0),(2.0,2.0),(1.0,2.0)]))])

# works
GO.intersection(outerpoly,innerpoly,target=GI.PolygonTrait())

#breaks after adding crs information to the polygon
prj = GFT.EPSG(25832)
innerpoly_proj = GO.reproject(innerpoly,prj,prj) #stupid hack to add crs
GO.intersection(outerpoly,innerpoly_proj,target=GI.PolygonTrait())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions