x is longitude y is latitude

and y axis is reversed in maze ( (0,0) is upper left square of maze ).

Signed-off-by: philippe lhardy <philippe.lhardy@astrolabe.coop>
This commit is contained in:
2025-11-01 19:32:20 +01:00
parent 8fdea9ed3a
commit 9bb481d0b3

View File

@@ -37,9 +37,10 @@ public class OsmToDrawing {
public OsmToDrawing(OsmReader reader, int mulx, int muly)
{
this.refx = reader.getMinlat();
this.refx = reader.getMinlon();
this.refy = reader.getMaxlat();
this.minlat = reader.getMinlat();
this.refy = reader.getMinlon();
this.minlon = reader.getMinlon();
this.maxlat = reader.getMaxlat();
this.maxlon = reader.getMaxlon();
@@ -92,7 +93,7 @@ public class OsmToDrawing {
boundserror ++;
System.err.println("lon > minlon " + lon);
}
drawingLine.addPoint(new Point((int) ( (lon - refy ) * muly), (int) ( (lat - refx)* mulx ) ));
drawingLine.addPoint(new Point((int) ( ( lon - refx ) * mulx), (int) ( ( refy - lat ) * muly ) ));
}
return drawingLine;
}