gpt4 book ai didi

postgresql - geoserver wfs-t 是只读异常

转载 作者:行者123 更新时间:2023-11-29 14:17:49 27 4
gpt4 key购买 nike

我正在尝试使用 GeoServer 通过 WFS-T 保存更改:这是我从地理服务器获取功能的代码

var sourceWFS = new ol.source.Vector({
loader: function (extent) {
$.ajax('http://127.0.0.1:8080/geoserver/kairosDB/ows', {
type: 'GET',
data: {
service: 'WFS',
version: '1.1.0',
request: 'getFeature',
typename: 'wfs_geom',
srsname: 'EPSG:3857',
bbox: extent.join(',') + ',EPSG:3857'
}
}).done(function (response) {
sourceWFS.addFeatures(formatWFS.readFeatures(response));
});
},
// strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ()),
strategy: ol.loadingstrategy.bbox,
projection: 'EPSG:3857'
});

这是将特征保存到服务器的代码

var formatGML = new ol.format.GML({
featureNS: 'http://127.0.0.1:8080/geoserver/kairosDB',
featureType: 'wfs_geom',
srsName: 'EPSG:3857'
});

但是当我将特征保存到服务器时,出现了这个错误

2017-02-01 14:30:02,339 ERROR [geoserver.ows] - 
org.geoserver.wfs.WFSTransactionException: {http://127.0.0.1:8080/geoserver/kairosDB}wfs_geom is read-only
at org.geoserver.wfs.Transaction.execute(Transaction.java:269)
at org.geoserver.wfs.Transaction.transaction(Transaction.java:106)
at org.geoserver.wfs.DefaultWebFeatureService.transaction(DefaultWebFeatureService.java:172)
at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)

wfs_geom表已有主键,创建脚本:

CREATE TABLE public.wfs_geom
(
id bigint NOT NULL,
geometry geometry,
CONSTRAINT wfs_geom_pkey PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public.wfs_geom
OWNER to postgres;

GRANT ALL ON TABLE public.wfs_geom TO postgres;

-- Index: sidx_wfs_geom

-- DROP INDEX public.sidx_wfs_geom;

CREATE INDEX sidx_wfs_geom
ON public.wfs_geom USING gist
(geometry)
TABLESPACE pg_default;

你能帮帮我吗?

最佳答案

这很有魅力:http://osgeo-org.1560.x6.nabble.com/Read-only-error-when-editing-a-WFS-T-td5284537.html

There is a rule in the "Data security" section that do allow to write to this workspace for all, but the writing is not allowed to anonymous user for all the workspace (..w) The strange behaviour is that in yesterday I can edit the layer using a client.. and I do not understand why, moreover using QGIS I cannot edit the layer, but QGIS support the WFS-T

关于postgresql - geoserver wfs-t 是只读异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41972613/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com