In a medium saucepan, combine the chopped pears, water, sugar, lemon juice, and rosemary. Bring to a simmer and cook, stirring occasionally, for 10-12 minutes. The pears should be softened.
Remove the saucepan from the heat and let cool. Remove and discard the rosemary sprig. Then transfer the cooked pears and any remaining liquid in the saucepan to your blender and blend on high until smooth. Transfer the pear-rosemary purée to a clean re-sealable container and refrigerate until well chilled. The purée can be stored for 2-3 days.
For the cocktails
Add the pear-rosemary purée, gin and elderflower liqueur to a shaker with ice. Shake vigorously until well chilled. Then strain the liquid into two glasses with ice. Top with tonic water or club soda.