span8
span4
span8
span4
i want to off set a raster by half cell size in XY so points created from it will be at the pixel center rather than the lower left hand corner.How can i expose these values so they don't have to be manually typed in?
the import format is ASCII grid so the information is right there in the header
ncols 200
nrows 200
xllcorner 220000
yllcorner 70000
cellsize 50
Hi@jamiefinney,the RasterPropertyExtractor might help you.Check the _spacing_x,_spacing_y attributes which will be extracted by the transformer.
@takashiThank you for that i knew there had to be that function in there somewhere.
Hi@jamiefinney,I answered straightly to your question - i.e.how to extract raster cell size.However,I agree with@Mark2At亚搏在线Safe.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 :
I think that would be the most appropriate way,and quicker too.
@Mark2At亚搏在线Safegood idea thanks for that - seems like a much more efficient way.
@takashihow 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.
© 2019 亚搏在线Safe Software Inc |Legal