Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
apply bandaid for go-rasterzen issue fapian#3
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Jun 15, 2018
1 parent 8f959b6 commit e2bb034
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pkg/geojson2svg/geojson2svg.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"bytes"
"fmt"
"io"
_ "log"
"log"
"math"
"regexp"
"sort"
Expand Down Expand Up @@ -179,6 +179,15 @@ func (svg *SVG) points() [][]float64 {
}

func process(sf scaleFunc, w io.Writer, g *geojson.Geometry, attributes string) {

// band-aid: https://github.com/whosonfirst/go-rasterzen/issues/3
// (20180615/thisisaaronland)

if g == nil {
log.Println("BUNK GEOMETRY (process)")
return
}

switch {
case g.IsPoint():
drawPoint(sf, w, g.Point, attributes)
Expand All @@ -200,6 +209,15 @@ func process(sf scaleFunc, w io.Writer, g *geojson.Geometry, attributes string)
}

func collect(g *geojson.Geometry) (ps [][]float64) {

// band-aid: https://github.com/whosonfirst/go-rasterzen/issues/3
// (20180615/thisisaaronland)

if g == nil {
log.Println("BUNK GEOMETRY (collect)")
return
}

switch {
case g.IsPoint():
ps = append(ps, g.Point)
Expand Down

0 comments on commit e2bb034

Please sign in to comment.