public string GetFileName(IGeoJsonGenerator geoJsonGenerator, List <IMunicipality> municipalities, string coordinateSystem, int id = 0) { string path = BuildPathLocal(geoJsonGenerator, id); if (MustGenerate(path)) { string geoJson = geoJsonGenerator.Generate(municipalities, coordinateSystem); using (StreamWriter writer = File.CreateText(path)) { writer.Write(geoJson); } } return(GetFileName(geoJsonGenerator, id));; }
private string GetFileName(IGeoJsonGenerator geoJsonGenerator, int id) { return($"{geoJsonGenerator.Name}_{id}.geojson"); }
private string BuildPathLocal(IGeoJsonGenerator geoJsonGenerator, int id) { return($"{_GeoJsonPathLocal}/{geoJsonGenerator.Name}_{id}.geojson"); }