androidparsinggeotoolswkt

How to handle Circle in WKT?


I am having a json object as

area : CIRCLE (28.625360369528934 77.2227479486792, 3135.6)

how to parse it using WKTreader?


Solution

  • You need to go back to whoever wrote it out and explain the CIRCLE is not a part of the WKT standard and they should stop producing it.

    Your best bet then is to generate a polygon with a lot (200) sides that approximates the circle, probably using the JTS buffer method.

    Point p = gFactory.createPoint(28.625360369528934 77.2227479486792);
    Polygon circle = p.buffer( 3135.6 );