Commit efd725e0 authored by M. Rehan Abbasi's avatar M. Rehan Abbasi
Browse files

use proper data types for request for /geodata/cellularPower endpoint in GIS engine

parent 1bee06e0
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -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 Coordinates
	var coordinates []am.Coordinate
	if r.Body == nil {
		err := errors.New("Request body is missing")
		log.Error(err.Error())
@@ -1646,11 +1646,6 @@ func geGetGeoDataPowerValues(w http.ResponseWriter, r *http.Request) {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	var amCoordinates []am.Coordinate
	jsonString, _ := json.Marshal(coordinates)
	json.Unmarshal([]byte(jsonString), &amCoordinates)

	// Make sure scenario is active
	if ge.activeModel.GetScenarioName() == "" {
		err := errors.New("No active scenario")
@@ -1659,7 +1654,7 @@ func geGetGeoDataPowerValues(w http.ResponseWriter, r *http.Request) {
		return
	}

	coordinatesPower, err := ge.assetMgr.GetPowerValuesForCoordinates(amCoordinates)
	coordinatesPower, err := ge.assetMgr.GetPowerValuesForCoordinates(coordinates)
	if err != nil {
		log.Error(err.Error())
		http.Error(w, err.Error(), http.StatusInternalServerError)