Skip to main content
deleted 4 characters in body
Source Link
Ari Jolma
  • 111
  • 1
  • 5

GEOSVoronoiDiagram is not published in the Shapely API. However, it is available in the newer GEOS libraries. I'm trying to use it with

func = getattr(geos._lgeos, 'GEOSVoronoiDiagram_r')
attr = ftools.partial(func, geos.lgeos.geos_handle)
attr.__name__ = func.__name__
setattr(geos.lgeos, 'GEOSVoronoiDiagram', attr)
geos.lgeos.GEOSVoronoiDiagram.restype = c_void_p
geos.lgeos.GEOSVoronoiDiagram.argtypes = [c_void_p, c_void_p, c_double, c_int]

gc = geom_factory(
    geos.lgeos.GEOSVoronoiDiagram(
        geom._geom,
        env._geom,
        tolerance,
        0 # int(edges)
    )
)
g for g in gc.geoms]

Which is copied from relevant code in Shapely, but that gives the error

ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4

What am I missing?

GEOSVoronoiDiagram is not published in the Shapely API. However, it is available in the newer GEOS libraries. I'm trying to use it with

func = getattr(geos._lgeos, 'GEOSVoronoiDiagram_r')
attr = ftools.partial(func, geos.lgeos.geos_handle)
attr.__name__ = func.__name__
setattr(geos.lgeos, 'GEOSVoronoiDiagram', attr)
geos.lgeos.GEOSVoronoiDiagram.restype = c_void_p
geos.lgeos.GEOSVoronoiDiagram.argtypes = [c_void_p, c_void_p, c_double, c_int]

gc = geom_factory(
    geos.lgeos.GEOSVoronoiDiagram(
        geom._geom,
        env._geom,
        tolerance,
        0 # int(edges)
    )
)
g for g in gc.geoms]

Which is copied from relevant code in Shapely, but that gives the error

ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4

What am I missing?

GEOSVoronoiDiagram is not published in the Shapely API. However, it is available in the newer GEOS libraries. I'm trying to use it with

func = getattr(geos._lgeos, 'GEOSVoronoiDiagram_r')
attr = ftools.partial(func, geos.lgeos.geos_handle)
attr.__name__ = func.__name__
setattr(geos.lgeos, 'GEOSVoronoiDiagram', attr)
geos.lgeos.GEOSVoronoiDiagram.restype = c_void_p
geos.lgeos.GEOSVoronoiDiagram.argtypes = [c_void_p, c_void_p, c_double, c_int]

gc = geom_factory(
    geos.lgeos.GEOSVoronoiDiagram(
        geom._geom,
        env._geom,
        tolerance,
        int(edges)
    )
)
g for g in gc.geoms]

Which is copied from relevant code in Shapely, but that gives the error

ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4

What am I missing?

edited body
Source Link
Ari Jolma
  • 111
  • 1
  • 5

GEOSVoronoiDiagram is not published in the Shapely API. However, it is available in the newer GEOS libraries. I'm trying to use it with

geos.lgeos.GEOSVoronoiDiagram.restype = c_void_p
geos.lgeos.GEOSVoronoiDiagram.argtypes = [c_void_p, c_void_p, c_double, c_int]
func = getattr(geos._lgeos, 'GEOSVoronoiDiagram_r')
attr = ftools.partial(func, geos.lgeos.geos_handle)
attr.__name__ = func.__name__
setattr(geos.lgeos, 'GEOSVoronoiDiagram', attr)
geos.lgeos.GEOSVoronoiDiagram.restype = c_void_p
geos.lgeos.GEOSVoronoiDiagram.argtypes = [c_void_p, c_void_p, c_double, c_int]

gc = geom_factory(
    geos.lgeos.GEOSVoronoiDiagram(
        geom._geom,
        env._geom,
        tolerance,
        0 # int(edges)
    )
)
g for g in gc.geoms]

Which is copied from relevant code in Shapely, but that gives the error

ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4

What am I missing?

GEOSVoronoiDiagram is not published in the Shapely API. However, it is available in the newer GEOS libraries. I'm trying to use it with

geos.lgeos.GEOSVoronoiDiagram.restype = c_void_p
geos.lgeos.GEOSVoronoiDiagram.argtypes = [c_void_p, c_void_p, c_double, c_int]
func = getattr(geos._lgeos, 'GEOSVoronoiDiagram_r')
attr = ftools.partial(func, geos.lgeos.geos_handle)
attr.__name__ = func.__name__
setattr(geos.lgeos, 'GEOSVoronoiDiagram', attr)

gc = geom_factory(
    geos.lgeos.GEOSVoronoiDiagram(
        geom._geom,
        env._geom,
        tolerance,
        0 # int(edges)
    )
)
g for g in gc.geoms]

Which is copied from relevant code in Shapely, but that gives the error

ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4

What am I missing?

GEOSVoronoiDiagram is not published in the Shapely API. However, it is available in the newer GEOS libraries. I'm trying to use it with

func = getattr(geos._lgeos, 'GEOSVoronoiDiagram_r')
attr = ftools.partial(func, geos.lgeos.geos_handle)
attr.__name__ = func.__name__
setattr(geos.lgeos, 'GEOSVoronoiDiagram', attr)
geos.lgeos.GEOSVoronoiDiagram.restype = c_void_p
geos.lgeos.GEOSVoronoiDiagram.argtypes = [c_void_p, c_void_p, c_double, c_int]

gc = geom_factory(
    geos.lgeos.GEOSVoronoiDiagram(
        geom._geom,
        env._geom,
        tolerance,
        0 # int(edges)
    )
)
g for g in gc.geoms]

Which is copied from relevant code in Shapely, but that gives the error

ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4

What am I missing?

Source Link
Ari Jolma
  • 111
  • 1
  • 5

Call GEOSVoronoiDiagram from Shapely

GEOSVoronoiDiagram is not published in the Shapely API. However, it is available in the newer GEOS libraries. I'm trying to use it with

geos.lgeos.GEOSVoronoiDiagram.restype = c_void_p
geos.lgeos.GEOSVoronoiDiagram.argtypes = [c_void_p, c_void_p, c_double, c_int]
func = getattr(geos._lgeos, 'GEOSVoronoiDiagram_r')
attr = ftools.partial(func, geos.lgeos.geos_handle)
attr.__name__ = func.__name__
setattr(geos.lgeos, 'GEOSVoronoiDiagram', attr)

gc = geom_factory(
    geos.lgeos.GEOSVoronoiDiagram(
        geom._geom,
        env._geom,
        tolerance,
        0 # int(edges)
    )
)
g for g in gc.geoms]

Which is copied from relevant code in Shapely, but that gives the error

ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4

What am I missing?