Ignore:
Timestamp:
2024-02-20T11:43:55+13:00 (4 months ago)
Author:
kjdon
Message:

field may be ex.Latitude, so use metaname (has had namespace removed) when testing if eq Latitude/Longitude. Note, haven't tested this

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/doc.pm

    r38357 r38753  
    12171217        if($value =~ m/^-/)
    12181218        {
    1219             $direction = ($field eq "Latitude") ? "S" : "W";
     1219            $direction = ($metaname eq "Latitude") ? "S" : "W";
    12201220        }
    12211221        else
    12221222        {
    1223             $direction = ($field eq "Latitude") ? "N" : "E";
     1223            $direction = ($metaname eq "Latitude") ? "N" : "E";
    12241224        }
    12251225       
     
    12271227        if(defined $beforeDec && defined $afterDec)
    12281228        {
    1229                     my $name = ($field eq "Latitude") ? "LatShort" : "LngShort";
     1229                    my $name = ($metaname eq "Latitude") ? "LatShort" : "LngShort";
    12301230                    # only do the following if we haven't already done it
    12311231                    if (!$self->contains_metadata_value($section, $name, $beforeDec . $direction)) {
     
    12431243            #Only add the metadata if it has not already been added
    12441244            my $metaMap = $self->get_metadata_hashmap($section); # metaMap not used and called function has no apparent side-effects,
    1245                                                                 # but this line appears important for ensuring uniqueness of (Latitude, value) meta
    1246                                                                 # in the section. Also for LatShort, Longitude, LngShort.
     1245                    # but this line appears important for ensuring uniqueness of (Latitude, value) meta
     1246                    # in the section. Also for LatShort, Longitude, LngShort.
    12471247        }
    12481248
     
    12501250        my $latitude;
    12511251        my $longitude;
    1252         if($field =~ m/^(.+\.)?Longitude$/) {
     1252        if($metaname eq "Longitude") {
    12531253            # if we are dealing with Longitude meta, and we have already seen Latitude, then add Coordinate metadata
    12541254            $latitude = $self->get_metadata_element ($section, "Latitude");
Note: See TracChangeset for help on using the changeset viewer.