Time for action – retrieving vector data
We will use WFS to get vector data encoded in GML. In case you disabled it, as we did in Chapter 11, Tuning GeoServer in a Production Environment, you will need to enable the WFS in GeoServer. Open your command-line console; we are going to use curl
for sending requests:
The first operation that we will use is
GetCapabilities
. It describes which feature types and operations are available on the server:~$ curl -XGET "http://localhost/geoserver/wfs?service=wfs&version=1.0.0&request=GetCapabilities" -o getCapabilities.xml
The XML returned is quite huge; the following lines show you the brief description for a
featuretype
element:<FeatureType> <Name>NaturalEarth:10m_railroads</Name> <Title>10m_railroads</Title> <Abstract/> <Keywords>10m_railroads, features</Keywords> <SRS>EPSG:4326</SRS> <LatLongBoundingBox minx="-150.08159339101002" miny="8.329046942181577...