Skip to main content
Solved

Reprojecting raster tiles, output doubles in size


bjudes
Enthusiast
Forum|alt.badge.img+10

Hi,

 

I have a set of 250 raster tiles, I have reprojected them from ITM to WGS84, before reprojection each tile was 87,215KB. After reprojection the tiles are roughly 180,000KB. Why has this happened? My workbench is included here, I first mosaicked the tiles then reprojected and finally clipped back to the tile boundaries.

Thanks for any help.

 

B

Best answer by takashi

A possible reason is that the source raster data is compressed whereas the destination raster data is not compressed.

Check if the source raster data is compressed with some method. You can see the compression method in the Feature Information window of FME Data Inspector, if it was compressed.

e.g.

View original
Did this help you find an answer to your question?

26 replies

takashi
Contributor
  • Best Answer
  • March 13, 2019

A possible reason is that the source raster data is compressed whereas the destination raster data is not compressed.

Check if the source raster data is compressed with some method. You can see the compression method in the Feature Information window of FME Data Inspector, if it was compressed.

e.g.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 13, 2019
takashi wrote:

A possible reason is that the source raster data is compressed whereas the destination raster data is not compressed.

Check if the source raster data is compressed with some method. You can see the compression method in the Feature Information window of FME Data Inspector, if it was compressed.

e.g.

Hi Takashi,

 

Thanks for the help, the original does not appear to be compressed. See below. Would there be a stretch applied going to wgs84 that would cause the data to increase in size?

 

Thanks

B

 

 


takashi
Contributor
  • March 13, 2019
takashi wrote:

A possible reason is that the source raster data is compressed whereas the destination raster data is not compressed.

Check if the source raster data is compressed with some method. You can see the compression method in the Feature Information window of FME Data Inspector, if it was compressed.

e.g.

hmm, I cannot find any other reason.

Could you please post a screenshot of Feature Information about the resulting raster too? There could be a hint.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 13, 2019
takashi wrote:

hmm, I cannot find any other reason.

Could you please post a screenshot of Feature Information about the resulting raster too? There could be a hint.

Should have done that the first time. Thanks for the help.


takashi
Contributor
  • March 13, 2019
takashi wrote:

hmm, I cannot find any other reason.

Could you please post a screenshot of Feature Information about the resulting raster too? There could be a hint.

The raster interpretation has changed. Original was UINT8 but the result is UINT16. I think it's the direct reason why the file size increased approximately double.


takashi
Contributor
  • March 13, 2019
takashi wrote:

hmm, I cannot find any other reason.

Could you please post a screenshot of Feature Information about the resulting raster too? There could be a hint.

Try inserting the RasterPaletteResolver before the RasterMosaicker, and the RasterPaletteGenerator (Palette Key Interpretation Type: UInt8) before the destination writer feature type.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 13, 2019
takashi wrote:

Try inserting the RasterPaletteResolver before the RasterMosaicker, and the RasterPaletteGenerator (Palette Key Interpretation Type: UInt8) before the destination writer feature type.

Great stuff, thanks for the help. I will post the results when I get them.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 13, 2019
takashi wrote:

Try inserting the RasterPaletteResolver before the RasterMosaicker, and the RasterPaletteGenerator (Palette Key Interpretation Type: UInt8) before the destination writer feature type.

Hi Takashi, I've started the process again and the output is much closer to the original size. Thanks for the great help.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 19, 2019

@takashi, sorry to open this up again, I have encountered a problem with the output file. The reprojection has caused the tiles to have black edges.

I initially mosaicked the raster tiles together to try and avoid this and it worked with the larger output tiles, but since including the RasterPaletteResolver and the RasterPaletteGenerator I now have black edges and tiles that don't fit together. Please see image below.

Thanks

B


takashi
Contributor
  • March 19, 2019
bjudes wrote:

@takashi, sorry to open this up again, I have encountered a problem with the output file. The reprojection has caused the tiles to have black edges.

I initially mosaicked the raster tiles together to try and avoid this and it worked with the larger output tiles, but since including the RasterPaletteResolver and the RasterPaletteGenerator I now have black edges and tiles that don't fit together. Please see image below.

Thanks

B

If you can treat every pure black (0, 0, 0) cell as Nodata, set 0 to the Nodata with the RasterBandNodataSetter before the RasterMosaicker.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 19, 2019
takashi wrote:

If you can treat every pure black (0, 0, 0) cell as Nodata, set 0 to the Nodata with the RasterBandNodataSetter before the RasterMosaicker.

Thanks for the help. I tried this and the output came out the same. Seems strange.


takashi
Contributor
  • March 19, 2019
bjudes wrote:

@takashi, sorry to open this up again, I have encountered a problem with the output file. The reprojection has caused the tiles to have black edges.

I initially mosaicked the raster tiles together to try and avoid this and it worked with the larger output tiles, but since including the RasterPaletteResolver and the RasterPaletteGenerator I now have black edges and tiles that don't fit together. Please see image below.

Thanks

B

Well, how about setting Maximum to the Overlapping Values parameter in the RasterMosaicker?


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 19, 2019
takashi wrote:

Well, how about setting Maximum to the Overlapping Values parameter in the RasterMosaicker?

I am running this now, out of interest would you know why adding the two RasterPalette transformers has brought back the black outline?

Thanks for your help. I appreciate it.


takashi
Contributor
  • March 19, 2019
bjudes wrote:

@takashi, sorry to open this up again, I have encountered a problem with the output file. The reprojection has caused the tiles to have black edges.

I initially mosaicked the raster tiles together to try and avoid this and it worked with the larger output tiles, but since including the RasterPaletteResolver and the RasterPaletteGenerator I now have black edges and tiles that don't fit together. Please see image below.

Thanks

B

I guess that the black edges have been brought by reprojection, rather than the palette operations.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 19, 2019
takashi wrote:

I guess that the black edges have been brought by reprojection, rather than the palette operations.

But when I undertook this same process initially, there were no black edges (just the file sizes doubling). It was since the introduction of the palette operations the black edges appeared.


takashi
Contributor
  • March 19, 2019
bjudes wrote:

@takashi, sorry to open this up again, I have encountered a problem with the output file. The reprojection has caused the tiles to have black edges.

I initially mosaicked the raster tiles together to try and avoid this and it worked with the larger output tiles, but since including the RasterPaletteResolver and the RasterPaletteGenerator I now have black edges and tiles that don't fit together. Please see image below.

Thanks

B

Possibly reprojection caused Nodata outlines but the original palette definition didn't have the entry for representing the Nodata color.

What happens if you apply the RasterPaletteResolver before reprojection?


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 19, 2019

I've had the Palette Resolver before reprojection the whole time. I have attached a copy of the workbench below. Thanks

 

DISCOVERY_REPROJECT_NEW_WORKSTATION.fmw


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 19, 2019
takashi wrote:

Possibly reprojection caused Nodata outlines but the original palette definition didn't have the entry for representing the Nodata color.

What happens if you apply the RasterPaletteResolver before reprojection?

The Palette resolver has been before the reprojection throughout all the tests. I have attached a copy of the workspace below.

Setting the Overlapping Values to Maximum has not worked either.

DISCOVERY_REPROJECT_NEW_WORKSTATION.fmw


takashi
Contributor
  • March 19, 2019
bjudes wrote:

I've had the Palette Resolver before reprojection the whole time. I have attached a copy of the workbench below. Thanks

 

DISCOVERY_REPROJECT_NEW_WORKSTATION.fmw

Could you please share two tiff files adjoining each other, which reproduce the situation?


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 19, 2019
takashi wrote:

Could you please share two tiff files adjoining each other, which reproduce the situation?

I've uploaded the tiffs to google driver, link below. Thanks B

 

https://drive.google.com/drive/folders/18YosUVEowILL2tFkmC4k7tCLfq7yN0-s?usp=sharing


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 19, 2019
takashi wrote:

Could you please share two tiff files adjoining each other, which reproduce the situation?

I have setup the workbench with the RasterBandNoDataSetter just before the writer and it has removed the black data. I've only done it on the sample of the two tiles I sent to you above. I'm going to run a larger area, hopefully the results will be the same. Thanks so much for your help so far. B


takashi
Contributor
  • March 19, 2019
bjudes wrote:

I've had the Palette Resolver before reprojection the whole time. I have attached a copy of the workbench below. Thanks

 

DISCOVERY_REPROJECT_NEW_WORKSTATION.fmw

Try inserting a RasterBandNodataSetter (Nodata value: 0) between the RasterPaletteResolver and the RaterMosaicker.


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 20, 2019
takashi wrote:

Try inserting a RasterBandNodataSetter (Nodata value: 0) between the RasterPaletteResolver and the RaterMosaicker.

I seem to get the best output when I put the rasterbandnodatasetter before the writer. You have been a great help. Thanks B


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • March 25, 2019

@takashi Sorry I have another question. When I view the output tiles they look great in inspector/arcmap etc, but looking at them in windows explorer I still have the black tile edges (see below). How come this is occurring, is there a way to remove the black? Thank you very much for the help thus far.

 


takashi
Contributor
  • March 25, 2019
bjudes wrote:

@takashi Sorry I have another question. When I view the output tiles they look great in inspector/arcmap etc, but looking at them in windows explorer I still have the black tile edges (see below). How come this is occurring, is there a way to remove the black? Thank you very much for the help thus far.

 

It seems that Windows Explorer ignores Nodata definition. It's just a preview anyway, I don't think it would cause any practical issues on using the data.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings