Posted by Garrett Albright on November 25, 2009 at 1:13am
There seem to be several options to provide a CCK field to store a physical address:
- Addresses (D6)
- Address field for CCK (D5)
- Postal (D6, D5 dev release only)
- OpenLayers Geocoder (Maybe? Kind of unclear on what it does.) (D6 dev release only)
- CCK Link to Map (D5, D6 dev release only)
- Location (D5/D6, recommended below)
Does anyone have any experience using any of these?
My ideal solution would be an address field which consists of just a single textarea as opposed to several separate stupid fields for city, state, ZIP, etc. It only needs to be able to "parse" US addresses. Any suggestions?
Comments
It's too bad this isn't a
It's too bad this isn't a wiki page, otherwise I could add Location, which I've been reasonably happy with. I've also used Addresses and Address field for CCK. I found Addresses to be rather difficult to theme, and it's views integration to be spotty. Address field for CCK worked well, but development on it stalled with the maintainer having work supposedly done, but not posted anywhere, so no one stepped up to actually port it to D6 (http://drupal.org/node/421896).
It's too bad that there isn't a clean addressing solution, as it's one of the areas where CCK should shine.
Thanks for the
Thanks for the recommendation, deviant - I'm checking it out, and it looks pretty strong. I was kind of surprised that the module comes in a 1.6MB archive which expands to a 12.2MB directory!… but it looks like the bulk of that is stuff like database dumps of postal codes and such which could be deleted if space gets tight. I've added it to the post.
The Boise Drupal Guy!
Hmm. On further
Hmm. On further investigation, Location seems rather poorly documented. I can't get geocoding to work, but I might just be misunderstanding where in the node creation/updating/loading/rendering process geocoding is supposed to happen - it doesn't seem to be anywhere obvious, anyway. It always says the address is at 0 latitude, 0 longitude (a poor choice for a "null" value, since that is a valid location. In the middle of the ocean, but a valid location.) Or possibly Location is only pretending to support Yahoo's APIs and in reality only works with Google - scanning through the code, that seems to be the strongest possibility. If anyone has any insight, please share - I might end up just doing my own geocoding with a hook_nodeapi(), but I'm hoping that won't be necessary.
The Boise Drupal Guy!
Just to follow up this,
Just to follow up this, that's what I ended up doing - using Location with some hook_nodeapi() ugliness to do Geocoding and map display via Yahoo.
The Boise Drupal Guy!
The geocode module might help.
The Geo module can be used to store a Lat/Lon point in a CCK field, and provides views support for a variety of simple - to very complex - functions.
The Geocode module has a pluggable API for converting data from one format to another. Geocoding is kind of a misnomer, since it will convert from anything TO anything (not just geo data), provided a plugin accepts it.
The Geocode module also includes a CCK input widget for Geo's fields, which will geocode data from any other field. Thus, given that you've got both modules installed, your workflow could be:
2a. Use "Geocoded value from another field" as the formatter for your Geo field, and select your text field as the geocoding target.
This will also work with fields from the Postal module, but that doesn't sound like what you want.
Location
Just a quick note on this - Location is supposed to be the Drupal mapping and geolocation solution, and sure, includes fields for location information (including postal address). The module should be a lot stronger than it is, but it's already a monstrous codebase to look after and it's not getting any smaller.
For me, the maintainers of Location need help. I'm not sure how to facilitate this, or even if they're receptive, but it's the project furthest down the line to a complete solution.
Cck itself
Of course, cck itself can also be used to provide different text fields for addresses, without the need for an additional module.
choose term from taxonomy
Hi,
how can I add some field information to the "Geocoded value from another field" formatter?
I want to use taxonomy terms from a cck-taxonomy indeed.
Yours Andy