You can configure a geocode property and add a Perl manipulator to the pipeline if necessary.
Use Developer Studio’s Property editor to configure a geocode property for record sort. In the Property editor, the "Prepare sort offline" checkbox enables record sorting on the property.
Dgidx accepts geocode data in the form:
latvalue,lonvalue
where each is a double-precision floating-point value:
latvalue is the latitude of the location in whole and fractional degrees. Positive values indicate north latitude and negative values indicate south latitude.
lonvalue is the longitude of the location in whole and fractional degrees. Positive values indicate east longitude, and negative values indicate west longitude.
For example, Oracle Commerce’s main office is located at 42.365615 north latitude, 71.075647 west longitude. This geocode should be supplied to Dgidx as:
42.365615,-71.075647
If the input data is not available in this format, it can be assembled from separate properties with a Perl manipulator created in Developer Studio. The Method Override editor would have the following Perl code:
#Get the next record from the first record source. my $rec = $this->record_sources(0)->next_record; return undef unless $rec; #Return an array of property values from the record. my @pvals = @{$rec->pvals}; #Return the value of the Latitude property. my @lat = grep {$_->name eq "Latitude"} @{$rec->pvals}; #Return the value of the Longitude property. my @long = grep {$_->name eq "Longitude"} @{$rec->pvals}; #Exit if there is more than one Latitude property. if (scalar (@lat) !=1) { die("Perl Manipulator ", $this->name, " must have exactly one Latitude property."); } #Exit if there is more than one Longitude property. if (scalar (@long) !=1) { die("Perl Manipulator ", $this->name, " must have exactly one Longitude property."); } #Concatenate Latitude and Longitude into Location. my $loc = $lat[0]->value . "," . $long[0]->value; #Add new Location property to record. my $pval = new EDF::PVal("Location", $loc); $rec->add_pvals($pval); return $rec;