File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11repos :
22- repo : https://github.com/pycqa/isort
3- rev : 7 .0.0
3+ rev : 9 .0.0a3
44 hooks :
55 - id : isort
66 args : ["--profile", "black"]
77- repo : https://github.com/ambv/black
8- rev : 24.4.0
8+ rev : 26.3.1
99 hooks :
1010 - id : black
1111- repo : https://github.com/pycqa/flake8
12- rev : ' 7.0 .0'
12+ rev : ' 7.3 .0'
1313 hooks :
1414 - id : flake8
1515 exclude : (tests)
1616 additional_dependencies : [
1717 ' flake8-docstrings' ,
1818 ' flake8-builtins' ,
19- ' flake8-rst-docstrings' ,
20- ' pygments' ,
2119 ' pep8-naming'
2220 ]
2321- repo : local
Original file line number Diff line number Diff line change @@ -250,3 +250,18 @@ def create_metadata_csv(imagery_path: str) -> None: # noqa: D301
250250 )
251251
252252 logger .info ("Metadata csv saved at: %s" , metadata_csv )
253+
254+
255+ @cli .command ()
256+ @click .argument ("imagery_path" , required = True )
257+ def get_xmp (imagery_path : str ) -> None :
258+ """Parse the raw XMP metadata."""
259+ for key , value in MetadataParser (imagery_path ).xmp_data .items ():
260+ print (f"{ key } : { value } " )
261+
262+
263+ @cli .command ()
264+ @click .argument ("imagery_path" )
265+ def get_altitude_source (imagery_path : str ) -> None :
266+ """Parse the source of the altitude data."""
267+ print ("Altitude source:" , MetadataParser (imagery_path ).altitude_source ())
Original file line number Diff line number Diff line change @@ -476,6 +476,15 @@ def gsd(
476476
477477 return alt / focal_length
478478
479+ def altitude_source (self ) -> str :
480+ """Get the source of the altitude data."""
481+ try :
482+ return str (self .xmp_data [self .xmp_tags .ALTITUDE_SOURCE ])
483+ except KeyError :
484+ raise ParsingError (
485+ "Couldn't parse altitude source. Sensor might not be supported"
486+ )
487+
479488 def autoexposure (self ) -> float :
480489 """
481490 Get the autoexposure value of the sensor when the image was taken.
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class XMPTags:
3232 X_ACCURACY_M : str = ""
3333 Y_ACCURACY_M : str = ""
3434 Z_ACCURACY_M : str = ""
35+ ALTITUDE_SOURCE : str = ""
3536
3637
3738class SenteraTags (XMPTags ):
@@ -53,6 +54,7 @@ class SenteraTags(XMPTags):
5354 X_ACCURACY_M : str = "Camera:GPSXYAccuracy"
5455 Y_ACCURACY_M : str = "Camera:GPSXYAccuracy"
5556 Z_ACCURACY_M : str = "Camera:GPSZAccuracy"
57+ ALTITUDE_SOURCE : str = "Sentera:AboveGroundAltitudeSource"
5658
5759
5860class DJITags (XMPTags ):
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ namespace_packages = True
44explicit_package_bases = True
55scripts_are_modules = True
66strict = True
7+ warn_unused_ignores = False
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " imgparse"
3- version = " 2.0.11 "
3+ version = " 2.0.12 "
44description = " Python image-metadata-parser utilities"
55authors = []
66include = [
You can’t perform that action at this time.
0 commit comments