11-14-2017 10:35 PM
I have input .png file with world file .pgw defining location.
No projection defined for the source PNG.
I am using an spatial model to go from input png to output GeoTif (working, but no projection on output tif).
I can't work out how to define the projection during the process.
So far I have
I don't know how to take the boundary item with the added CRS and add it back into the input raster. Model I have so far:
Solved! Go to Solution.
11-14-2017 01:03 AM
To add/change CRS of your raster image you should use the Define Processing Area (DPA) operator. Double click on the DPA operator and as CRS Rule pick Specify.
Then you can directly specify CRS within DPA operator. Or if you got CRS from running some operations, so connect it with a CRS port of DPA operator.
11-14-2017 02:57 PM
Thanks Marina and Johnnie,
Unfortunetly we can't get Define Processing Area to behave.
If I output without the Define Processing Area I get a tif which looks the same as the source PNG file:
If I output using the Define Processing Area I get a different output:
So looks like Define Processing Area changes the colour table or similar.
If I load the output images into Imagine and look at the metadata tif tags I can observe difference.
Note: the input PNG is an 8bit thematic. Example attached.
We also observe if process an PNG with transparent background using Define Processing Area then the background becomes black and the linework changes colour from green to shade of grey.
11-15-2017 04:08 PM
Colleague noticed that could change 'Define Processing Area' grid rule to 'Same as Input' and would get the right image out. However doing that disables the CRS assignment so back to square one - no coord system in output image.
11-15-2017 12:34 AM - edited 11-15-2017 12:36 AM
Turn one input file to .img to see does that makes difference. That is pretty typical that some things works well with native format but fails if format is changed to something else.
Another test is that define projection for input file using Imagine first before feeding it to modeller as now it seems that you have used just world file and Imagine stores bit more information using the .aux files. So it could be that part of projection info needed by modeller is missing though .pgw world file exist
I know these will not fix your original issue if goal is to automate process for large amount of .png files but hopefully this gives you more ideas to proceed.
Also worth of testing the "CoordinateReferenceSystemID" to force projection to something during the process. I slightly dislike this Processing Parameters approach as it is not very definitive and simple but rather more like odd setting set somewhere else.
I am not an expert of this excact topic - just throwing ideas based on my long experience with spatial modeller where I would try first
11-15-2017 12:43 AM
Transfering the attributes of your input image to the output will help. You can do it with the following model:
It will transfer colors as well as change Opacity of the first row in a table to 0.
Attached model as well.
11-15-2017 12:48 AM
Just like Johnnie said - operator that forces map model and projection used in Spatial Modeller to something user wants is needed. Kind of same tool as Edit Image Metadata does in Imagine normal GUI.