Include projection in geojson; refactor duplicate code