How to use the arcgis.geocoding.geocode function in arcgis

To help you get started, we’ve selected a few arcgis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codeforboston / voiceapp311 / mycity / mycity / utilities / gis_utils.py View on Github external
def geocode_addr(addr, city):
    """
    Given a string and a city, determine if the address is in Boston, MA
    :param addr: string corresponding to the address
    :param city: the city of interest
    :return: boolean
    """
    m_location = geocode(addr)

    for location in m_location:
        if location['score'] < 100:
            continue
        if location['attributes']['MetroArea'] \
            and location['attributes']['MetroArea'] != city:
                continue
        if location['attributes']['City'] \
            and location['attributes']['City'] not in NEIGHBORHOODS:
                continue

        return True

    # No address found in the provided city
    return False
github codeforboston / voiceapp311 / mycity / mycity / utilities / gis_utils.py View on Github external
def geocode_address(m_address):
    """
    :param m_address: address of interest in street form
    :return: address in coordinate (X and Y) form
    """
    m_address = m_address + ", City: Boston, State: MA"
    m_location = geocode(address=m_address)[0]
    return m_location['location']