Skip to content

Commit

Permalink
Output markers CSV in same format as input CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
MzHub committed Jan 12, 2018
1 parent 27b1202 commit 94bb09b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions osmcoverer.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,10 @@ func outputContainedMarkersToCsv(markers []Marker, outputDirectory string) {
writer := csv.NewWriter(csvFile)
defer writer.Flush()
for _, marker := range markers {
for _, within := range marker.feature.Properties["within"].([]string) {
err := writer.Write([]string{marker.feature.Properties["name"].(string), within})
lat, lng := marker.feature.Geometry.Point[1], marker.feature.Geometry.Point[0]
within := marker.feature.Properties["within"].([]string)
if len(within) > 0 {
err := writer.Write([]string{marker.feature.Properties["name"].(string), strconv.FormatFloat(lat, 'f', -1, 64), strconv.FormatFloat(lng, 'f', -1, 64)})
check(err)
}
}
Expand Down

0 comments on commit 94bb09b

Please sign in to comment.