Hot answers tagged

10

For anyone who is having the same issue, this worked for me: In Geoserver, Go to "Data Security" section. Check if writing is allowed to anonymous user for all the workspace (..w), or create a new rule giving you access to the workspace in where your wfs-t layers are. Try Again.


8

You'll need to enable Transactional in the global WFS settings in the Services section of the side menu. Be careful with the workspace-specific service settings because they don't usually do what people think they do. Those settings only come into effect when you use the virtual endpoints such as http://localhost:8080/geoserver/myworkspace/wfs, but they have ...


7

For anybody interested in how to correctly use ajax and return jsonp from geoserver this is how its done: var url = "http://localhost:8080/geoserver/Common/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=cite:markers&outputFormat=text/javascript&format_options=callback:getJson"; $.ajax({ ...


6

This looks like a bug in GeoServer. GeoServer needs to identify when a schemaLocation references the GeoServer's own WFS service and does this by looking at the hostname of the URL and comparing it to a list of known hostnames it generates at start up by looking at the network interfaces. If it fails to recognize itself it will make an HTTP request to ...


6

This is because boundedBy / bbox is a property that OpenLayers creates when parsing the GML, it is not a real feature property. So when you update, you should clone the feature and get rid of it. Some example code: // do a WFS transaction to update the geometry var properties = feature.getProperties(); // get rid of bbox which is not a real property delete ...


6

Have a look at my blog for a bit on WFS-T. This uses the OL 3.5 library. https://medium.com/@goldrydigital/wfs-t-with-openlayers-3-16-6fb6a820ac58


6

For debugging going to Menu -> View -> Panels -> Log Messages Panel worked for me. In the error log panel showing up, go to WFS-Tab and check for any error messages. It's not very verbose but could lead to the right track. In my case, this helped to find out, that the DescribeFeatureType url in the GetFeature-XML was wrong, so this request failed.


6

While it's possible and common to publish views in GeoServer WFS, the access is limited to read-only usage, you won't be able to edit them. GeoServer normally marks views as read only because it cannot find a primary key in them (pk is mandatory to generate the gml:id and to support featureid filters). To make the view editable, assuming you can find a ...


6

when/where and why do I need to use the WFS-T capability of GeoServer? I think the answer to this question of need is of course: never If you think you have a better way of handling edits to features in your database, then do it your way. Whenever you write code for any purpose there is never a one hat fits all way of doing something, you should always ...


5

I know that this question is 3 years old, but I think it will help future people reading this subject. You can find an OpenLayers implementation of topology here: http://dev.openlayers.org/sandbox/bjornharrtell/eventbasedtopology2/examples/topology.html


5

GeoServer indeed tends to swap coordinates on several occasions when using WFS. I couldn't backtrack this phenomenon to its exact origin, only to this post, where it is assumed, this confusion is created by the different axis orientation of EPSG:4326, and CRS:84, which are otherwise identical projections. A possible workaround could be implemented on the ...


5

The best place to look for details like this is in the standard. Inserting non spatial attributes is done in exactly the same way as adding spatial attributes. First check the schema of the feature type by using a describeFeature request, then construct a Transaction request with the attribute values in the same order as the schema requires.


4

You need to use WFS-T, the T standing for transactional, which is what's required to be able to write-back. Both Openlayers and GeoServer support this. This question may help on the script side - WFS-T: changes not saved on an OpenLayers map There's also a sample tutorial here: http://www.gistutor.com/openlayers/22-advanced-openlayers-tutorials/47-...


4

Your Insert request contains an feature that doesn't match your Schema which is expecting the Point attribute to be called the_geom. You don't get an error because you have marked that feature as Nillable (or optional). <xsd:schema xmlns:gml="http://www.opengis.net/gml" xmlns:opengeo="http://opengeo.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ...


4

You don't really need any geospatial Python libraries. WFS-T is simply based on http requests. OGR does not support all WFS-T operations e.g no lock support according to official OGR WFS documentation. As long as you provide the payload, the authentication, the URL endpoint, you may just use Python requests library to simplify calls to the WFS-T endpoint. ...


4

Make sure that you are using an EPSG code of http://www.opengis.net/gml/srs/epsg.xml#4326 instead of epsg:4326 so that the X/Y lat/Lon mapping is fixed rather than variable as it is with epsg:4326. Then make sure you are encoding the geometries that you send in the same order as you have told GeoServer to expect them. See the GeoServer documentation for a ...


4

Here are three general causes of read only layers (cannot remember any other): Lack of primary key (seems you already checked it's not the case) Security (just authenticate as the admin user while doing WFS-T to factor it out) Table contains a column type that GeoServer does not understand and thus cannot modify (e.g., hstore in postgresql)


4

When you store geometry in 'Multi' postgis types, geoserver also expects this 'Multi' in transaction query. Leaflet-WFST plugin can create Multi-geometry requests on simple geometries by option 'forceMulti', this option available since v2.0.1-beta.18 var wfstPoly = new L.WFST({ ... forceMulti: true ... }).addTo(map);


4

After a bit of digging I found that gml:id is of type xml:ID: For both attributes and simple element content, the lexical domain of these datatypes is the lexical domain of XML nonqualified names (xs:NCName). An xs:NCName is restricted to \[\i-\[:\]\]\[\c-\[:\]\]* which means that it can't start with a number, . or minus, or contain any of the "...


4

Rules for gml:id come from the GML standard. This is about GML 3.2 7.2.4.5 id The attribute gml:id supports provision of a handle for the XML element representing a GML object. Its use is mandatory for all GML objects. <attribute name="id" type="ID"/> It is of XML type ID, so is constrained to be unique in the XML document within ...


4

It's hard to be sure but it looks like QGIS is sending a version 1.0.0 request and you are responding with a version 2.0 response. I would expect QGIS to become confused when you do that. You need to negotiate the version with the client when it first requests the getcapabilities document. 6.2.4 Version number negotiation An OWS Client may negotiate ...


3

I have the latest Geoserver 2.7.2 and latest Qgis at the time of my writing 2.10.1-Pisa After lot of trial and error and googling this worked for me in geoserver admin global settings add a proxy base url to be base url of your geoserver i used http://hostname:8080/geoserver save the details suddenly no more errors from QGIS all working


3

I know this is kind of an OLD thread, but I have looked for two days for an answer to this same error message about output dimensions needing to be 2 or 3. I think i have found a solution that could be useful to your problem as well as mine, so I'm going to share it. It worked for me. My issue, specifically, was when I converted a bunch of KML's from Google ...


3

You can use the security subsystem to disallow writes on a specific set of layers: http://geoserver.geo-solutions.it/edu/en/security/layer_level.html http://docs.geoserver.org/stable/en/user/security/layer.html


3

WFS-T and shape is a no: Shapefiles are a very common format for geospatial data. But if you are running GeoServer in a production environment, it is better to use a spatial database such as PostGIS. This is essential if doing transactions (WFS-T). Most spatial databases provide shapefile conversion tools. Although there are many options for ...


3

Your column is called the_geom, and your WFS request uses geometry. Make sure they match so it needs to be the_geom in your POST XML as well.


3

Yay, I solved the problem: I just needed to shorten the namespace at var formatGML = new ol.format.GML({ featureNS: 'http://localhost:8080/geoserver/geolytix', featureType: 'wfs_geom', srsName: 'EPSG:3857' }); to just var formatGML = new ol.format.GML({ featureNS: 'geolytix', featureType: '...


3

(Did you allow WFS-t on the geoserver side at first?) Can you try set type name parameter with workspace of wfs feature. $.ajax('http://localhost:8080/geoserver/my_workspace/ows?', { type: 'GET', data: { service: 'WFS', version: '1.1.0', request: 'GetFeature', typename: ...


3

As far as I know, what you're attempting to do is not possible, it would require new code to be written to either: Make the schema configurable via UI (the xml schema snippets are a semi-working hidden hack) Make the schema parsing code realize that thing is really just a string (my guess is that currently something that some object describing the string ...


3

You should combine using the logic operator AND like below var condition1 = new L.Filter.EQ('city', 'Perm'); var condition2 = new L.Filter.EQ('city', 'Quest'); var combinedCondition = new L.Filter.And(condition1, condition2); console.log(combinedCondition.toGml());


Only top voted, non community-wiki answers of a minimum length are eligible