Take the 2-minute tour ×

I currently have a project where I rasterize shapefiles into simple presence/absence (1 & 0) rasters and then add each one to a running total to create a total richness raster at the end. The shapefiles are in WGS84 projection, but I need the final raster to be in Behrmann Equal Area projection.

What I want to know is if there is any difference in the final raster if I project all the shapefiles to Behrmann and then rasterize and merge each of them compared to rasterizing and merging, then projecting the final raster to Behrmann at the end?

Kind regards,

share|improve this question
Thanks for the information guys. I have settled on projecting the vectors prior to rasterization. –  JPD Oct 5 '12 at 10:46

1 Answer 1

up vote 4 down vote accepted

The short answer is: all things being equal, rasterize then transform.

The long answer depends on several factors:

  • The size of the feature
  • The allowable error
  • Whether the CRSes agree in conformality and to what degree
  • Which ellipsoid and datum are used
  • Processing time constraints

The problem is that straight lines in one CRS won't necessarily be straight in another - unless they're both conformal - so transforming a line segment will position its end points accurately, but no new points will be added in between, so the line as a whole won't be accurate.

In your case, if you transform then rasterize, and the features are smallish in size, generally covering less that a square kilometre or so, there will be no appreciable error at any reasonable resolution of raster. But as you head towards the poles, or as your features get bigger, you'll notice greater error. So there will come a point at which the accuracy of your source data is better than the accuracy of your projected data - your allowable error.

Computationally it's generally quicker to transform vector data before rasterizing it, so you would have to weigh that up if you have any time constraints.

If you have time for some experimentation, I would generate two rasters using a subset of your data - one using the transform/rasterize process, and one the other way round. Then combine the two bitmaps with an exclusive-or operation, which will highlight areas where there is greater than one pixel error, and you can make a judgement on whether any error is allowable. You can also compare time taken for processing to further inform your decision.

share|improve this answer
Your argument appears to imply exactly the opposite of your conclusion. With a vector representation, good GISes can break segments and transform them accurately, but once the data are rasterized, no further such improvements are possible. Thus, it follows that one should rasterize last, not first! –  whuber Oct 2 '12 at 16:29
Curse your sophism! :) In my mental GIS, which is based on PostGIS/QGIS, line segments never have extra vertices added to them, unless the user adds them beforehand. I can't speak for "good" GISes though :p –  MerseyViking Oct 2 '12 at 17:15
In that case, the order of operations should make little difference--except for the resampling that necessarily occurs when the raster is transformed. If the resampling performs an interpolation (it's often bilinear), then the reprojected rasters may have some interpolation artifacts along the feature boundaries. Reprojecting the vector shapes and then rasterizing not only will tend to be computationally more efficient, but will also avoid any such artifacts. –  whuber Oct 2 '12 at 17:56

Your Answer


