Hi @jamiefinney, the RasterPropertyExtractor might help you. Check the _spacing_x, _spacing_y attributes which will be extracted by the transformer.
Hi @jamiefinney, the RasterPropertyExtractor might help you. Check the _spacing_x, _spacing_y attributes which will be extracted by the transformer.
@takashi Thank you for that i knew there had to be that function in there somewhere.
@takashi how would i transfer these values into an offsetter transformer.
i getting errors when i try to add this into my model
either that the offset variable isn't a float value - @Value(_spacing_x)/2
or that the raster is being routed through the model and causing an error as a raster can't be exported as a mapinfo tab file.
@takashi how would i transfer these values into an offsetter transformer.
i getting errors when i try to add this into my model
either that the offset variable isn't a float value - @Value(_spacing_x)/2
or that the raster is being routed through the model and causing an error as a raster can't be exported as a mapinfo tab file.
@jamiefinney, insert the RasterPropertyExtrastor between the reader and RasterCellCoercer, and set "Yes" to the "Preserve Attributes" parameter of the RasterCellCoercer.
@takashi how would i transfer these values into an offsetter transformer.
i getting errors when i try to add this into my model
either that the offset variable isn't a float value - @Value(_spacing_x)/2
or that the raster is being routed through the model and causing an error as a raster can't be exported as a mapinfo tab file.
You can also offset the raster before coercing.
You could use the RasterCellOriginSetter transformer, and set it to 0.5,0.5 - then the cell origin would be the centre of the cell and you wouldn't need the Offsetter.
So, just :
- RasterCellOriginSetter
- RasterCellCoercer
- AttributeCreator
- Tiler... etc
I think that would be the most appropriate way, and quicker too.
Hi @jamiefinney, the RasterPropertyExtractor might help you. Check the _spacing_x, _spacing_y attributes which will be extracted by the transformer.
Hi @jamiefinney, I answered straightly to your question - i.e. how to extract raster cell size. However, I agree with @Mark2AtSafe. The RasterCellOriginSetter would be the most efficient way, if you need to extract center points for each cell of an ASCII grid raster.
You could use the RasterCellOriginSetter transformer, and set it to 0.5,0.5 - then the cell origin would be the centre of the cell and you wouldn't need the Offsetter.
So, just :
- RasterCellOriginSetter
- RasterCellCoercer
- AttributeCreator
- Tiler... etc
I think that would be the most appropriate way, and quicker too.
This method has the added benefit that it works regardless of the original cell origin, whereas the offsetter method requires the ascii grid to be in the xllcorner instead of xllcenter format.
You could use the RasterCellOriginSetter transformer, and set it to 0.5,0.5 - then the cell origin would be the centre of the cell and you wouldn't need the Offsetter.
So, just :
- RasterCellOriginSetter
- RasterCellCoercer
- AttributeCreator
- Tiler... etc
I think that would be the most appropriate way, and quicker too.
@Mark2AtSafe good idea thanks for that - seems like a much more efficient way.