The City of Vancouver is within its rights to ban demolitions of homes built before 1940 within a specific area of Shaughnessy, a B.C. Supreme Court justice has ruled.

The Heritage Conservation Area (HCA), created by city council in 2015, is legal, said justice Shelley Fitzpatrick, rejecting a claim by petitioners upset with the new law.

"The public had ample opportunity to formulate their position on the proposed HCA Bylaws so as to meaningfully participate in the public hearing process," wrote Fitzpatrick, dismissing the argument that the city was not upfront about the ramifications of the designation.

When the motion was passed, there were 595 houses in the First Shaughnessy District, 317 of which were built before 1940, with only 80 of those listed on the Vancouver heritage register.

MAP: Boundaries of the First Shaughnessy neighbourhood

A total of 43 properties on the neighbhourhood register had been demolished between 1994 and 2015, and there were another 19 homes built before 1940 proposed for demolition.

In a statement, the City of Vancouver said it was pleased with the court's decision.

"We will continue to take a balanced approach in working to prevent the demolition of historic homes, while providing new opportunities to add modest density where appropriate," it wrote.