How images are inserted with correct georeferencing while they have no auxiliary files,

474
8
Jump to solution
03-30-2020 05:10 AM
JamalNUMAN
Esteemed Contributor

How images are inserted with correct georeferencing while they have no auxiliary files,

 

I observed that images are inserted with correct georeferencing while they have no auxiliary files.

 

I was assuming that there should be some uxiliary files in order to get images placed in their correct positions

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hey Jamal,

TIF files can have an internal header that will store the coordinate and projection information. 

View solution in original post

8 Replies
JakeSkinner
Esri Esteemed Contributor

Hey Jamal,

TIF files can have an internal header that will store the coordinate and projection information. 

JamalNUMAN
Esteemed Contributor

 

Thanks Jake.

 

If this is possible for tif format, then why georeferencing an image with tif type still needs auxiliary files in order to get placed in the correct position?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
DanPatterson_Retired
MVP Esteemed Contributor

You missed Jake's point... they "can" have their georeferencing builtin, but some don't, hence your aux files

TIFF files are the best choice for importing into image editing applications and are also a common GIS raster data format. However, they cannot be natively viewed by a web browser. TIFFs also support georeferencing information in GeoTIFF tags or in a separate world file for use as raster data.

some options when exporting them

Write world file

In the same location as the exported map, generate a separate world file that contains georeference information. This allows the exported image to be used as raster data in ArcGIS Pro or other GIS applications.

Write GeoTIFF tags

Add GeoTIFF information directly to the TIF header. This allows the exported image to be used as raster data in ArcGIS Pro or other GIS applications.

There are many other links in the help regarding tiffs depending where they are coming from or how they got there (eg las data) and whether you want to use them as raster data sources etc

JamalNUMAN
Esteemed Contributor

Not sure, Dan, where can I find an option to get the tif files georeferenced without the need of auxiliary files while exporting!

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
DanPatterson_Retired
MVP Esteemed Contributor

raster to other format

in the environments tab, don't build pyramids or statistics

export to tif

delete the tfw and the other files keeping the tif.

open the tif file in a text editor, for the most part it will be binary, but the spatial reference information is inside

If you want it to never create anything other than the tif... you can code the deletion above or use imagery software

Just use the tif

works for me

more reading

World files for raster datasets—ArcGIS Pro | Documentation 

Introduction to exporting a map or layout—ArcGIS Pro | Documentation 

TIFF (Tagged Image File Format)

TIFF files are the best choice for importing into image editing applications and are also a common GIS raster data format. However, they cannot be natively viewed by a web browser. TIFFs also support georeferencing information in GeoTIFF tags or in a separate world file for use as raster data.

JamalNUMAN
Esteemed Contributor

Thanks Dan,

 

I observed that the world file is embedded in the tiff file. I just deleted all the auxiliary files and found out it is still located in the right place

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
DanPatterson_Retired
MVP Esteemed Contributor

Glad I could help!

JamalNUMAN
Esteemed Contributor

The “Export Raster World File” tool can create world files for the tif tiles and then these tif tiles can be shifted based on a code from python script

 

---------

 

import os
import arcpy
import string


Folder_Path = arcpy.GetParameterAsText(0)

for file in os.listdir(Folder_Path):
if file.endswith(".tfw"):
print(os.path.join(Folder_Path, file))
with open(os.path.join(Folder_Path, file), 'r') as f:
lines = f.readlines()
f.close()

before_last_line = lines[-2]
before_last_line2 = float(before_last_line) - 50000
last_line = lines[-1]
last_line2 = float(last_line) - 500000
lines[-2] = before_last_line2
lines[-1] = last_line2
num_lines = sum(1 for line in open(os.path.join(Folder_Path, file)))
print (num_lines)

for x in range(num_lines):
print( lines[x])


with open( os.path.join(Folder_Path, file),'w') as o :
for x in range(num_lines):
o.write(str(lines[x]) +'\n')
o.close()


for file in os.listdir(Folder_Path):
if file.endswith(".tif"):
print(os.path.join(Folder_Path, file))
arcpy.DefineProjection_management(in_dataset=os.path.join(Folder_Path, file), coor_system="PROJCS['Palestine_1923_Palestine_Grid',GEOGCS['GCS_Palestine_1923',DATUM['D_Palestine_1923',SPHEROID['Clarke_1880_Benoit',6378300.789,293.4663155389802]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Cassini'],PARAMETER['False_Easting',170251.555],PARAMETER['False_Northing',126867.909],PARAMETER['Central_Meridian',35.21208055555556],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',31.73409694444445],UNIT['Meter',1.0]]")


------------------------

 

Clip_1469.jpgClip_1470.jpgClip_1471.jpg

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
0 Kudos