Estimating species abundance via transects and quadrats has the advantage over other methods (such as mark-recapture) that they can be less expensive and do not require handling the animals. Transect–quadrat sampling along habitat boundaries with complex geometry often leads to uneven selection probability over the sampling region. These uneven selection probabilities must be properly taken into account in constructing unbiased estimates of abundance. This requires that the selection probabilities be known by design or be computable. We discuss the implications of this requirement on sampling design and introduce a computational method based on a cubic-spline approximation to the habitat margin for estimating the selection probabilities. We present the method in the context of a study of Pacific herring ( Clupea pallasi) egg abundance along coastal southeast Alaska, and show that an unbiased estimate constructed based on the computed selection probabilities (the Horvitz–Thompson (H-T) estimator) corrects for a potential bias in the estimate for egg abundance relative to the unweighted sample mean estimate. The sampling strategy used in the herring study, together with our method for computing the sampling probabilities, provides an economical and effective way to study species abundance along curvy habitat boundaries. Copyright © 2010 John Wiley & Sons, Ltd.