private static void initialise(){
  Hints hints=new Hints(Hints.CRS,DefaultGeographicCRS.WGS84);
  PositionFactory positionFactory=GeometryFactoryFinder.getPositionFactory(hints);
  GeometryFactory geometryFactory=GeometryFactoryFinder.getGeometryFactory(hints);
  PrimitiveFactory primitiveFactory=GeometryFactoryFinder.getPrimitiveFactory(hints);
  AggregateFactory aggregateFactory=GeometryFactoryFinder.getAggregateFactory(hints);
  wktParser=new WKTParser(geometryFactory,primitiveFactory,positionFactory,aggregateFactory);
  wktTypeList.add(new WKTType(WKT_POINT,false,1,"Point",false));
  wktTypeList.add(new WKTType(WKT_MULTIPOINT,true,1,"Point",false));
  wktTypeList.add(new WKTType(WKT_LINESTRING,false,2,"Line",false));
  wktTypeList.add(new WKTType("LINEARRING",false,2,"Line",false));
  wktTypeList.add(new WKTType(WKT_MULTILINESTRING,true,2,"Line",false));
  wktTypeList.add(new WKTType(WKT_POLYGON,false,-1,"Polygon",true));
  wktTypeList.add(new WKTType(WKT_MULTIPOLYGON,true,-1,"Polygon",true,true));
  for (  WKTType wkyType : wktTypeList) {
    wktTypeMap.put(wkyType.getName(),wkyType);
  }
}

private static void initialise ( ) { Hints hints = new Hints ( Hints . CRS , DefaultGeographicCRS . WGS84 ) ; PositionFactory positionFactory = GeometryFactoryFinder . getPositionFactory ( hints ) ; GeometryFactory geometryFactory = GeometryFactoryFinder . getGeometryFactory ( hints ) ; PrimitiveFactory primitiveFactory = GeometryFactoryFinder . getPrimitiveFactory ( hints ) ; AggregateFactory aggregateFactory = GeometryFactoryFinder . getAggregateFactory ( hints ) ; wktParser = new WKTParser ( geometryFactory , primitiveFactory , positionFactory , aggregateFactory ) ; wktTypeList . add ( new WKTType ( WKT_POINT , false , 1 , "Point" , false ) ) ; wktTypeList . add ( new WKTType ( WKT_MULTIPOINT , true , 1 , "Point" , false ) ) ; wktTypeList . add ( new WKTType ( WKT_LINESTRING , false , 2 , "Line" , false ) ) ; wktTypeList . add ( new WKTType ( "LINEARRING" , false , 2 , "Line" , false ) ) ; wktTypeList . add ( new WKTType ( WKT_MULTILINESTRING , true , 2 , "Line" , false ) ) ; wktTypeList . add ( new WKTType ( WKT_POLYGON , false , - 1 , "Polygon" , true ) ) ; wktTypeList . add ( new WKTType ( WKT_MULTIPOLYGON , true , - 1 , "Polygon" , true , true ) ) ; for ( WKTType wkyType : wktTypeList ) { wktTypeMap . put ( wkyType . getName ( ) , wkyType ) ; } }
initialise the wktparser object
