2

I have polygon string ,how can I find geometry by giving polygon as input,Is there any function like we have ST_GeometryFromText('POLYGON ....) in postgis ,which give geometry.

1 Answer 1

6

From the documentation use a WKTReader:

    GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();

    WKTReader reader = new WKTReader(geometryFactory);
    Point point = (Point) reader.read("POINT (1 1)");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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