public static Polygon create ( org . locationtech . jts . geom . Polygon polygon ) { double [ ] lats = new double [ polygon . getNumPoints ( ) ] ; double [ ] lons = new double [ polygon . getNumPoints ( ) ] ; for ( int i = 0 ; i < polygon . getNumPoints ( ) ; i ++ ) { lats [ i ] = polygon . getCoordinates ( ) [ i ] . y ; lons [ i ] = polygon . getCoordinates ( ) [ i ] . x ; } return new Polygon ( lats , lons ) ; }
Lossy conversion to a GraphHopper Polygon .