Hi, first of all, thank u for the module! but i have suggestion:

Maybe it's better do not create field in db, and simply select them in module admin panel? i mean:

create new content type: geo
add fields manually: lat, lang, city, address.

in module options select:
source field for decode: Address
fields to populate:
latitude -> lat field
longitude -> long field
city -> City field.

As i remember, google api return to geocoder request a lot of data. Why we don't use it?

For example, in my website, i need the "sublocality, political" value for my directory items. For now, i have to introduce this value manually.

what are u think?

Comments

derjochenmeyer’s picture

Title: Suggestion » Suggestion: Populate custom fields with geocoded data

Thanks, kervi for trying the module and sharing your ideas.

First of all, the Google Maps API (V3) is just one of the widgets provided by Geolocation Field. The core of Geolocation Field should and will be to store geolocations (lat-lng pairs) and do proximity look ups in the database. But of course, it would be sad to lose all the additional information returned by Google's geocoder.

I don't think its a good idea to store latitude and longitude outside of Geolocation Field. We need that information in ONE place to use it effectively. But I really like the idea of populating custom fields with additional data returned by the Google Geocoder API (or any other widget that might be implemented).

Tokens could be used to populate custom fields.

I'm busy with some other projects and the core of Geolocation Field at the moment. But I'd be happy if someone jumps in and provides a patch or co-maintership for this functionality.

We also need to think about these kinds of things ...

  • Maybe the custom fields should not be visible (editble) for users. So we could populate Hidden Field Widgets.
  • What if geocoder does not populate (all of) the tokens, e.g. for a partially invalid address/location. Do we need to make these tokens required? How should we solve this in the UI?
BenK’s picture

Subscribing

mile23’s picture

Component: Code » Geolocation field

This issue is very similar to #1040640: Store and display geocoded address information AND/OR address data entered by users, which has a longer comment thread. :-)

jm.federico’s picture