how to geocode from just the zip code without address field

Created on 7 June 2024, 4 months ago
Updated 12 July 2024, 3 months ago

Problem/Motivation

If i add an address field to my content, then the geocode is working correctly when i save the content. however , I dont want to have to add this field, I just want to be able to geocode from the zipcode that i have in my content (not an address field) - I am using ArcGisOnline as the provider .. it works when i use the address field , but when i set it to geocode from the zip code field (outside the address field) , I get a message "unable to geocode xxxx" without any further explanation. Is this something i can do if i add code in a custom module on update of the content ? If so where is there a code example of how to do this ? thank you

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Fixed

Version

4.23

Component

Code

Created by

🇺🇸United States dianacastillo Miami

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dianacastillo
  • Status changed to Fixed 3 months ago
  • 🇮🇹Italy itamair

    Well ... of course only the ZIP value cannot be Geocoded by any Geocoder Provider, without at least the context of a Country value.

    "unable to geocode xxxx" simply means that the specific Geocoder Provider API response is not successful (the specific Geocoder Provider API couldn't geocode that address / string).

    The Arcgisonline Geocoder (so as any other else, I would bet) needs to be provided with at least a Country code or a Country name, with the ZIP value, because ZIP formats (and valid values) vary depending on the countries.

    Try to looks for a random ZIP code, such as "45677" in Google Maps. It will very probably fail ... (without providing at least the Country code7name that code could be valid for)

    So, if you want to make the use adding only a ZIP value, because the Country wouldn't change, then you need to create your own Field Text widget so that it always Concatenates the Country name (or Code) along the ZIP, and "ZIP + Country Name" will be provided to the Geocoder provider.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024