Loading go-apps/meep-gis-engine/api/swagger.yaml +28 −8 Original line number Diff line number Diff line Loading @@ -381,19 +381,29 @@ definitions: type: "number" format: "float" description: "Distance between two points (in meters)" latitude: srcLatitude: type: "number" format: "float" description: "Source asset latitude" srcLongitude: type: "number" format: "float" description: "Source asset longitude" dstLatitude: type: "number" format: "float" description: "Destination asset latitude" longitude: dstLongitude: type: "number" format: "float" description: "Destination asset longitude" description: "Distance response" example: dstLongitude: 5.637377 distance: 0.8008282 latitude: 6.0274563 longitude: 1.4658129 srcLongitude: 1.4658129 srcLatitude: 6.0274563 dstLatitude: 5.962134 GeoDataAssetList: type: "object" properties: Loading Loading @@ -473,11 +483,19 @@ definitions: required: - "within" properties: latitude: srcLatitude: type: "number" format: "float" description: "Source asset latitude" srcLongitude: type: "number" format: "float" description: "Source asset longitude" dstLatitude: type: "number" format: "float" description: "Destination asset latitude" longitude: dstLongitude: type: "number" format: "float" description: "Destination asset longitude" Loading @@ -487,9 +505,11 @@ definitions: \ range)" description: "Within range response" example: dstLongitude: 5.962134 within: true latitude: 0.8008282 longitude: 6.0274563 srcLongitude: 6.0274563 srcLatitude: 0.8008282 dstLatitude: 1.4658129 GeoData: type: "object" properties: Loading go-apps/meep-gis-engine/server/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 - Build date: 2021-07-12T13:38:10.932-04:00 - Build date: 2021-07-19T12:45:12.907-04:00 ### Running the server Loading go-apps/meep-gis-engine/server/gis-engine.go +12 −5 Original line number Diff line number Diff line Loading @@ -1189,6 +1189,8 @@ func geGetDistanceGeoDataByName(w http.ResponseWriter, r *http.Request) { return } srcLong := position.Longitude srcLat := position.Latitude srcLongStr := strconv.FormatFloat(float64(position.Longitude), 'f', -1, 32) srcLatStr := strconv.FormatFloat(float64(position.Latitude), 'f', -1, 32) Loading Loading @@ -1257,8 +1259,10 @@ func geGetDistanceGeoDataByName(w http.ResponseWriter, r *http.Request) { // Create Response to return var resp Distance resp.Distance = distance resp.Longitude = dstLong resp.Latitude = dstLat resp.SrcLongitude = srcLong resp.SrcLatitude = srcLat resp.DstLongitude = dstLong resp.DstLatitude = dstLat // Format response jsonResponse, err := json.Marshal(&resp) Loading Loading @@ -1304,7 +1308,8 @@ func geGetWithinRangeGeoDataByName(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } srcLong := position.Longitude srcLat := position.Latitude srcLongStr := strconv.FormatFloat(float64(position.Longitude), 'f', -1, 32) srcLatStr := strconv.FormatFloat(float64(position.Latitude), 'f', -1, 32) Loading Loading @@ -1373,8 +1378,10 @@ func geGetWithinRangeGeoDataByName(w http.ResponseWriter, r *http.Request) { // Create Response to return var resp WithinRange resp.Within = withinRange resp.Longitude = dstLong resp.Latitude = dstLat resp.SrcLongitude = srcLong resp.SrcLatitude = srcLat resp.DstLongitude = dstLong resp.DstLatitude = dstLat // Format response jsonResponse, err := json.Marshal(&resp) Loading go-apps/meep-gis-engine/server/model_distance.go +8 −2 Original line number Diff line number Diff line Loading @@ -30,9 +30,15 @@ type Distance struct { // Distance between two points (in meters) Distance float32 `json:"distance"` // Source asset latitude SrcLatitude float32 `json:"srcLatitude,omitempty"` // Source asset longitude SrcLongitude float32 `json:"srcLongitude,omitempty"` // Destination asset latitude Latitude float32 `json:"latitude,omitempty"` DstLatitude float32 `json:"dstLatitude,omitempty"` // Destination asset longitude Longitude float32 `json:"longitude,omitempty"` DstLongitude float32 `json:"dstLongitude,omitempty"` } go-apps/meep-gis-engine/server/model_within_range.go +8 −2 Original line number Diff line number Diff line Loading @@ -27,11 +27,17 @@ package server // Within range response type WithinRange struct { // Source asset latitude SrcLatitude float32 `json:"srcLatitude,omitempty"` // Source asset longitude SrcLongitude float32 `json:"srcLongitude,omitempty"` // Destination asset latitude Latitude float32 `json:"latitude,omitempty"` DstLatitude float32 `json:"dstLatitude,omitempty"` // Destination asset longitude Longitude float32 `json:"longitude,omitempty"` DstLongitude float32 `json:"dstLongitude,omitempty"` // Within range result (e.g. true = within range, false = beyond range) Within bool `json:"within"` Loading Loading
go-apps/meep-gis-engine/api/swagger.yaml +28 −8 Original line number Diff line number Diff line Loading @@ -381,19 +381,29 @@ definitions: type: "number" format: "float" description: "Distance between two points (in meters)" latitude: srcLatitude: type: "number" format: "float" description: "Source asset latitude" srcLongitude: type: "number" format: "float" description: "Source asset longitude" dstLatitude: type: "number" format: "float" description: "Destination asset latitude" longitude: dstLongitude: type: "number" format: "float" description: "Destination asset longitude" description: "Distance response" example: dstLongitude: 5.637377 distance: 0.8008282 latitude: 6.0274563 longitude: 1.4658129 srcLongitude: 1.4658129 srcLatitude: 6.0274563 dstLatitude: 5.962134 GeoDataAssetList: type: "object" properties: Loading Loading @@ -473,11 +483,19 @@ definitions: required: - "within" properties: latitude: srcLatitude: type: "number" format: "float" description: "Source asset latitude" srcLongitude: type: "number" format: "float" description: "Source asset longitude" dstLatitude: type: "number" format: "float" description: "Destination asset latitude" longitude: dstLongitude: type: "number" format: "float" description: "Destination asset longitude" Loading @@ -487,9 +505,11 @@ definitions: \ range)" description: "Within range response" example: dstLongitude: 5.962134 within: true latitude: 0.8008282 longitude: 6.0274563 srcLongitude: 6.0274563 srcLatitude: 0.8008282 dstLatitude: 1.4658129 GeoData: type: "object" properties: Loading
go-apps/meep-gis-engine/server/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) - API version: 1.0.0 - Build date: 2021-07-12T13:38:10.932-04:00 - Build date: 2021-07-19T12:45:12.907-04:00 ### Running the server Loading
go-apps/meep-gis-engine/server/gis-engine.go +12 −5 Original line number Diff line number Diff line Loading @@ -1189,6 +1189,8 @@ func geGetDistanceGeoDataByName(w http.ResponseWriter, r *http.Request) { return } srcLong := position.Longitude srcLat := position.Latitude srcLongStr := strconv.FormatFloat(float64(position.Longitude), 'f', -1, 32) srcLatStr := strconv.FormatFloat(float64(position.Latitude), 'f', -1, 32) Loading Loading @@ -1257,8 +1259,10 @@ func geGetDistanceGeoDataByName(w http.ResponseWriter, r *http.Request) { // Create Response to return var resp Distance resp.Distance = distance resp.Longitude = dstLong resp.Latitude = dstLat resp.SrcLongitude = srcLong resp.SrcLatitude = srcLat resp.DstLongitude = dstLong resp.DstLatitude = dstLat // Format response jsonResponse, err := json.Marshal(&resp) Loading Loading @@ -1304,7 +1308,8 @@ func geGetWithinRangeGeoDataByName(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) return } srcLong := position.Longitude srcLat := position.Latitude srcLongStr := strconv.FormatFloat(float64(position.Longitude), 'f', -1, 32) srcLatStr := strconv.FormatFloat(float64(position.Latitude), 'f', -1, 32) Loading Loading @@ -1373,8 +1378,10 @@ func geGetWithinRangeGeoDataByName(w http.ResponseWriter, r *http.Request) { // Create Response to return var resp WithinRange resp.Within = withinRange resp.Longitude = dstLong resp.Latitude = dstLat resp.SrcLongitude = srcLong resp.SrcLatitude = srcLat resp.DstLongitude = dstLong resp.DstLatitude = dstLat // Format response jsonResponse, err := json.Marshal(&resp) Loading
go-apps/meep-gis-engine/server/model_distance.go +8 −2 Original line number Diff line number Diff line Loading @@ -30,9 +30,15 @@ type Distance struct { // Distance between two points (in meters) Distance float32 `json:"distance"` // Source asset latitude SrcLatitude float32 `json:"srcLatitude,omitempty"` // Source asset longitude SrcLongitude float32 `json:"srcLongitude,omitempty"` // Destination asset latitude Latitude float32 `json:"latitude,omitempty"` DstLatitude float32 `json:"dstLatitude,omitempty"` // Destination asset longitude Longitude float32 `json:"longitude,omitempty"` DstLongitude float32 `json:"dstLongitude,omitempty"` }
go-apps/meep-gis-engine/server/model_within_range.go +8 −2 Original line number Diff line number Diff line Loading @@ -27,11 +27,17 @@ package server // Within range response type WithinRange struct { // Source asset latitude SrcLatitude float32 `json:"srcLatitude,omitempty"` // Source asset longitude SrcLongitude float32 `json:"srcLongitude,omitempty"` // Destination asset latitude Latitude float32 `json:"latitude,omitempty"` DstLatitude float32 `json:"dstLatitude,omitempty"` // Destination asset longitude Longitude float32 `json:"longitude,omitempty"` DstLongitude float32 `json:"dstLongitude,omitempty"` // Within range result (e.g. true = within range, false = beyond range) Within bool `json:"within"` Loading