MCPcopy Create free account
hub / github.com/comaps/comaps / GetXmlFeaturesAtLatLon

Method GetXmlFeaturesAtLatLon

libs/editor/server_api.cpp:200–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200OsmOAuth::Response ServerApi06::GetXmlFeaturesAtLatLon(double lat, double lon, double radiusInMeters) const
201{
202 double const latDegreeOffset = radiusInMeters * mercator::Bounds::kDegreesInMeter;
203 double const minLat = std::max(-90.0, lat - latDegreeOffset);
204 double const maxLat = std::min(90.0, lat + latDegreeOffset);
205 double const cosL = std::max(cos(math::DegToRad(std::max(fabs(minLat), fabs(maxLat)))), 0.00001);
206 double const lonDegreeOffset = radiusInMeters * mercator::Bounds::kDegreesInMeter / cosL;
207 double const minLon = std::max(-180.0, lon - lonDegreeOffset);
208 double const maxLon = std::min(180.0, lon + lonDegreeOffset);
209 return GetXmlFeaturesInRect(minLat, minLon, maxLat, maxLon);
210}
211
212OsmOAuth::Response ServerApi06::GetXmlFeaturesAtLatLon(ms::LatLon const & ll, double radiusInMeters) const
213{

Callers 3

LoadXmlFromOSMMethod · 0.80
DeleteOSMNodeIfExistsFunction · 0.80
UNIT_TESTFunction · 0.80

Calls 1

DegToRadFunction · 0.85

Tested by 2

DeleteOSMNodeIfExistsFunction · 0.64
UNIT_TESTFunction · 0.64