public Point getPoiPixelCoordinates(Poi p) { double deltaLongitude = p.getLongitude() - this.area.getTopLeftLongitude(); double deltaLatitude = this.area.getTopLeftLatitude() - p.getLatitude(); int x = (int)Math.Floor(deltaLongitude / this.longitudePerPixel); int y = (int)Math.Floor(deltaLatitude / this.latitudePerPixel); return(new Point(x, y)); }
public Point getPoiPixelCoordinates(Poi p) { double deltaLongitude = p.getLongitude() - this.area.getTopLeftLongitude(); double deltaLatitude = this.area.getTopLeftLatitude() - p.getLatitude(); int x = (int) Math.Floor(deltaLongitude / this.longitudePerPixel); int y = (int) Math.Floor(deltaLatitude / this.latitudePerPixel); return new Point(x, y); }
// check if given poi is inside area public bool contains(Poi poi) { return(contains(poi.getLatitude(), poi.getLongitude())); }
private Area createTargetArea(Poi target) { double topLeftLat = target.getLatitude() + maxLatitudeToTarget; double topLeftLon = target.getLongitude() - maxLongitudeToTarget; double bottomRightLat = target.getLatitude() - maxLatitudeToTarget; double bottomRightLon = target.getLongitude() + maxLongitudeToTarget; return new Area(topLeftLat, topLeftLon, bottomRightLat, bottomRightLon); }
/** * Returns poi sub dir by poi and named area */ private string getPoiSubDir(Poi p, NamedArea namedArea) { string dirName = p.getName() + "_" + p.getLatitude() + "_" + p.getLongitude(); return getPoiSubDir(dirName, namedArea); }
// check if given poi is inside area public bool contains(Poi poi) { return contains(poi.getLatitude(), poi.getLongitude()); }