Hexagon Geospatial
MENU

Support ERDAS IMAGINE

Discuss and share topics of interest using ERDAS IMAGINE the world’s leading geospatial data authoring system.
Showing results for 
Search instead for 
Do you mean 
Reply
Regular Contributor
Posts: 198
Registered: ‎10-12-2015
Accepted Solution

Spatial model - Adding projection to input image

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

  • Input raster (with source PNG)
  • Feed input raster into Raster Information
    • Feed 'Boundary' output into Modify dictionary item 
      • CRS dictionary item
      • Input CRS ID of desired projection
        • Resulting Output Boundary item seems good

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:

 

HowToAddCRSToInputRaster.png


Thanks

Staff
Posts: 85
Registered: ‎07-04-2016

Re: Spatial model - Adding projection to input image

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. 

 

2017-11-14 09_47_40-Define Processing Area.png

 

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. 

2017-11-14 09_49_06-Untitled_1 - ERDAS IMAGINE 2016.png

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Frequent Contributor
Posts: 141
Registered: ‎11-16-2015

Re: Spatial model - Adding projection to input image

Gah! Two seconds before I posted the model! Ah well, here it is anyway...

Regular Contributor
Posts: 198
Registered: ‎10-12-2015

Re: Spatial model - Adding projection to input image

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:
OutputWithoutDefineProcessingArea.png
If I output using the Define Processing Area I get a different output:
OutputUsingDefineProcessingArea.png

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.
MetadataTifTags.png

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.

Regular Contributor
Posts: 198
Registered: ‎10-12-2015

Re: Spatial model - Adding projection to input image

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.

DefineProcessingArea_GridRule-SameAsInput-NoCoord.png

Frequent Contributor
Posts: 141
Registered: ‎11-16-2015

Re: Spatial model - Adding projection to input image

[ Edited ]

Can you upload a tile for us to play with please? <gah, already done it!>

Frequent Contributor
Posts: 152
Registered: ‎10-27-2015

Re: Spatial model - Adding projection to input image

[ Edited ]

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

Highlighted
Frequent Contributor
Posts: 141
Registered: ‎11-16-2015

Re: Spatial model - Adding projection to input image

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...

Staff
Posts: 85
Registered: ‎07-04-2016

Re: Spatial model - Adding projection to input image

Dear ShaunF,

 

Transfering the attributes of your input image to the output will help. You can do it with the following model:

 

2017-11-15 09_27_42-Untitled_1 - ERDAS IMAGINE 2016.png

 

It will transfer colors as well as change Opacity of the first row in a table to 0. 

 

Attached model as well.

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Frequent Contributor
Posts: 152
Registered: ‎10-27-2015

Re: Spatial model - Adding projection to input image

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.

 

 map_model.JPG

 

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.