zoom tweaks

This commit is contained in:
MadWasp79 2020-01-30 18:22:37 +02:00
parent cf8eef64a4
commit e16daa5163
2 changed files with 3 additions and 5 deletions

View file

@ -81,7 +81,7 @@ public class BinaryMapIndexReader {
public final static int TRANSPORT_STOP_ZOOM = 24;
public static final int SHIFT_COORDINATES = 5;
public static final int LABEL_ZOOM_ENCODE = 31;
public static final int LABEL_ZOOM_ENCODE = 26;
private final static Log log = PlatformUtil.getLog(BinaryMapIndexReader.class);
public static boolean READ_STATS = false;
public static final SearchPoiTypeFilter ACCEPT_ALL_POI_TYPE_FILTER = new SearchPoiTypeFilter() {
@ -2120,7 +2120,7 @@ public class BinaryMapIndexReader {
public static void main(String[] args) throws IOException {
File fl = new File(System.getProperty("maps") + "/Synthetic_test_rendering.obf");
fl = new File(System.getProperty("maps") + "/Belarus_europe_2.obf");
fl = new File("/home/madwasp79/OsmAnd-maps/Poly_center2.obf");
RandomAccessFile raf = new RandomAccessFile(fl, "r");

View file

@ -1,6 +1,5 @@
package net.osmand.osm.edit;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -50,7 +49,7 @@ public class OsmMapUtils {
}
public static LatLon getComplexPolyCenter(Collection<Node> nodes) {
double precision = 1e-4; //where to set precision constant?
double precision = 1e-5; //where to set precision constant?
final List<List<LatLon>> rings = new ArrayList<>();
List<LatLon> outerRing = new ArrayList<>();
@ -100,7 +99,6 @@ public class OsmMapUtils {
return null;
}
boolean area = w.getFirstNodeId() == w.getLastNodeId();
// LatLon ll = area ? getMathWeightCenterForNodes(nodes) : getWeightCenterForNodes(nodes);
LatLon ll = area ? getComplexPolyCenter(nodes) : getWeightCenterForNodes(nodes);
if(ll == null) {
return null;