2

In my application which I'm building using OpenLayers3, I'm trying to extract the geometry of a feature to WKT using

var format = new ol.format.WKT(); console.log(format.writeGeometry(geometry)); by following this docs.

It works great for Polygon as I have tested, i.e. returning the Geometry String (WKT) but it fails when I try to apply it to Circle Geometry. In particular the log is printed as

Assertion failed: geometryEncoder should be defined

So, is there any solution to this as why this is particularly happening with Circle geometries. And how to resolve it, i.e. where to define this geometryEncoder as suggested in log?

6

The circle geometry (a center with a radius) is not a supported by the WKT format.

Your best chance is to transofrm your Circle geometry in an approximate Polygon with the circular function

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.