11-13-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:
Thanks
Solved! Go to Solution.
11-14-2017 01:03 AM
Dear ShaunF,
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 01:06 AM
Gah! Two seconds before I posted the model! Ah well, here it is anyway...
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-14-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:31 AM - edited 11-15-2017 12:32 AM
Can you upload a tile for us to play with please? <gah, already done it!>
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:40 AM
I dislike the coordinate system being in processing parameters as well! I'm off to make a suggestion to split this out to a seperate operator...
11-15-2017 12:43 AM
Dear ShaunF,
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.