Skip to end of metadata
Go to start of metadata

This page contains working WFS examples of requests with their responses from the MassGIS WFS. WFS requests can be either in URL or XML format. (However, in URL format many characters need to be substituted, and the URL gets long and difficult to read.)

URL Examples

Specific Example: GetCapabilities request

Specific Example: Get a count of the number of schools in the massgis:GISDATA.SCHOOLS_PT layer

Specific Example: Get all the attribute (column, field) names of the layer GISDATA.TOLLBOOTHS_PT

Specific Example: Get all the values of all the attributes of all the features of the layer GISDATA.TOLLBOOTHS_PT

Specific Example: Get all the values of all the attributes of all the features of the layer GISDATA.TOLLBOOTHS_PT, sorted by an attribute

Specific Example: Get all the values of the TOWN attribute for all the features of the layer GISDATA.TOLLBOOTHS_PT

Specific Example: Get all the values of the feature with OBJECTID = 1 in the layer GISDATA.TOWNS_POLY

Specific Example: Download all the values all (or some) the attributes for the layer GISDATA.TOWNS_POLY

Specific Example: Download all the values for all (or some) of the attributes for the layer GISDATA.TOWNS_POLY

Specific Example: Download all the values all the attributes for the layer GISDATA.TOWNS_POLY in CSV format

Specific Example: Get NAME and POP2000 of towns (layer name massgis:GISDATA.TOWNS_POLYM) with POP2000 > 100000

Instead of a Filter in the URL, you can use easier-to-read CQL
Specific Example: Get NAME and POP2000 of towns (layer name massgis:GISDATA.TOWNS_POLYM) with POP2000 > 100000

XML Examples

Specific Example: Get all the values of the town of Hancock from the layer GISDATA.TOWNS_POLY

Specific Example: Get all the values of the DOR LA3 points of Malden three families with a sale price between $600,000 and $800,000 inclusive and a sale date in January-April 2005

Specific Example: Get all the values of the feature with OBJECTID = 1 in the layer GISDATA.TOWNS_POLY

Get subset of attribute values for a feature (return only certain attributes)

Specific Example: Get the name and address of all the schools in Hancock (using the value of the attribute TOWN in the schools datalayer.)

Get subset of attribute values for features Example 1 (complex filter) (return only certain attributes for certain features)

Specific Example: Get the name, address, type, and town of all charter schools with both kindergarten and a 12th grade (using the values of the attributes GRADES and TYPE in the schools datalayer.)

Get subset of attribute values for features Example 2 (complex filter) (return only certain attributes for certain features)

Specific Example: Get the name and town of all schools named after Martin Luther King, Jr. (using the values of the attributes GRADES and TYPE in the schools datalayer.)

Specific Example: Get the rectangular bounding box of Hancock

Specific Example: Get all the values of all the attributes of all the features that fall inside the bounding box rectangle of the town of Hancock

Specific Example: Just a specific example for determining whether a point falls within an ACEC polygon

Specific Example: Get the names of all streets that fall inside or cross this bounding box rectangle

Specific Example: Get the shape of the town of Hancock

Get feature(s) by shape (all attributes)

Specific Example: Get all the values of all the attributes of all the features that fall inside the shape of the town of Hancock

Specific Example: Get all the name and address of schools that fall inside the shape of the town of Millville, where we provide the shape of Millville in latitude/longitude coordinates (and specify that with the EPSG code 4326).

Specific Example: Get the name of the town which has the shape of this polygon (Hancock)
Specific Example: Get the name of the school which has the shape of this point
(Aleda can't get a line example to work yet)

Specific Example: Get the name and address of all the schools in Hancock (using the shape of Hancock)

Specific Example: Get the name and 1980-1990 and 1990-2000 population change for towns which have grown more in
the 1990-2000 period than the 1980-1990 period and whose change was more than 5000 persons.

Specific Example: Get the name of the town that this polygon overlaps

Specific Example: Get the name of airports not in a rectangle (could be triangle or polygon, any shape)

Specific Example: Get the name of the towns that this line crosses

Specific Example: Get the name of the towns that this line crosses, except Malden

Specific Example: Get the name of the town that contains this point
Specific Example: Get the name of the county that contains this polygon (shape of Pittsfield)
Specific Example: Get the name of the town that contains this line (street segment)

General Notes

  • The <GetFeature> tag in an XML WFS request can have an attribute maxFeatures to limit the number of returned features
Page: GeoServer - WFS - Extract - CSV Format Page: GeoServer - WFS - Extract - Excel Format Page: GeoServer - WFS - Extract - GeoTiff Page: GeoServer - WFS - Extract - Shapefile Format Page: GeoServer - WFS - Filter - Beyond Page: GeoServer - WFS - Filter - Contains Page: GeoServer - WFS - Filter - Crosses Page: GeoServer - WFS - Filter - Crosses plus Not Page: GeoServer - WFS - Filter - Disjoint Page: GeoServer - WFS - Filter - DWithin Page: GeoServer - WFS - Filter - Get Subset of Attribute Values for a Feature - Complex Filter Page: GeoServer - WFS - Filter - Get Subset of Attribute Values for a Feature - Complex Filter 2 Page: GeoServer - WFS - Filter - Math Page: GeoServer - WFS - Filter - Overlaps Page: GeoServer - WFS - Filter - PropertyIsBetween Page: GeoServer - WFS - Filter - Touches Page: GeoServer - WFS - Filter - URL Page: GeoServer - WFS - Get Attribute Names for a Datalayer Page: GeoServer - WFS - Get Attributes Values for a Date Range Page: GeoServer - WFS - Get Attributes Values for a Feature Page: GeoServer - WFS - Get Attribute Values for a Datalayer Page: GeoServer - WFS - Get Attribute Values for a Datalayer Sorted Page: GeoServer - WFS - Get Bounding Box for a Feature Page: GeoServer - WFS - Get Feature by Bounding Box Page: GeoServer - WFS - Get Feature by Bounding Box Example 2 Page: GeoServer - WFS - Get Feature by Bounding Box Point in Polygon Page: GeoServer - WFS - Get Feature by Polygon Page: GeoServer - WFS - Get Feature by Polygon - Equals Page: GeoServer - WFS - Get Feature by Polygon - Other Projection Page: GeoServer - WFS - Get Feature by Polygon with Attribute Subset Page: GeoServer - WFS - Get Feature - Count Features Page: GeoServer - WFS - Get One Attribute's Values for a Datalayer Page: GeoServer - WFS - Get Shape Coordinates for Feature Page: GeoServer - WFS - Get Subset of Attribute Values for a Feature Page: GeoServer - WFS - Get Values for a Datalayer by Featureid Page: GeoServer - WFS - Substring Function