java - How to create a polygon in JTS when we have list of coordinate? -


we can create linestring using coordinates list this:

     geometry g1 = new geometryfactory().createlinestring(coordinates); 

how can create polygon using coordinates list?

thanks in advance.

the accepted answer might have still been valid (still awkward) in 2012 nowadays should this:

// create geometryfactory if don't have 1 geometryfactory geometryfactory = new geometryfactory();  // pass array of coordinate or coordinatesequence method polygon polygonfromcoordinates = geometryfactory.createpolygon(coordinates); 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -