
    nj                         S SK r S SKJrJr  S r\ R
                  4S jr\S:X  a#  \ R                  " \" \ R
                  5      5        gg)    N)gdalosrc                      [        S5        [        S5        [        S5        [        S5        [        S5        [        S5        [        S5        g)N z>Read coordinate system and geotransformation matrix from inputz=file and report latitude/longitude coordinates for the centerzof the specified pixel.z%Usage: tolatlong.py pixel line infile   )print     Y/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/osgeo_utils/samples/tolatlong.pyUsager   )   s>    	"I	
JK	
IJ	
#$	"I	
12	"Ir
   c           
         S nS nS nSnU[        U 5      :  aH  X   nUc  [        U5      nOUc  [        U5      nOUc  UnO
[        5       $ US-   nU[        U 5      :  a  MH  Uc
  [        5       $ Uc
  [        5       $ Uc
  [        5       $ [        R                  " U[        R
                  5      nUR                  5       nUS   US   U-  -   US   U-  -   nUS   US   U-  -   US   U-  -   n	XS   S-  -  nXS   S-  -  n	[        R                  " 5       n
U
R                  UR                  5       5      S:w  a  [        SUR                  5       -  5        gU
R                  5       n[        R                  " X5      nUR                  X5      u  pn[        S	X#4-  5        [        S
X4-  5        [        S[        R                  " USS5      < S[        R                  " USS5      < 35        g)N   r   r            g       @z$ERROR: Cannot import projection '%s'zpixel: %g			line: %gzlatitude: %fd		longitude: %fdz
latitude: Latz		longitude: Long)lenfloatr   r   OpenGA_ReadOnlyGetGeoTransformr   SpatialReferenceImportFromWktGetProjectionr   CloneGeogCSCoordinateTransformationTransformPointDecToDMS)argvinfilepixellineiarg	indataset	geomatrixXYsrs
srsLatLongctlonlatheights                   r   mainr0   4   s   FED
 	
A
c$i-g=#JE\:D^F 7NE c$i-" ~w}w|w 		&$"2"23I ))+I!y|e++ilT.AAA!y|e++ilT.AAA 1	A1	A 


 C
0023q84y7N7N7PPQ"J		%	%c	6B**10Sv 

#um
34	
+sj
89	==eQ'sFA)F	H
 r
   __main__)	sysosgeor   r   r   r    r0   __name__exitr	   r
   r   <module>r6      sF   D  
 hh @F zHHT#((^ r
   