Posner has a fine discussion of gerrymandering of voting districts. However, it might not be easy to get a non-partisan committee to determine boundaries because legislators will be partisan in their choice of committee members.
I will mainly discuss another form of gerrymandering; namely of districts determining attendance at different public schools. Generally, students who live in a particular district attend the public schools in that district, with exceptions for charter and magnet schools, and other special schools. Since schools differ greatly in their quality, many parents prefer living in districts with better schools. One objective measure of this preference is the difference in prices of houses of a given quality, with similar neighborhood amenities, etc. between districts with good schools and those with lower quality schools.
Families who value education and have higher incomes will bid more for houses in districts with good schools. This will bid up the prices of these houses, and thereby would reduce the advantages of living there. Nevertheless, the higher price tag in good school districts would typically not be large enough to deter families with the greatest willingness to pay for good schools from moving there.
One way to measure objectively the housing premium for good schools is to compare the prices of similar houses on both sides of the boundary separating good school districts from other districts-a technique used in various studies, including a dissertation at Chicago by Daniel Tannenbaum. He is finding significantly higher prices for housing on the boundary within the good school districts.
Given the advantage of living in districts with good schools, there is jockeying to draw district boundaries in ways that favor families with greater political clout. These tend to be wealthier and more educated families, and also persons supporting the parties in power. If the boundaries are changed to place their houses in better school districts, homeowners gain doubly: their houses rise in value, and their children attend better schools.
The advantages of living in particular congressional districts can also be determined by comparing housing prices on different sides of the boundaries between congressional districts. I doubt if people are willing to pay much to be in districts with greater numbers of Republicans or Democrats because that has little effect on their personal benefits. However, regardless of their political affiliation, they would be willing to pay through higher housing prices to be in districts that provide greater subsidies and other benefits to residents because these districts have with influential representatives. They would pay higher housing prices to be in these districts, even if they would not vote for the influential representatives.