1

My code:

  import mapnik

geometries = [
    (0, "POLYGON ((0 0, 5 0, 5 5, 0 5, 0 0))"),
    (1, "POLYGON((1 5, 4 5, 4 6, 1 6, 1 5))")
]

ds = mapnik.MemoryDatasource()

ctx = mapnik.Context()

for id, wkt in geometries:
    f = mapnik.Feature(ctx, id)
    f.add_geometries_from_wkt(wkt)
    ds.add_feature(f)

Output:

Traceback (most recent call last):
  File "ss.py", line 14, in <module>
    f.add_geometries_from_wkt(wkt)
AttributeError: 'Feature' object has no attribute 'add_geometries_from_wkt'

What I'm doing wrong?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.