tballison commented on code in PR #2938:
URL: https://github.com/apache/tika/pull/2938#discussion_r3558252595
##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-audiovideo-module/src/main/java/org/apache/tika/parser/mp4/TikaMp4BoxHandler.java:
##########
@@ -186,12 +183,12 @@ private void processQuickTimeItemList(@Nullable byte[]
payload) {
* the raw value, so QuickTime location matches the {@code geo:*} output
of the udta path.
*/
private void addLocation(String iso6709) {
- Matcher matcher = ISO6709_PATTERN.matcher(iso6709);
- if (matcher.find()) {
- tikaMetadata.set(TikaCoreProperties.LATITUDE,
Double.parseDouble(matcher.group(1)));
- tikaMetadata.set(TikaCoreProperties.LONGITUDE,
Double.parseDouble(matcher.group(2)));
- if (matcher.group(3) != null) {
- tikaMetadata.set(TikaCoreProperties.ALTITUDE,
Double.parseDouble(matcher.group(3)));
+ ISO6709.Location location = ISO6709.parse(iso6709);
+ if (location != null) {
+ tikaMetadata.set(TikaCoreProperties.LATITUDE, location.latitude);
+ tikaMetadata.set(TikaCoreProperties.LONGITUDE, location.longitude);
+ if (location.altitude != null) {
+ tikaMetadata.set(TikaCoreProperties.ALTITUDE,
location.altitude);
}
Review Comment:
Y, not clear for coupling reasons? Definitely a separate issue and ticket.
As long as altitude is optional, I think this makes a bunch of sense. wdyt?
This would allow us to have arrays of points rather than parallel arrays, which
would be so much better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]