span8
span4
span8
span4
Previous: Defining a Drive-Time Zone
In this tutorial, you will learn how to geocode addresses using the Forward and Reverse Geocoding Modes of the Geocoder transformer. In Exercise 1, you will use the Forward Mode by reading in a spreadsheet that contains a list of schools with the address attributes in a single column. Similarly, in Exercise 2, you will use the Reverse Mode by reading in a spreadsheet that contains a list of schools with the corresponding latitude and longitude coordinates in order to derive the address information.
In this scenario, you will be geocoding using the address attribute from an Excel file for deriving X, Y coordinates in the LL84 coordinate system. This tutorial will utilize the OpenStreetMaps geocoding service in order to obtain the lat/long coordinates for schools in Vancouver.
The Excel Workbook contains 3 attribute columns: School Name, School Category, and Address. You will use the Address column to geocode the schools and obtain their coordinates in the LL84 coordinate system.
For more information on the geocoding services available in the Geocoder transformer, see theGeocoder Documentation. Additionally, many services have restrictions on how their results may be used or displayed and may produce different address formats. Check with your chosen service for terms and conditions.
In this exercise, the AttributeManager will be used to both remove unwanted attributes that are created by the Geocoder and rename the latitude and longitude attributes in order to match the naming convention of the input file.
The Geocoder transformer will create a number of attributes; however, you are only interested in obtaining the address information in this case. In the Attribute Actions section, remove the unwanted attributes either by selelcting “Remove” from the drop-down list in the Actions column OR selecting the row and using the remove row button ( - ) at the bottom of the Attribute Actions section. For more information on removing attributes, see theDesktop Basic Course Manual.
Input Attribute | Output Attribute | Attribute Value | Action |
SCHOOL_NAME | SCHOOL_NAME | Do Nothing | |
SCHOOL_CATEGORY | SCHOOL_CATEGORY | Do Nothing | |
_latitude | LATITUDE | Rename | |
_longitude | LONGITUDE | Rename | |
ADDRESS | ADDRESS | Do Nothing |
By default, the FME Workspace Parameter is set to Terminate Translation which will cause the Workspace to stop if any features are rejected by the Geocoder. You can learn more about rejected feature handling in theDesktop Basic Course Manual.
In this case, we set the parameter to continue because some addresses will be rejected if the address information were not entered incorrectly (i.e. 1234 West 49th vs. West 49, 1234). Again, the expected input address format varies between services. See the documentation provided by your chosen service for details. After running the workspace you will notice that 35 addresses were rejected and 159 were correctly geocoded, without changing this parameter, the translation would terminate after the first feature is rejected.
If you wish to save the output, you can either connect a writer to the AttributeManager:Output port or by using the Save Selected Data as in the FME Data Inspector and selecting the format that you wish to save the data as (i.e. PostGIS, File Geodatabase, DWG, etc.). For more instructions on saving data in the FME Data Inspector, see theSaving DataDocumentation.
In this scenario, you will be geocoding using the latitude and longitude attributes from an Excel file in order to derive postal address information. This tutorial will utilize the OpenStreetMaps geocoding service in order to obtain school addresses in the Vancouver area.
The JSON file contains 4 attributes: School Name, School Category, Latitude, and Longitude. You will be using the Latitude and Longitude columns to geocode the schools and obtain each X, Y coordinates address.
For more information on the geocoding services available in the Geocoder transformer, see theGeocoder Documentation. Additionally, many services have restrictions on how their results may be used or displayed and may produce different address formats. Check with your chosen service for terms and conditions.
In this exercise, the AttributeManager will be used to both remove unwanted attributes that are created by the Geocoder and rename the latitude and longitude attributes in order to match the naming convention of the input file.
The Geocoder transformer will create a number of attributes; however, you are only interested in obtaining the address information in this case. In the Attribute Actions section, remove the unwanted attributes by either selecting “Remove” from the drop-down list in the Actions column OR selecting the row and using the remove row button ( - ) at the bottom of the Attribute Actions section. For more information on removing attributes, see theDesktop Basic Course Manual.
Input Attribute | Output Attribute | Attribute Value | Action |
SCHOOL_NAME | SCHOOL_NAME | Do Nothing | |
SCHOOL_CATEGORY | SCHOOL_CATEGORY | Do Nothing | |
LATITUDE | LATITUDE | Do Nothing | |
LONGITUDE | LONGITUDE | Do Nothing | |
_address | ADDRESS | Rename |
本教程中使用的数据来源于da开放ta made available by theCity of Vancouver, British Columbia. It contains information licensed under the Open Government License - Vancouver.
© 2020 Safe Software Inc |Legal