Ignore:
Timestamp:
2019-08-21T00:42:37+02:00 (5 years ago)
Author:
frederik
Message:

fix rendering for non-standard scales, fix "mile" for light radii.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/jrenderpgsql/src/jrenderpgsql/JrenderPgsql.java

    r35091 r35094  
    264264
    265265        double west = (xtile) * MERCATOR_WIDTH / pow - MERCATOR_OFFSET;
    266         double east = (xtile + 1) * MERCATOR_WIDTH / pow - MERCATOR_OFFSET;
     266        double east = (xtile * 1.0 + tilesize / 256 / scale) * MERCATOR_WIDTH / pow - MERCATOR_OFFSET;
    267267        double north = (pow - ytile) * MERCATOR_WIDTH / pow - MERCATOR_OFFSET;
    268         double south = (pow - ytile - 1) * MERCATOR_WIDTH / pow - MERCATOR_OFFSET;
     268        double south = (pow * 1.0 - ytile * 1.0 - tilesize / 256 / scale) * MERCATOR_WIDTH / pow - MERCATOR_OFFSET;
    269269
    270270        // request data from PostGIS
     
    386386        // tile x/y pixel coordinates.
    387387
     388        final double mile = 330.0 * pow / 16384.0 * scale;
     389
    388390        ChartContext context = new ChartContext() {
    389391            public Point2D getPoint(Snode coord) {
    390392                double x = border + (radlon2x(coord.lon) - west) * 256 * scale * pow / MERCATOR_WIDTH;
    391393                double y = tilesize + border - ((radlat2y(coord.lat) - south) * scale * 256 * pow / MERCATOR_WIDTH);
    392                 System.out.println("point convert from " + Math.toDegrees(coord.lat)+","+Math.toDegrees(coord.lon)+" to "+x+","+y);
    393394                return new Point2D.Double(x, y);
    394395            }
    395396
    396397            public double mile(Feature feature) {
    397                 return 21600 / 256 / pow / scale;
     398                return mile;
    398399            }
    399400
Note: See TracChangeset for help on using the changeset viewer.