Hot answers tagged

62

Overview: WMS, WFS, WCS describes the differences between WMS, WFS, and WCS fairly clearly. WMS is probably the best known of these three standards due to its widespread use by map servers to deliver map images. In contrast to the images served by WMS, WFS communicates geographic feature information. The WFS web service allows features to be queried, ...


31

I suppose you have been reading this http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html Here comes some sample requests which are sending queries for the demo server of Boundless but which should work similarly with your own server if you have demo layer topp:states installed. Select where STATE_NAME is Illinois http://demo.opengeo....


19

While you can set up a proxy with your webserver, there is an easier way. First, enable JSONP in GeoServer. Then form your data requests like this: var owsrootUrl = 'https://<GEOSERVER URL - CHANGEME>/geoserver/ows'; var defaultParameters = { service : 'WFS', version : '2.0', request : 'GetFeature', typeName : '<WORKSPACE:...


14

UPDATE: Geopandas 0.4.0, allows to read data from URL directly. Thanks @SamTux for pointing it out! OWSLib is good for reading the details and capabilities of specific WFS. For reading the data, I would use request module to first parse the URL with parameters, and then you can read the data directly from that URL using gpd.read_file(). Read WFS ...


13

To learn more about the Rest-Module of geoserver i can recommend you this website: http://geoserver.geo-solutions.it/edu/en/rest/using_rest.html but I guess that you just want to load a WFS-Layer into your Leaflet-map, so you can have a look at this post: http://blog.georepublic.info/2012/leaflet-example-with-wfs-t/ Here the Requests for the WFS-layer are ...


10

It looks like I found your holy grail! SharpMap has a WFS implementation. Code here: https://github.com/SharpMap/SharpMap/blob/master/SharpMap/Data/Providers/WFSClient.cs Main web page here: https://github.com/SharpMap/SharpMap. If I were you, I'd use that as much as I could. It'll save you doing all the tedious implementation stuff...


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.


9

Keep in mind that WFS is already a service which returns its data format (mixture of OGC standards). GeoJSON and KML are only a data format, you'll have to build the service to return the data. So included with WFS are already advanced filtering capabilities such as temporal filters, spatial filters (intersect, touches, overlaps...) as well as logical and ...


9

Ref: http://leafletjs.com/reference.html#icon pointToLayer: function(feature, latlng) { var smallIcon = L.icon({ iconSize: [27, 27], iconAnchor: [13, 27], popupAnchor: [1, -24], iconUrl: 'leaflet/icons/' + feature.properties.pcp + '.png' }); return L.marker(...


9

The easiest way to do this, is to use GDAL's ogr2ogr utility. Firstly, you need to create an XML file with the URL to the WFS endpoint. <OGRWFSDataSource> <URL>http://demo.opengeo.org/geoserver/ows?service=wfs&amp;typeName=osm:roads</URL> <PagingAllowed>ON</PagingAllowed> </OGRWFSDataSource> If you want to add ...


9

The WFS BBOX works in "bbox vs bbox" mode for performance reasons, if you want the more accurate geometry intersection you can use a OGC Filter or CQL filter with the intersection operator. As for the other question, WFS won't consider SLD, only WMS does. The SLD can have filters in rules, including spatial ones (uncommon but not impossible) but mind, they ...


8

I recommend you to read the spec. The biggest pro of WFS is that it is official and standardized way to access vector data. That means when you use WFS, you do not have to reinvent to wheel (e.g. what should happen when two people edit the same feature at the same time?). It is also much easier to share data over WFS than using GeoJSON or KML (again, you do ...


8

Your question is rather broad, but from what you say, the best format would be GeoJSON. OpenLayers, Leaflet and Google Maps all read and display GeoJSON, with a trivial amount of coding required. Here is the Open Layers 3 GeoJSON example. OpenLayers 2 and 3 also have (Geo)JSON writers, which allow you to serialize OpenLayers vector objects back to JSON for ...


8

Try with intersects: <ogc:Intersects> ... </ogc:Intersects>


8

WMS and WFS have different behavior. In WMS the SRS and BBOX parameters are mandatory and the SRS defines both the output projection, and the BBOX has to be expressed in the SRS coordinates. In WFS instead they are both optional, and not linked to each other. srsName defines the desired output projection, so it will cause reprojection, while the BBOX is, ...


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({ ...


7

I got it to work using Geoserver 2.3 and Leaflet with WFS 1.0.0 here. When I changed to version 1.1.0 and 2.0.0 it returned the same json object as 1.0.0 but neither rendered on the map. Not sure why and it's a bit beyond me. Here's what I'm using: var rootUrl = 'http://tomcat.capecodgis.com/geoserver/capecodgis/ows'; var defaultParameters = { ...


7

Normally on each OS QGIS will install the settings in a different location, however there is a switch you can start QGIS with to redirect these settings. When you start QGIS you can start it with the --optionspath and --configpath switches which you can point to a different location. QGIS will now create all the settings in a ini format and move the .qgis2 ...


7

WFS version 1.0.0 supports officially only the default SRS/CRS both for input and output. However, many WFS server brands have backported the srsName parameter that came with WFS 1.1.0 at least for output. With some WFS servers srsName may work also for defining the input geometry but let's assume that it is not possible and concentrate on WFS 1.1.0. As far ...


7

We have implemented WFST plugin here: https://github.com/Flexberry/Leaflet-WFST It supports reading GML and GeoJSON data, and can send transaction requests (insert, update, delete).


7

You should be able to obtain logs from Postgresql once you configure it. I typically will set log_statement = 'all' in my postgresql.conf, even on production databases (with a separate cleanup routine to clear them out every 2 weeks). Also change the log_line_prefix to something that includes at least the process id, something like: log_line_prefix = '%t %...


7

Finally, Matthias Kuhn, one of the developers of QGIS gave me the key. The WHERE clause is built checking the type of the primary key of the table. It should be an Integer and in some of my tables I saw that the type was Numeric(8,0). Those tables and primary keys were created by a third-party app some time ago. I changed the type to Integer and all ...


7

As @PolyGeo suggested, I am converting my comments into an answer. The answer is split into three parts to broadly reflect the three comments I made. Part 1 Roy Fielding's dissertation that described Representational State Transfer (REST) amongst other architectural styles Architectural Styles and the Design of Network-based Software Architectures was ...


7

I think you are using jetty and not catalina, I got same problem in Windows : http://www.eclipse.org/jetty/documentation/current/cross-origin-filter.html Try putting instead in web.xml : <filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> </...


7

According to this service description of the WFS the following rules apply to the usage of the service: Limitaciones del servicio WFS: Búsqueda por caja de 4km2 y 5.000 elementos […] Translated via Google Translate it means: WFS Service Limitations: Search by box of 4km2 and 5,000 elements […] This means, that the ...


7

You can use the QgsVectorLayer::providerType() method to determine the data provider of the layer in question: vLayer = QgsVectorLayer(uri, "WFS_layer", "WFS") vLayer.providerType() >>> u'WFS' rLayer = QgsRasterLayer(url, 'WMS_layer', 'wms') rLayer.providerType() >>> u'wms'


6

First of all you can't use both BBOX and FILTER in key value pair formatted GET request. In the WFS standard version 1.1.1 it is written as "BBOX (Prerequisite: TYPENAME) (Mutually exclusive with FEATUREID and FILTER.) In lieu of a FEATUREID or FILTER, a client may specify a bounding box as described in subclause 13.3.3." WFS 2.0.0 standards puts it as "For ...


6

You can check within which polygon, if any, your point is by using Contains filter. <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:topp="http://www.openplans.org/topp" xmlns:wfs="http://www.opengis.net/wfs" xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="...


6

Here is an example of the syntax for DWITHIN http://demo.opengeo.org/geoserver/wfs?request=getfeature&version=1.0.0&service=wfs&typename=topp:states&outputformat=json&cql_filter=DWITHIN(the_geom,Point(-88 38),0.1,kilometers) Note that DWITHIN takes three parameters: reference geometry, distance, and distance unit. However, GeoServer ...


6

I think I'd probably look to download the data into Postgres using ogr2ogr then look at TileStashe for serving the vector tiles. Docs for ogr2ogr WFS driver: http://www.gdal.org/drv_wfs.html @underdark wrote about using ogr2ogr: http://anitagraser.com/2012/09/26/wfs-to-postgis-in-3-steps/ There are some pointers for configuring TileStashe here: https://...


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