Geolocator script / app using custom polygons / areas?

661
7
Jump to solution
02-06-2019 02:28 PM
New Contributor III

Hello all,

I'm interested in creating a script (or model) that would take a table of addresses and geo-code, then append the attribute data of polygon features it is within. Or in other words, let's say we have a list of addresses in a table, and we want to update the table with the city wards it is within.

Now I think I'd do it like this if it weren't a model / script:
- geocode the addresses

- use spatial join to a wards shapefile

- update the table with the values from the spatial join

I don't think this is the best approach if I am turning this into a script, though. 

I've been reading through the documentation for address geolocators, and if I'm understanding right, it may be possible to build a custom geolocator using my own shapefiles (wards, etc.) In that case, it would be really convenient to build this into an online service hosted through ArcGIS Online / GIS Server that people could upload say, a CSV of addresses, and then have it returned back to them with the ward information appended. Or, a local script that could be run without too much understanding of ArcMap. 

I'm wondering if there is any avenue to making such a tool / script that I might be missing, or if I'm on the right track in looking into a custom address geolocator. The documentation does not yet make it clear to me how to use my own custom boundaries when making a custom/composite geolocator. 

Thank you,

Reply
0 Kudos
1 Solution

Accepted Solutions
Esri Regular Contributor

Cassandra:

Based on my understanding of your data, without seeing its attributes, I'm suggesting the following options.

If you use the Create Address Locator tool in ArcMap or Pro:

A.Join attributes first in the reference data

1. Perform a spatial join or use the Identity tool (Advanced licence required) combine the attributes for the city ward polygons to the streets layer.

2. Use the results of step 1 to build a locator based on the Dual Range style and map the 'Additional Field' field from the locator style to the field in the reference data that contains the city ward names.  After the locator is created, you must open the locator properties > Outputs section and set 'Write user-specified additional output fields' to "Yes" in order for the field to show up in the geocode result. 

3. When you geocode the address against this address locator the 'UserFld' in the geocode output will include the value that was mapped to the 'Additional Field'. You could only select Ward or Precincts not both in a single locator.

B. Info about composites 

1. Build a locator for the streets.

2. Build a locator based on the city ward polygons

3. Create a composite locator that contains the locators from steps 1&2.

4. The composite locator can be used to search for either a street address or a city ward. If the input is a street address that included a city ward (123 w main st, ward name)  an no match was found for the street address, the input would  fall back and match to the city ward locator for just the ward name.

If you use the Create Locator tool in Pro:You could create a single locator that referenced multiple reference datasets (street lines:StreetAddress role, city ward polygons:City role, police precinct polygons:POI role) and add multiple additional fields that can reference fields from all three datasets (roles). When you geocode the address or use the Locate pane the additional fields that are mapped to each role will be returned for the input result that is matched to that address type. For example, if you only map fire district to the StreetAddress role as an additional output field and searched for the just the city ward, the fire district output field would not get included in the city ward match.

In the scenario described above with the StreetAddress,City, and POI roles used to build a single locator you could search for a street address and the city ward info be included in the output; search for city ward; or police precinct. After building the single locator with the Create Locator tool you can open the locator properties and turn off output fields that you don't want in the geocode result. In the screenshot below is an example of the additional custom output fields I added to a locator that came from 2 of 3 reference datasets used to create the locator. The additional fields show up after ExtraInfo output field.

The locator that you build in Pro will return suggestions in the Locate pane w/o needing to be published as a service and publishing as a service would be the only way that you could use the locator in ArcMap.

You can use point or polygon data for postal codes, but we suggest using polygons to build the locator based on the Postal role to get the best reverse geocoding experience.

Here are additional topics related to building locators with the Create Locator tool in Pro. Let me know if I missed any of your questions.

Tips for preparing reference data—ArcGIS Pro | ArcGIS Desktop 

Fundamentals of combining multiple locators into a composite locator—ArcGIS Pro | ArcGIS Desktop 

View solution in original post

7 Replies
Esri Regular Contributor

What version of ArcMap or ArcGIS Pro are you using? If the reference data that is being used to build your own address locator includes a field that contains the city ward values, you can build an address locator that will include the city ward info as an additional field when batch geocoding or geosearching.

When you build the locator using the Create Address Locator tool you must map the 'Additional Field' field from the locator style to the field in the reference data that contains the additional information. After the locator is created, you must open the locator properties > Outputs section and set 'Write user-specified additional output fields' to "Yes" in order for the field to show up in the geocode result. You must set this property before publishing the locator as a service.

If you were to build a composite locator that consisted of streets and city wards, the end user could search for either can get the result returned. If the end user searched for the street address a street address would be returned and it would not include any info from the city wards locator in the composite.

If you have access to ArcGIS Pro 2.3 you can build locators that reference multiple fields in the reference data that can be returned in the geocode result using the Create Locator tool. The locators created with the Create Locator tool in ArcGIS Pro cannot be added to ArcMap. If you publish the locator to ArcGIS Server or Portal (federated) 10.6.1 or later, you can access the service in ArcMap through an ArcGIS Server connection in ArcMap/ArcCatalog.

Create Locator—Help | ArcGIS Desktop Create Locator—Help | ArcGIS Desktop 

Introduction to locator roles—ArcGIS Pro | ArcGIS Desktop 

Create a locator—ArcGIS Pro | ArcGIS Desktop 

Reply
0 Kudos
New Contributor III

We have access to latest ArcMap / ArcGIS Pro

"If the reference data that is being used to build your own address locator includes a field that contains the city ward values, you can build an address locator that will include the city ward info as an additional field when batch geocoding or geosearching."

So we can use a polygon file that just includes ward boundaries in addition to other shapefiles/gdb that includes roads information? Would that be a Composite Geocoder? are you able to mix and match reference data in that way? 

And if I'm understanding the end result, we can input a street address, check it against the streets and ward data, and then return the ward data as a new field appended to the dataset? 

"If you have access to ArcGIS Pro 2.3 you can build locators that reference multiple fields in the reference data that can be returned in the geocode result using the Create Locator tool."

Do you mean by this that with ArcGIS Pro I could reference say, Wards and Police Precincts polygon data, but with ArcMap I can only do one or the other?

Thanks for your response. I misunderstood the documentation to mean that only certain types of datasets could be used (The documentation from Create Locator seemed to imply that only postal codes / postal data could be used as polygon boundaries)

Reply
0 Kudos
New Contributor

Just to follow up on this, I played around with the Address Locator in ArcMap and did not get results using my wards boundaries file without any modifications. 


I realize I am trying to do Spatial Join function of joining an attribute of a polygon (such as ward number) to an address layer, but using a Geocoder so that the function can be published as a tool. 

I find that Tableu seems to be able to do this without too much issue (description here) How to map geographies in Tableau that are not built in to the product (e.g. UK postcodes, sales are...  so I am trying to figure out how to do this in ArcMap using a simple polygon file... I'm not finding a current / clear guide on doing so with custom polygons in ArcMap and after a few hours of trying Address Locator tool I'm just getting empty results. 

Reply
0 Kudos
New Contributor

Just to clarify,

"If you were to build a composite locator that consisted of streets and city wards, the end user could search for either can get the result returned."

Does this mean a single dataset that has streets data AND ward data? Or can you have a reference data that is just simple ward polygons without streets data, in addition to a streets layer also? 

Reply
0 Kudos
Esri Regular Contributor

Cassandra:

Based on my understanding of your data, without seeing its attributes, I'm suggesting the following options.

If you use the Create Address Locator tool in ArcMap or Pro:

A.Join attributes first in the reference data

1. Perform a spatial join or use the Identity tool (Advanced licence required) combine the attributes for the city ward polygons to the streets layer.

2. Use the results of step 1 to build a locator based on the Dual Range style and map the 'Additional Field' field from the locator style to the field in the reference data that contains the city ward names.  After the locator is created, you must open the locator properties > Outputs section and set 'Write user-specified additional output fields' to "Yes" in order for the field to show up in the geocode result. 

3. When you geocode the address against this address locator the 'UserFld' in the geocode output will include the value that was mapped to the 'Additional Field'. You could only select Ward or Precincts not both in a single locator.

B. Info about composites 

1. Build a locator for the streets.

2. Build a locator based on the city ward polygons

3. Create a composite locator that contains the locators from steps 1&2.

4. The composite locator can be used to search for either a street address or a city ward. If the input is a street address that included a city ward (123 w main st, ward name)  an no match was found for the street address, the input would  fall back and match to the city ward locator for just the ward name.

If you use the Create Locator tool in Pro:You could create a single locator that referenced multiple reference datasets (street lines:StreetAddress role, city ward polygons:City role, police precinct polygons:POI role) and add multiple additional fields that can reference fields from all three datasets (roles). When you geocode the address or use the Locate pane the additional fields that are mapped to each role will be returned for the input result that is matched to that address type. For example, if you only map fire district to the StreetAddress role as an additional output field and searched for the just the city ward, the fire district output field would not get included in the city ward match.

In the scenario described above with the StreetAddress,City, and POI roles used to build a single locator you could search for a street address and the city ward info be included in the output; search for city ward; or police precinct. After building the single locator with the Create Locator tool you can open the locator properties and turn off output fields that you don't want in the geocode result. In the screenshot below is an example of the additional custom output fields I added to a locator that came from 2 of 3 reference datasets used to create the locator. The additional fields show up after ExtraInfo output field.

The locator that you build in Pro will return suggestions in the Locate pane w/o needing to be published as a service and publishing as a service would be the only way that you could use the locator in ArcMap.

You can use point or polygon data for postal codes, but we suggest using polygons to build the locator based on the Postal role to get the best reverse geocoding experience.

Here are additional topics related to building locators with the Create Locator tool in Pro. Let me know if I missed any of your questions.

Tips for preparing reference data—ArcGIS Pro | ArcGIS Desktop 

Fundamentals of combining multiple locators into a composite locator—ArcGIS Pro | ArcGIS Desktop 

View solution in original post

New Contributor III

Thank you for the detailed explanation, it is very helpful and clears up my confusion!

Reply
0 Kudos
Esri Regular Contributor

You are welcome. Glad I was able to help.

Reply
0 Kudos