使用以下代码以编程方式使用 geoserver-manager api ( http://code.google.com/p/geoserver-manager/wiki/Documentation ) 创建一个新层:
GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(RESTURL, RESTUSER, RESTPW);
GSFeatureTypeEncoder featureTypeEncoder = new GSFeatureTypeEncoder();
featureTypeEncoder.setSRS("EPSG:41001");
featureTypeEncoder.setName("view1");
featureTypeEncoder.setNativeBoundingBox(10,10,100,100, "EPSG:41001");
GSLayerEncoder layerEncoder = new GSLayerEncoder();
layerEncoder.setEnabled(true);
boolean ok = publisher.publishDBLayer(WORKSPACE, "user1", featureTypeEncoder, layerEncoder);
新图层已成功创建,但类型错误(点而不是线)。有没有办法在创建图层之前或之后更改此图层类型(线)?
版本: Geoserver 2.3.0 Postgres 1.14 Geoserver-manager 1.3.0
谢谢!