Same comment about `instanceof`/`geometry.getType()` as above.