I would like to take info from multiple fields, pull it all together, geocode it... done.

For example:
Address field
City field
State field
zip code field

Geocode pulls all this info together and can spit out 1 location.

This would allow it to be sorted in views easily.

Comments

that0n3guy’s picture

AND/OR... just integrate with address module: http://drupal.org/project/addresses

that0n3guy’s picture

StatusFileSize
new4.57 KB
new11.85 KB
new6.1 KB
new8.65 KB
new11.83 KB

Ok... so just realized what the text field is for... it can output data (city/state/etc...) from separate field.

This should be able to help sort nodes with views except.... its not working. Maybe I'm being stupid.

Here is what I have:

Content type with 3 cck fields - http://drupal.org/files/content_type.png
-hydrant_address - just a plain text field
-city - text field - geocoded field from hydrant address - http://drupal.org/files/city_field.png
-map - Geospatial data - geocoded from field from hydrant address - http://drupal.org/files/map_field.png

The result... the 'map' field works good, but the 'city' text field does not: http://drupal.org/files/output_no_city.png

here are my display settings: http://drupal.org/files/issues/content_type_display.png ... I tried it set to plain text instead of default.

Also, I'm not getting any info in views at these fields...

I can get this map to show nicely with the openlayers module. Am I being crazy... or is this the way its supposed to work.

p.s. I am using cvs head from today 8-21-09

gagarine’s picture

Now geocode try to "localize" each text field selected as "localisable" in the geocode widget but don't concatenate any fields. The stored value are from the first field with a return from googleAPI.

Would be realy cool to have an interface like that:

------

#Field Country
geocodable [x]
Is a : [country (concatenated with the oder fields)]
Geocode handler : [google api]
Return value : [point]

#Field City
geocodable [x]
Is a : [city (concatenated with the oder fields)]
Geocode handler : [google api]
Return value : [point]

#Field Addresse
geocodable [x]
Is a : [addresse (concatenated with the oder fields)]
Geocode handler : [google api]
Return value : [point]

------

Where "Is a : [xxxxx]" is a drop box with the choices "adresse, city, country, npa, ..." and "free format"

At least it would be better to concatenate all fields..

gagarine’s picture

A quick&dirty "solution":
- create a textarea
- hid this textarea
- add the value from the others fields with JS in the textarea (!)

The JS if that's can help some poeple

/*Compute address into one texfield so geocode can use it (yes durty)*/
	function computedAddress(){
		$("#node-form").submit(function() {
		 	if($("#edit-field-computed-address-0-value").length){
				$('#edit-field-property-country-0-value').attr("disabled", false);
				//compute!
				var concatenedAddress = '';
				$("#node-form fieldset.group-address input").each(function(){
					if($(this).val() != ''){
						concatenedAddress += $(this).val() + ', ';
					}
				});
				$("input#edit-field-computed-address-0-value").val(concatenedAddress);
			}
			return true;
		    });
	}
gagarine’s picture

Mmmh i try with http://drupal.org/project/computed_field but that's don't work :/ (i add computed as a type handlable by geocode and return a value with "presave" on computed without success)

allie micka’s picture

Status: Active » Closed (works as designed)

Why not use the Postal module? Geocode has built-in support for that.

gagarine’s picture

Postal is not stable enough when I start the project and with usage statistic at 0 I have no enough guaranty if this project continue or not so I have preferred standard CCK fields instead of postal.

Anyway everything work now so I can publish the website in 1 or 2 weeks, I hop this is a good example of what we can do with geo :). I promises you also some documentations for end-user I do that this month certainly.

I will try postal soon and report some bugs..

EDIT: But it's hard to change this, I'm sure in other situations it would be cool to take data for more than one field.

muschpusch’s picture

Postal is nice but doesn't support any form of bulk import (i checked feedApi, node import and feeds). When it's not possible to use a combination of different CCK fields for geocode there are no possibilities to bulk import data.