Hot answers tagged

6

A WFS is just an API but conveniently one where everyone has agreed a standard way of talking to it beforehand. So rather than having to read a new bunch of documentation and write some new code for every new dataset you would like to add to your client you can pull in a library that has implemented the standard and use that. As to why you might offer ...


4

You can not see the output because your WFS data is fully transparent. Just change fillOpacity: 0 to 1 in your code.


4

A quick way for doing it without duplicates would be to do the retrieval manually So https://fbinter.stadt-berlin.de/fb/wfs/data/senstadt/s_fb_berlinbtk?service=WFS&request=GetFeature&typenames=fis:s_fb_berlinbtk&version=2.0.0&resulttype=hits& As you say gives us 103331 features: <wfs:FeatureCollection xmlns:wfs="http://www....


3

Check also the schema with DescribeFeatureType. https://openmaps.gov.bc.ca/geo/pub/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=DescribeFeatureType&typenames=WHSE_IMAGERY_AND_BASE_MAPS.GSR_AIRPORTS_SVW <?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:pub="http://openmaps.gov.bc.ca/geo/" xmlns:...


3

QGIS has a tool called "Swap X and Y coordinates" that does exactly that: This algorithm swaps the X and Y coordinate values in input geometries. It can be used to repair geometries which have accidentally had their latitude and longitude values reversed.


2

Ian Turton's answer is exact but INCOMPLETE! After enabling the desired OGS Services at Workspace level (in Edit Workspace), you have to: go back into the main WFS menu and from the Workspace dropdown you have to select the Workspace you want to serve as WFS and check 'Enable' then don't forget to press Save button.


2

I presume your view is in a diferent projection because your code works when the view is in EPSG:4326. When the view projection differs from the WFS you will need to transform the bbox extent for the WFS request from view projection to EPSG:4326, then transform the features from EPSG:4326 to view projection when reading them. var sourceWFS = new ol.source....


2

Check the service with ogrinfo ogrinfo WFS:"https://www.wondermap.it/cgi-bin/qgis_mapserv.fcgi?&map=/home/ubuntu/qgis/projects/Demo_sci_WMS/demo_sci.qgs&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities" Result: ... Metadata: PROVIDER_NAME=Wondermap TITLE=Impianti sciistici Lombardia 1: domini_sciabili (Multi Polygon) 2: ...


2

You can use the OR operator in exactly the same way as you use AND so your query could become: <wfs:Query typeNames="bag:verblijfsobject" srsName="EPSG:28992"> <fes:Filter> <fes:And> <fes:PropertyIsEqualTo matchCase="false"> <fes:ValueReference>pandidentificatie</fes:ValueReference> ...


2

If query by airport ID is a requirement then WFS is the only solution. WMS and WCS does not support queries by attributes. WMS GetFeatureInfo supports only query by a point and even then some tweaking would be needed for making it to work with lat/lon coordinates. WCS is all wrong service for your needs because it can only deliver coverages (usually raster ...


2

Your problem is probably related to: openlayers view projection incompatibility with geoserver WFS resultset projection openlayers "extent" parameter projection incompatibility with you BBOX SRID definition. You need to check which projection is you openlayers map using and request the same SRID projection to geoserver also on BBOX query parameter. See: ...


2

It is on https://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html Like function (implemented on org.geotools.filter.LikeFilterImpl Geotools class) is used as following example: field LIKE '%pattern%' Now for the entire row (all columns) concatenation you could use the concatenate function: concatenate(field1,field2) Finally I recommend ...


2

Composition is better indeed. And that's what I've finally done. In fact, I've used the "Builder" design pattern ("Gang of 4") so I can create single layers, or group of "sublayers". What I call a "sublayer" is a layer "shrinked" by a filter (field value) and giving it a style This way of working also gives the possibility to lower the amount of data to ...


2

is not possible get "outputFormat=application/json" It is not possible in the service you list. The service GetCapabilities response tells you what output formats are available: http://www.ign.es/wfs-inspire/unidades-administrativas?service=WFS&request=GetCapabilities <ows:Parameter name="outputFormat"> <ows:AllowedValues> &...


2

Your bounding box is broken, GeoServer is unable to create a polygon from bbox=-Infinity,-Infinity,Infinity,Infinity.


2

Change your style to a proper point style So change this var vector = new VectorLayer({ source: vectorSource, projection: 'EPSG:25830', style: new Style({ stroke: new Stroke({ color: 'rgba(215, 29, 29, 1.0)', width: 4 }) }) }); To this: var vector = new ol.layer.Vector({ source: vectorSource, projection: 'EPSG:25830', ...


2

Both are good alternatives. The direct WFS request should include a Contains filter, or with point-in-polygon search the Intersects filter is as usable. <wfs:Query typeName="topp:states"> <Filter> <Intersects> <PropertyName>the_geom</PropertyName> <gml:Point srsName="http://www.opengis.net/gml/...


2

Quick manual way that lets GDAL to take care of the tricks is to use ogr2ogr https://gdal.org/programs/ogr2ogr.html and WFS driver https://gdal.org/drivers/vector/wfs.html. The basic command for saving the feature type "fis:s_fb_berlinbtk" into GeoPackage "biotypen.gpkg" is ogr2ogr -f gpkg biotypen.gpkg WFS:https://fbinter.stadt-berlin.de/fb/wfs/data/...


2

WMS is requesting an image so there is no CORS issue. When you request a WFS feature collection the browser is more worried and needs you to handle CORS correctly.


2

Thanks to @AndreaAime, I was able to determine that this was due to decimal truncation by Geoserver. This is really a duplicate of the following question. What causes these geometry differences between original PostGIS data and Geoserver WFS?


2

How Geoserver fetches the data that is served should not be a concern to the consumer (Qgis). If you put the URL that Qgis is displaying in a web browser, it has a more meaningful error message: Cannot do natural order without a primary key, please add it or specify a manual sort over existing attributes If you edit the WFS connection property in ...


2

If you don't want to put it in the startup.py you can define it in the macro section from the project properties dialog, below you find an example with a WFS. You have to enable macros without asking (Settings->Options->general) - which might be also a per computer scenario: from qgis.core import QgsDataSourceUri, QgsVectorLayer, QgsProject def openProject()...


2

You need a browser that is capable of displaying XML to be able to get into this - I recommend Chrome or Firefox. Clearly your getCapabilities request has been striped of the tags that make it meaningful. On a local instance I get an 86kB file that starts: <wfs:WFS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www....


1

I think it is still there, just further along the list of attributes. {"type":"FeatureCollection","features":[{"type":"Feature","id":"tasmania_cities.1","geometry":{"type":"MultiPoint","coordinates":[[147.291,-42.851]]},"geometry_name":"the_geom","properties":{"CITY_NAME":"Hobart","ADMIN_NAME":"Tasmania","CNTRY_NAME":"Australia","STATUS":"Provincial capital"...


1

That is not a WFS server, they named their service badly. What you link to is a ArcGIS MapServer, something like a WMS. I can load its raster layers using Layer -> Add Layer -> Add ArcGIS MapServer Layer. They do also provide it as WFS though, there is a tiny link at the top of the site which works (apart from being painfully slow) if I add it via Layer -> ...


1

GeoTools is expecting a base URL so you need something like: String url = "http://geodaten.metropoleruhr.de/poi/poi?service=wfs&version=1.1.0"; or even just: String url = "http://geodaten.metropoleruhr.de/poi/poi?"; Also from my quick test you will need to add connectionParameters.put(WFSDataStoreFactory.WFS_STRATEGY.key, "mapserver"); to work ...


1

It seems that this default behaviour cannot be overwritten. So to solve my problem, I finally decided to just download the files locally through WFS and load these. The code is given below, in capital what to change to your own values (+ change epsg value) import zipfile from io import BytesIO # Python 3 proj_xmin= INTVALUE proj_xmax= INTVALUE proj_ymin= ...


1

Both typeName and typeNames work fine on a local machine for me. http://localhost:8080/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typenames=topp%3Atasmania_cities and http://localhost:8080/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typename=topp%3Atasmania_cities Things to check: Make sure that you ...


1

Ok, i found the solution. I forgot to activate the right Axis Order in the WFS parameters. The solution was to change an option in the WFS properties. It is called SRS Axis Order and had to be changed to the values "2, 1", where the values indicate the x- and y- axis.


1

It looks like the WFS has an invalid capabilities response org.geotools.data.DataSourceException: No XSDElementDeclaration found for {http://www.opengis.net/wfs}jupiter_boringer_ws at without the actual WFS endpoint url there isn't much we can do to help. Update Since this is a MapServer installation, you can help GeoServer out by setting the WFS ...


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