我正在使用REST和Java作为我的编程语言来开发geoserver。我正在尝试将样式应用于它不适合我的图层。
我试过这个:
workspace=publisher.createWorkspace(workspaceName);
System.out.println("Workspace \"New-Workspace\" created "+workspace);
File sldFile=new File("D:/IDM-Marvin/Geoserver/statestyle.sld");
boolean styleLayer = publisher.publishStyle(sldFile,"staStyle");
System.out.println("State style published "+styleLayer);
String style=reader.getSLD("staStyle");
File stateFile = new File("D:/IDM-Marvin/Geoserver/Test/state.zip");
System.out.println(">>>>>>>file exists"+stateFile.exists());
boolean stateLayer = publisher.publishShp("New-Workspace", "myStore","tl_2014_us_state", stateFile, "EPSG:4326", style);
System.out.println("State layer published "+stateLayer);
请帮忙。