Smart M.App discussions

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Occasional Contributor
Posts: 8
Registered: ‎09-05-2016

Subsetting of image messes up georeferencing? (BUG?)

[ Edited ]

[The link isn't very clear, here it is again:!AqdeeCd4PdkzjCIduTkMw_ednoAM ]




I'm currently having an issue with clipping an image, no matter what I've tried the images seem to appear at the wrong coordinates, it was happening in my custom app, but during testing I've used the sample named "Subset Imagery Using Features" which does what I'm trying to achieve with the same results.


I've tried two different coordinates systems for the input images: EPSG:28355 (most accurate for my geographical area, so most of our data is in this coordinate system) and EPSG:3857 which is the defacto standard for web enabled mapping, in an attempt to elliminate any reprojection in the publishing process from the equation.


To demonstrate the issue I've linked to the input files I'm using and you can simply use the "Subset Image Using Features" to see the issue:

  1. Load the "Subset Image Using Features" and click "preview app"
  2. Select the file "paddocks-new.shp" for the "Input Geometry".
  3. Select the file "event1_cyrilsbank.tif" for "Input Image".
  4. Enter "test.img" for the "Subset Filename" output.
  5. Enter "ID=1" for the "Attribute Query"
  6. Click OK.


Both behave incorrectly, the first  moves from the southern hemishpere into the ocean somewhere in the northern hemisphere the second is less drastic but still moves by approx. 50 km south west of the original image. I've tried fiddling with the "Define Processing Area" operator to force the CRS to be set to the correct one, but the results are similar, the resulting images appear in the incorrect place.


When I publish the results I can't get them to line up. Here are screenshots that I've zoomed a bit to show the incorrect and correct location:


Firstly where the subset should appear, the input image preview:

 Secondly here is what I get from the "test.img" preview:

 Clearly something has gone wrong with coordinate transforms. In order to debug, I exported the spatial recipe into Imagine and ran the process, then overlaid the resulting rasters in a 2D View: it works as expected! Note that I've changed the contrast of the larger input image to make the overlaying of the output images position clear.


So it appears there is a bug somewhere in the system of publishing/processing?


 I'm having the same trouble with my own custom written spatial recipe, thus far I haven't been able to find a viable workaround. 


Does anyone know what could be going on here?






Staff inactive
Posts: 57
Registered: ‎10-12-2015

Re: Subsetting of image messes up georeferencing? (BUG?)

Is the subset image in the same coordinates as the original image at the end of the process?  What is the original image (TIFF, JPG, ?) and what format is the output subset?

Occasional Contributor
Posts: 8
Registered: ‎09-05-2016

Re: Subsetting of image messes up georeferencing? (BUG?)

[ Edited ]

In input image is a GeoTIFF georeferenced in EPSG:28355 coordinates, the output image is an IMG file in the same coordinate system. The feature file input is, I think, lat long (will check). There is a link to a OneDrive folder to the actual images themselves in the OP, although it is mostly invisible due to unfortunate default colors, here it is again!AqdeeCd4PdkzjCIduTkMw_ednoAM