Introduction
Describe the REST services associated to the addresses. These services are provided by the MapFish development framework used in OpenAddresses.
Model Fields
- HOUSENUMBER: House number
- CREATED_BY: Creator
- HOUSENAME: House name
- STREET: Street
- POSTCODE: Postal code
- REGION: Region
- CITY: City
- COUNTRY: country code ('CH','FR','AT' etc..)
- QUALITY: ('Digitized','Donated','GPS','Linear interpolation')
Services description
Based on MapFish documentation
KVP parameters
- no_geom=true: so that the returned feature has no geometry ("geometry": null)
- attrs={field1}[,{field2},...]: to restrict the list of properties returned in the feature
- limit={num}: limit the number of features to num features
- offset={num}: skip num features
- order_by={field}: order the features using field
- dir=DESC|ASC: determine the ordering direction (applies only if order_by is specified)
- lon={x}: the x coordinate of the center of the search region, this coord's projection system can be specified with the epsg parameter
- lat={y}: the y coordinate of the center of the search region, this coord's projection system can be specified with the epsg parameter
- tolerance={num}: the tolerance around the center of the search region, expressed in the units of the lon/lat coords' projection system
- box={xmin,ymin,xmax,ymax}: a list of coordinates representing a bounding box, the coords' projection system can be specified with the epsg parameter
- epsg={num}: the EPSG code of the lon, lat or box values
- queryable={field1}[,{field2},...]}: the names of the feature fields that can be queried
- {field}{query_op}={value}: specify a filter expression, field must be in the list of fields specified by queryable, supported query_op's are:
- eq: equal to
- ne: not equal to
- lt: lower than
- le: lower than or equal to
- gt: greater than
- ge: greater than or equal to
- like
- ilike
- query={query term}: string to search for Use a full text search. To be used with attrs key.
- callback={callback name}: name of callback function
- id={id}: the id of the address
- city={city}: the city of the address
- osmid={osmid}: the osmid of the address
- quality={quality}: the quality of the address. Possible values here.
- housenumber={housenumer}: the house number of the address
- region={region}: the region of the address
- created_by={created_by}: the creator of the address
- street={street}: the street of the address
- postcode={postcode}: the postal code of the address
- country={country}: the country of the address Possible values here.
- housename={housename}: the house name of the address
- Output formats:
- Per default: GeoJSON data are sent back.
- CSV
- ZIP containing a CSV file
- Use street or street,city,housnumber as attrs. Database is optimized for these fields.
- Try to always add a spatial filter for maximum performance
GeoCoding Service
Examples- Get three addresses of Genève containing Vogt
- Get three addresses of Genève containing Vogt, with callback
- Get the coordinate of the address of "Chemin des Fleurettes 31" in "Lausanne"
- Extract the first three addresses in the city of "Lausanne" and return only the street, housenumber and city attribute, without geometry.
- Extract the addresses near a point with a specific name:
Reverse GeoCoding Service
Examples MapFish Reverse GeoCoding Service- Extract all the addresses in a tolerance of 1000 m around coordinate 600'000/200'000 of Switzerland EPSG=21781. Return geometry is in EPSG:4326
Count
Examples- Count the number of addresses
- Count the number of addresses created today
- Count the number of addresses updated today
Download
The MapFish protocoll and its KVP can be used to create the query. CSV or ZIP containing a csv file can be downloaded.
Examples- http://www.openaddresses.org/addresses.csv?city=Bottens&attrs=street,city,postcode,housenumber
- http://www.openaddresses.org/addresses.csv?street=Rue%20du%20Creux%20du%20Van&attrs=street,city,postcode,housenumber&no_geom=true
- http://www.openaddresses.org/addresses.csv?lon=6.62&lat=46.51&tolerance=0.01&queryable=street&street__ilike=%Chemin%20du%20M%&attrs=street,postcode,city,created_by
- http://www.openaddresses.org/addresses.csv?id=1100000&attrs=street,postcode,city
- http://www.openaddresses.org/addresses.zip?lon=6.62&lat=46.51&tolerance=0.01&queryable=street&street__ilike=%Chemin%20du%20M%&attrs=street,postcode,city,created_by
- http://www.openaddresses.org/addresses.csv?queryable=city,country&city__ilike=%Bottens%&country__like=CH&attrs=street,postcode,city,created_by,housenumber