refactory for geojson input and output.