Hi,
I need to load local raster file without any geo coordinates, i was able to load the file as raster layer and i see it at maps 0,0.
but the spacial reference is empty, can i somehow at runtime add spatial reference to the layer?
is there any other way to load raster file without spatial reference and show it on a map with spatial reference?
any advice would be apriciated even if its not a trivial or official solution
Thanks!
Solved! Go to Solution.
You'll need a couple of files to go with the local raster file. Some local raster formats embed this in the headers, but some need an accompanying file or two.
One file specifies the spatial reference. This is a .aux.xml file. See this gist for an example.
The other file specifies pixel to coordinate mapping. This is called the world file and you can read more about world files here, including what to name them. These are plain ASCII files with 6 values in that describe how a pixel in the image translates to a geographic coordinate:
The scale and offsets are in the spatial reference units of the spatial reference declared in the .aux.xml file.
Some people have successfully created these files on the fly in their Runtime apps, written them to disk alongside the image, and opened the image as a local raster. You probably don't need to ever modify the .aux.xml world file (the one in the gist is for Web Mercator Aux Sphere) and can just reuse it.
Hope this helps.
You'll need a couple of files to go with the local raster file. Some local raster formats embed this in the headers, but some need an accompanying file or two.
One file specifies the spatial reference. This is a .aux.xml file. See this gist for an example.
The other file specifies pixel to coordinate mapping. This is called the world file and you can read more about world files here, including what to name them. These are plain ASCII files with 6 values in that describe how a pixel in the image translates to a geographic coordinate:
The scale and offsets are in the spatial reference units of the spatial reference declared in the .aux.xml file.
Some people have successfully created these files on the fly in their Runtime apps, written them to disk alongside the image, and opened the image as a local raster. You probably don't need to ever modify the .aux.xml world file (the one in the gist is for Web Mercator Aux Sphere) and can just reuse it.
Hope this helps.
Many thanks!
only by adding the aux.xml file it solved my problem and added spatial reference, i dont want to show the raster file on real world map, i need it to be a stand alone layer but have spatial reference so i could project graphics on it.
Thanks again!
How can I create aux.xml file on the fly in ArcGIS Runtime?