Fix douglas peuker

This commit is contained in:
Victor Shcherb 2012-05-31 01:01:07 +02:00
parent dfd17b2f4a
commit a533d480b9
2 changed files with 5 additions and 7 deletions

View file

@ -455,10 +455,10 @@ public class BinaryMapIndexWriter {
} }
private static double orthogonalDistance(int x, int y, int x1, int y1, int x2, int y2) { private static double orthogonalDistance(int x, int y, int x1, int y1, int x2, int y2) {
int A = (x - x1); long A = (x - x1);
int B = (y - y1); long B = (y - y1);
int C = (x2 - x1); long C = (x2 - x1);
int D = (y2 - y1); long D = (y2 - y1);
return Math.abs(A * D - C * B) / Math.sqrt(C * C + D * D); return Math.abs(A * D - C * B) / Math.sqrt(C * C + D * D);
} }

View file

@ -754,9 +754,7 @@ public class IndexCreator {
MapZooms zooms = MapZooms.getDefault(); // MapZooms.parseZooms("15-"); MapZooms zooms = MapZooms.getDefault(); // MapZooms.parseZooms("15-");
// creator.setNodesDBFile(new File("/home/victor/projects/OsmAnd/data/osm-gen/nodes.tmp.odb")); // creator.setNodesDBFile(new File("/home/victor/projects/OsmAnd/data/osm-gen/nodes.tmp.odb"));
// creator.setMapFileName("Luxembourg_poi.obf"); // creator.setMapFileName("Luxembourg_poi.obf");
// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/osm-maps/luxembourg.osm.pbf"), creator.generateIndexes(new File("/home/victor/projects/OsmAnd/temp/map.osm"),
// creator.generateIndexes(new File("/home/victor/projects/OsmAnd/data/osm-maps/cuba2.osm.bz2"),
creator.generateIndexes(new File("/home/victor/projects/OsmAnd/temp/slovak.osm"),
new ConsoleProgressImplementation(1), null, zooms, rt, log); new ConsoleProgressImplementation(1), null, zooms, rt, log);