This chapter documents features found in the extras folder of the PostGIS source tarballs and source repository. These are not always packaged with PostGIS binary releases, but are usually PL/pgSQL based or standard shell scripts that can be run as is.
A plpgsql based geocoder written to work with the TIGER (Topologically Integrated Geographic Encoding and Referencing system ) / Line and Master Address database export released by the US Census Bureau.
Existem quatro componentes do geocoder: as funções do carregador de dados, o normalizador de endereço, o endereço geocoder e o geocoder inverso.
Embora seja desenvolvido especificamente pelos EUA, muitos conceitos e funções são aplicáveis e podem ser adaptados a trabalhar com endereços de outros países e outras road networks.
The script builds a schema called tiger to house all the TIGER-related functions, reusable lookup data such as road type prefixes, suffixes, states, various control tables for managing data load, and skeleton base tables from which all the TIGER-loaded tables inherit.
Another schema called tiger_data is also created which houses all the census data for each state that the loader downloads from the Census site and loads into the database. In the current model, each set of state tables is prefixed with the state code e.g ma_addr, ma_edges etc with constraints to enforce only that state data. Each of these tables inherits from the tables addr, faces, edges, etc located in the tiger schema.
All the geocode functions only reference the base tables, so there is no requirement that the data schema be called tiger_data or that data can't be further partitioned into other schemas -- e.g. a different schema for each state, as long as all the tables inherit from the tables in the tiger schema.
Para instruções de como ativar a extensão no seu banco de dados e também para carregar dados usando ela, vá para Section 2.3.1, “Tiger Geocoder Enabling your PostGIS database”.
|
|
|
If you are using the TIGER Geocoder (tiger_2010), you can upgrade the scripts using the accompanying upgrade_geocoder.bat / .sh scripts in extras/tiger. One major change between |
|
|
|
You can install the TIGER Geocoder with the PostgreSQL extension model. Refer to Section 2.3.1, “Tiger Geocoder Enabling your PostGIS database” for details. |
The Pagc_Normalize_Address function as a drop in replacement for in-built Normalize_Address. Refer to address_standardizer for compile and installation instructions.
Design:
O objetivo desse projeto é construir um geocoder completamente funcional que pode processar uma string eventual de endereço dos Estados Unidos e, usando os dados normalizados do censo TIGER, produzir um ponto de geometria e avaliação refletindo a localização do endereço dado e likeliness da localização. Quanto maior o número de avaliação, pior o resultado.
The reverse_geocode function is useful for deriving the street address and cross streets of a GPS location.
O geocoder deve ser simples de instalar e usar para qualquer pessoa familiar com o PotGIS, e deve ser mais fácil de instalar e usar em todas as plataformas suportadas pelo PostGIS.
Isso deve ser potente o suficiente para funcionar propriamente, apesar de erros de formatação e ortografia.
Isso deve ser extensível o suficiente para ser utilizado com dados de atualização futuras, ou fontes de dados alternativas com mudanças mínimas de coding.
|
|
|
O esquema |
tiger_data se nenhum esquema é especificado.
county_all, state_all ou código de estado seguido por condado ou estado.
tiger_data se nenhum esquema estiver especificado.
normalized_address (addy) para cada localização, e a avaliação. Quanto menor a avaliação, maior a chance de combinar. Os resultados são separados com menor avaliação em primeiro lugar. Pode passar nos resultados máximos, até 10. Usa dados Tiger (limites, faces, addr), string confusa do PostgreSQL (soundex, evenshtein).
tiger_data. Cada state script retornou como um relato separado.
tiger_data. Cada state script retorna como um registro separado. A versão mais nova suporta mudanças estruturais do Tiger 2010 e também carrega trecho do censo, block groups, e block tables.
norm_addy que não tem um sufixo, prefixo e tipo padronizado, rua, nome de rua etc. quebrado e, campos separados. Essa função irá funcionar com os dados lookup compactados com o tiger_geocoder (dados do censo tiger não são necessários).
norm_addy que não tem um sufixo, prefixo e tipo padronizado, rua, nome de rua etc. quebrado e, campos separados. Essa função irá funcionar com os dados lookup compactados com o tiger_geocoder (dados do censo tiger não são necessários). Requer a extensão address_standardizer.
norm_addy, retorna uma representação impressa dele. Normalmente, usado em conjunto com o normalize_address.
There are a couple other open source geocoders for PostGIS, that unlike the TIGER Geocoder have the advantage of multi-country geocoding support
Nominatim uses OpenStreetMap gazeteer formatted data. It requires osm2pgsql for loading the data together with PostgreSQL and PostGIS. It is packaged as a webservice interface and seems designed to be called as a webservice. Just like the TIGER Geocoder, it has both a geocoder and a reverse geocoder component. From the documentation, it is unclear if it has a pure SQL interface like the TIGER Geocoder, or if a good deal of the logic is implemented in the web interface.
GIS Graphy can utilize PostGIS and like Nominatim uses OpenStreetMap (OSM) data along with some other sources. It comes with a loader to load OSM data and similar to Nominatim is capable of geocoding not just US. Much like Nominatim, it runs as a webservice and relies on Java 1.5, Servlet apps, Solr. GisGraphy is cross-platform and also has a reverse geocoder among some other neat features.