Skip to main content

Simple need, simple question.

I have a raster with 1 cell size 25x25 meters (geotiff)

Just want to have the cell split up to a 5x5 meters raster with having those new 25 cells with a 5x5 meters raster having the same value as the original 1 cell of 25x25 meters

And nothing else should change! But whatever Transformer I use or in combination with each other, it doesn't let me succeed in my goal.

For example: with the RasterResampler it recreates a new raster with my desired resolution, but it doesn't keep the original values. It also seems to shift my raster.

 

I have also tried to create a new raster and then use the points from that raster to extract the desired values. But that takes so much time to process...

 

 

What am I missing? What do I not understand?

One thing can mess the RasterResampler, that is having some projection and/or coordinate system attached to the raster. In my case, it was an XML file containing the details.

So having no file attached, but with a bare GeoTIFF file (containing a coordinate system) I have tried it again, but it's still not working as expected...


A RasterResampler with the Interpolation Type set to Nearest Neighbour should do what you want.

 

 

If it's not working in your projected data, you can use a BoundsExtractor, remove the the georeferencing information (RasterGeoreferencer (0,0,1,1,0), CoordinateSystemRemover , and then resample from 1 to 0.2, and the use the another RasterGeoreferencer in Extents mode with the values from the BoundsExtractor to restore the original position. CoodinateSystemSetter set the projection.

A RasterResampler with the Interpolation Type set to Nearest Neighbour should do what you want.

 

 

If it's not working in your projected data, you can use a BoundsExtractor, remove the the georeferencing information (RasterGeoreferencer (0,0,1,1,0), CoordinateSystemRemover , and then resample from 1 to 0.2, and the use the another RasterGeoreferencer in Extents mode with the values from the BoundsExtractor to restore the original position. CoodinateSystemSetter set the projection.

Thanks @jdh for your response!

It makes sense to do so. Unfortunately, I still have those weird shifting results. Can't figure it out...

 


Thanks @jdh for your response!

It makes sense to do so. Unfortunately, I still have those weird shifting results. Can't figure it out...

 

What kind of shifting is going on?


What kind of shifting is going on?

Well, it seems that overall the raster is shifting in the direction of the arrow.

Tried to correct that in earlier versions of my workspace with the RasterCellOriginSetter , unfortunately without success.

 


Well, it seems that overall the raster is shifting in the direction of the arrow.

Tried to correct that in earlier versions of my workspace with the RasterCellOriginSetter , unfortunately without success.

 

Is it half a pixel? Or is it a rounding error? If you are using a format with a world file, FME might truncate the precision.


Is it half a pixel? Or is it a rounding error? If you are using a format with a world file, FME might truncate the precision.

It's a shift of about 5 meters

 

No, I have no world file or so attached, it's in the GeoTiff

 

 


Is it half a pixel? Or is it a rounding error? If you are using a format with a world file, FME might truncate the precision.

I you like, I can send the GeoTiff to you :-)


Is it half a pixel? Or is it a rounding error? If you are using a format with a world file, FME might truncate the precision.

So, when I add the RasterCellCoercer and visually compare the points with the raster, you'll see this: the points are not aligned with the raster itself. That has somehow to do with the projection I use.

Can't get it right.

Very frustrating.

 


So, when I add the RasterCellCoercer and visually compare the points with the raster, you'll see this: the points are not aligned with the raster itself. That has somehow to do with the projection I use.

Can't get it right.

Very frustrating.

 

Is there a rotation on the raster?


Is there a rotation on the raster?

No, unfortunately not

Hereby you see the properties from the raster


No, unfortunately not

Hereby you see the properties from the raster

I'm not familiar with the Amersfoort projection. If you remove the coordinate system from the original raster, then resample, do the two rasters line up in the inspector (if the rasters are large, I often just use a boundingboxreplacer to get the footprint in the inspector)

 


I'm not familiar with the Amersfoort projection. If you remove the coordinate system from the original raster, then resample, do the two rasters line up in the inspector (if the rasters are large, I often just use a boundingboxreplacer to get the footprint in the inspector)

 

Well, I'll have a look at it... at the moment I'm accepting the issue as is. Just to see how my workspace overall works... it's time to have that tested first (because of a deadline 😉 )

 

 

I will get back on this issue, asap. Want to understand what's going on...

 

Thanks @jdh for your support till now!

Reply