Searching in rectangular area shoud work fine and this example works without any issues:
let nw = GeoPoint(latitude: 44.58883, longitude: 33.52240)
let se = GeoPoint(latitude: 40.18111, longitude: 44.51361)
let geoQuery = BackendlessGeoQuery()
geoQuery.categories = ["geoservice_sample"]
geoQuery.rectangle = GeoQueryRectangle(nordWestPoint: nw, southEastPoint: se)
geoQuery.includemetadata = true
geoQuery.pageSize = 100
Backendless.shared.geo.getPoints(geoQuery: geoQuery, responseHandler: { geoPoints in
print("Retrieved \(geoPoints.count) geoPoints:")
for geoPoint in geoPoints {
print("\(geoPoint.metadata ?? [String : String]())")
}
}, errorHandler: { fault in
print("Error: \(fault.message ?? "")")
})
As for this error
The data couldn’t be read because it isn’t in the correct format
it seems like your nordWest and southEast points latitude and longitude are incorrect… what I mean to say - maybe your nordWest and southEast point are not actually nordWest and SouthEast.
my nw and se points belongs to Sevastoplol’ and Yerevan and they make the rectangle.