GeoNet Web Feature Service
This application provides basic functionality for a Web Feature Service (WFS) which allows advanced searches on the GeoNet earthquake catalogue. WFS is an Open Geospatial Consortium (OGC) standard to allow web-based access to geographical data.
Below are some sample queries for retrieving earthquake data from the WFS in CSV, JSON, GML and KML formats.
Basic Queries
The Last 50 Quakes
The earthquake catalogue is stored so that the most recent data is returned first. You can easily retrieve the last 50 quakes in the New Zealand region in a variety of formats:
GeoJSON
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&maxFeatures=50&outputFormat=json
CSV
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&maxFeatures=50&outputFormat=csv
GML 2
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&maxFeatures=50&outputFormat=GML2
GML 3.2
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&maxFeatures=50&outputFormat=text/xml;
subtype=gml/3.2
KML
http://wfs.geonet.org.nz/geonet/wms/kml?layers=geonet:quake_search_v1&maxFeatures=50
All Quakes
You can retrieve all quakes in any of the above formats by dropping the maxFeatures parameter. Note: This will generate a huge file. At 1 September 2012 there were over 436,000 quakes in the catalogue and this grows at about 20,000 quakes per year. Consider the capabilities of your target system before grabbing all the quakes, for example Google Maps has a limit of 1,000 features.
All quakes in CSV format
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=csv
Depths and magnitudes
- Two earthquakes in our catalogue have an unknown depth represented by -9 km.
- Many earthquakes have undetermined magnitudes represented by -9.0. This is either because:
- No reliable estimate can be made from these pre-instrumental events, though they will have been felt; or
- Insufficient stations calibrated for magnitude recorded the earthquake.
Complex Queries and Filtering
You can make more complex queries using Contextual Query Language (CQL) to filter the results. Some examples are show below. The parameters and the output format can be adjusted in the URL. Also, see the CQL specification and the GeoServer CQL tutorial.
Note: when filtering with spatial queries filter on the origin_geom point type. The longitude and latitude columns are extracted from the origin_geom and provided in the output as a convenience for CSV users.
CSV format
All Quakes After a Date
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=csv&cql_filter=origintime>='2013-05-01'
All Quakes in a Date Range, Located with More than 60 Phases
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=csv&cql_filter=origintime>='2013-06-01'+AND+origintime<'2014-01-01'+AND+usedphasecount>60
All Quakes Above Magnitude 6
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=csv&cql_filter=magnitude>6
All Quakes Above Magnitude 4 in a 1 Degree Square Box Around Wellington After a Date
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=csv&cql_filter=BBOX(origin_geom,174,-41,175,-42)+AND+origintime>='2009-08-01'+AND+magnitude>4
KML format
All Quakes Above Magnitude 6
http://wfs.geonet.org.nz/geonet/wms/kml?layers=geonet:quake_search_v1&cql_filter=magnitude>6
All Quakes Above Magnitude 6 and Deeper than 200 km
http://wfs.geonet.org.nz/geonet/wms/kml?layers=geonet:quake_search_v1&cql_filter=magnitude>6+AND+depth>200
All Quakes Above Magnitude 3 after 1 January 2013 and Occurring Within a Polygon Around Canterbury (corresponding to the Canterbury Region)
NB. To search a polygon, you need to search a closed shape, i.e. the first longitude/latitude pair is repeated again at the end
http://wfs.geonet.org.nz/geonet/wms/kml?layers=geonet:quake_search_v1&cql_filter=magnitude>3+AND+origintime>='2013-01-01'+AND+WITHIN(origin_geom,POLYGON((172.951+-41.767,+172.001+-42.832,+169.564+-44.341,+172.312+-45.412,+175.748+-42.908,+172.951+-41.767)))
All Quakes Shallower than 50 km and Occurring Within 5 km of a Point (longitude 174, latitude -41)
http://wfs.geonet.org.nz/geonet/wms/kml?layers=geonet:quake_search_v1&cql_filter=depth<50+AND+DWITHIN(origin_geom,Point+(175+-41),5000,meters)
GeoJSON format
All Quakes Above Magnitude 6 with event type "earthquake", sort by magnitude
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=json&cql_filter=magnitude>6+AND+eventtype=earthquake+AND+sortBy=magnitude
All Quakes Above Magnitude 6 and Deeper than 200 km
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=json&cql_filter=magnitude>6+AND+depth>200
All Quakes Above Magnitude 3 after 1 January 2010 and Occurring Within a Polygon Around Canterbury (corresponding to the Canterbury Region)
NB. To search a polygon, you need to search a closed shape, i.e. the first longitude/latitude pair is repeated again at the end
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=json&cql_filter=magnitude>3+AND+origintime>='2010-01-01T00:00:00.000Z'+AND+WITHIN(origin_geom,POLYGON((172.951+-41.767,+172.001+-42.832,+169.564+-44.341,+172.312+-45.412,+175.748+-42.908,+172.951+-41.767)))
All Quakes Shallower than 50 km and Occurring Within 5 km of a Point (longitude 174, latitude -41)
http://wfs.geonet.org.nz/geonet/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonet:quake_search_v1&outputFormat=json&cql_filter=depth<50+AND+DWITHIN(origin_geom,Point+(175+-41),5000,meters)
Date time format
The following date time formats are supported:
- 2018-09-01
- 2018-09-01T01:01:01
- 2018-09-01T01:01:01.100Z