Loading go-apps/meep-gis-engine/server/gis-engine.go +12 −3 Original line number Diff line number Diff line Loading @@ -1632,7 +1632,7 @@ func geUpdateGeoDataByName(w http.ResponseWriter, r *http.Request) { func geGetGeoDataPowerValues(w http.ResponseWriter, r *http.Request) { // Retrieve coordinates to work with from request body var coordinates []am.Coordinate var coordinates CoordinatePowerList if r.Body == nil { err := errors.New("Request body is missing") log.Error(err.Error()) Loading @@ -1654,7 +1654,15 @@ func geGetGeoDataPowerValues(w http.ResponseWriter, r *http.Request) { return } coordinatesPower, err := ge.assetMgr.GetPowerValuesForCoordinates(coordinates) var geocoordinates []am.Coordinate for _, geocoordinate := range coordinates.CoordinatesPower { geocoordinates = append(geocoordinates, am.Coordinate{ Latitude: geocoordinate.Latitude, Longitude: geocoordinate.Longitude, }) } coordinatesPower, err := ge.assetMgr.GetPowerValuesForCoordinates(geocoordinates) if err != nil { log.Error(err.Error()) http.Error(w, err.Error(), http.StatusInternalServerError) Loading @@ -1680,11 +1688,12 @@ func geGetGeoDataPowerValues(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusInternalServerError) return } jsonResponseStr := string(jsonResponse) // Send response w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) fmt.Fprint(w, jsonResponse) fmt.Fprint(w, jsonResponseStr) } func (ge *GisEngine) StartSnapshotThread() error { Loading Loading
go-apps/meep-gis-engine/server/gis-engine.go +12 −3 Original line number Diff line number Diff line Loading @@ -1632,7 +1632,7 @@ func geUpdateGeoDataByName(w http.ResponseWriter, r *http.Request) { func geGetGeoDataPowerValues(w http.ResponseWriter, r *http.Request) { // Retrieve coordinates to work with from request body var coordinates []am.Coordinate var coordinates CoordinatePowerList if r.Body == nil { err := errors.New("Request body is missing") log.Error(err.Error()) Loading @@ -1654,7 +1654,15 @@ func geGetGeoDataPowerValues(w http.ResponseWriter, r *http.Request) { return } coordinatesPower, err := ge.assetMgr.GetPowerValuesForCoordinates(coordinates) var geocoordinates []am.Coordinate for _, geocoordinate := range coordinates.CoordinatesPower { geocoordinates = append(geocoordinates, am.Coordinate{ Latitude: geocoordinate.Latitude, Longitude: geocoordinate.Longitude, }) } coordinatesPower, err := ge.assetMgr.GetPowerValuesForCoordinates(geocoordinates) if err != nil { log.Error(err.Error()) http.Error(w, err.Error(), http.StatusInternalServerError) Loading @@ -1680,11 +1688,12 @@ func geGetGeoDataPowerValues(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusInternalServerError) return } jsonResponseStr := string(jsonResponse) // Send response w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) fmt.Fprint(w, jsonResponse) fmt.Fprint(w, jsonResponseStr) } func (ge *GisEngine) StartSnapshotThread() error { Loading