Changeset 34276 for main/trunk
- Timestamp:
- 2020-07-21T14:09:10+12:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/doc.pm
r34105 r34276 1161 1161 1162 1162 my $direction; 1163 # TODO does the following work, with eq latitude? the above code implies can be xxxxx.Latitude. should use metaname?? 1163 1164 if($value =~ m/^-/) 1164 1165 { … … 1183 1184 } 1184 1185 } 1185 1186 1187 # what is this???? completely does nothing... 1186 1188 #Only add the metadata if it has not already been added 1187 1189 my $metaMap = $self->get_metadata_hashmap($section); # metaMap not used and called function has no apparent side-effects, … … 1189 1191 # in the section. Also for LatShort, Longitude, LngShort. 1190 1192 } 1193 1194 # if we have both Latitude and Longitude, then add coordinate metadata (not sure why, but someone else added it) 1195 my $latitude; 1196 my $longitude; 1197 if($field =~ m/^(.+\.)?Longitude$/) { 1198 # if we are dealing with Longitude meta, and we have already seen Latitude, then add Coordinate metadata 1199 $latitude = $self->get_metadata_element ($section, "Latitude"); 1200 if (defined $latitude) { 1201 $longitude = $value; 1202 } 1203 } else { 1204 # we are dealing with Latitude - if we have already seen Longitude, then add both as Coordinate metadata 1205 $longitude = $self->get_metadata_element ($section, "Longitude"); 1206 if (defined $longitude) { 1207 $latitude = $value; 1208 } 1209 } 1210 if (defined $latitude && defined $longitude) { 1211 ##rint STDERR "adding coords for $section, $latitude, $longitude\n"; 1212 $self->processCoordinate($section, $latitude, $longitude); 1213 } else { 1214 ##rint STDERR "lat or long not defined, not adding coords for $section\n"; 1215 } 1191 1216 1192 if($field =~ m/^(.+\.)?Longitude$/) {1193 # if we are dealing with Longitude meta, we should 1. have Latitude meta too; 2. already have processed Latitude meta1194 # in that case, add both Lat and Lng of this section as a Coordinate meta1195 my $latitude = $self->get_metadata_element ($section, "Latitude");1196 my $longitude = $value;1197 # TODO: would like all Longitude meta placed together, followed by all Coordinate meta,1198 # but the following will add all such coord meta to the doc object and the end of this function will add Longitude meta1199 $self->processCoordinate($section, $latitude, $longitude);1200 }1201 1217 } 1202 1218
Note:
See TracChangeset
for help on using the changeset viewer.