id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
28,300
mapsforge/mapsforge
mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/dummy/ManyDummyContent.java
ManyDummyContent.downloadUrl
private InputStreamReader downloadUrl(String urlString) throws IOException { URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(10000 /* milliseconds */); conn.setConnectTimeout(15000 /* milliseconds */); conn.setR...
java
private InputStreamReader downloadUrl(String urlString) throws IOException { URL url = new URL(urlString); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(10000 /* milliseconds */); conn.setConnectTimeout(15000 /* milliseconds */); conn.setR...
[ "private", "InputStreamReader", "downloadUrl", "(", "String", "urlString", ")", "throws", "IOException", "{", "URL", "url", "=", "new", "URL", "(", "urlString", ")", ";", "HttpURLConnection", "conn", "=", "(", "HttpURLConnection", ")", "url", ".", "openConnectio...
an input stream.
[ "an", "input", "stream", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/dummy/ManyDummyContent.java#L145-L157
28,301
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/cache/InMemoryTileCache.java
InMemoryTileCache.setCapacity
public synchronized void setCapacity(int capacity) { BitmapLRUCache lruCacheNew = new BitmapLRUCache(capacity); lruCacheNew.putAll(this.lruCache); this.lruCache = lruCacheNew; }
java
public synchronized void setCapacity(int capacity) { BitmapLRUCache lruCacheNew = new BitmapLRUCache(capacity); lruCacheNew.putAll(this.lruCache); this.lruCache = lruCacheNew; }
[ "public", "synchronized", "void", "setCapacity", "(", "int", "capacity", ")", "{", "BitmapLRUCache", "lruCacheNew", "=", "new", "BitmapLRUCache", "(", "capacity", ")", ";", "lruCacheNew", ".", "putAll", "(", "this", ".", "lruCache", ")", ";", "this", ".", "l...
Sets the new size of this cache. If this cache already contains more items than the new capacity allows, items are discarded based on the cache policy. @param capacity the new maximum number of entries in this cache. @throws IllegalArgumentException if the capacity is negative.
[ "Sets", "the", "new", "size", "of", "this", "cache", ".", "If", "this", "cache", "already", "contains", "more", "items", "than", "the", "new", "capacity", "allows", "items", "are", "discarded", "based", "on", "the", "cache", "policy", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/cache/InMemoryTileCache.java#L115-L119
28,302
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/util/LayerUtil.java
LayerUtil.getUpperLeft
public static Tile getUpperLeft(BoundingBox boundingBox, byte zoomLevel, int tileSize) { int tileLeft = MercatorProjection.longitudeToTileX(boundingBox.minLongitude, zoomLevel); int tileTop = MercatorProjection.latitudeToTileY(boundingBox.maxLatitude, zoomLevel); return new Tile(tileLeft, tileTo...
java
public static Tile getUpperLeft(BoundingBox boundingBox, byte zoomLevel, int tileSize) { int tileLeft = MercatorProjection.longitudeToTileX(boundingBox.minLongitude, zoomLevel); int tileTop = MercatorProjection.latitudeToTileY(boundingBox.maxLatitude, zoomLevel); return new Tile(tileLeft, tileTo...
[ "public", "static", "Tile", "getUpperLeft", "(", "BoundingBox", "boundingBox", ",", "byte", "zoomLevel", ",", "int", "tileSize", ")", "{", "int", "tileLeft", "=", "MercatorProjection", ".", "longitudeToTileX", "(", "boundingBox", ".", "minLongitude", ",", "zoomLev...
Upper left tile for an area. @param boundingBox the area boundingBox @param zoomLevel the zoom level. @param tileSize the tile size. @return the tile at the upper left of the bbox.
[ "Upper", "left", "tile", "for", "an", "area", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/util/LayerUtil.java#L64-L68
28,303
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/util/LayerUtil.java
LayerUtil.getLowerRight
public static Tile getLowerRight(BoundingBox boundingBox, byte zoomLevel, int tileSize) { int tileRight = MercatorProjection.longitudeToTileX(boundingBox.maxLongitude, zoomLevel); int tileBottom = MercatorProjection.latitudeToTileY(boundingBox.minLatitude, zoomLevel); return new Tile(tileRight, ...
java
public static Tile getLowerRight(BoundingBox boundingBox, byte zoomLevel, int tileSize) { int tileRight = MercatorProjection.longitudeToTileX(boundingBox.maxLongitude, zoomLevel); int tileBottom = MercatorProjection.latitudeToTileY(boundingBox.minLatitude, zoomLevel); return new Tile(tileRight, ...
[ "public", "static", "Tile", "getLowerRight", "(", "BoundingBox", "boundingBox", ",", "byte", "zoomLevel", ",", "int", "tileSize", ")", "{", "int", "tileRight", "=", "MercatorProjection", ".", "longitudeToTileX", "(", "boundingBox", ".", "maxLongitude", ",", "zoomL...
Lower right tile for an area. @param boundingBox the area boundingBox @param zoomLevel the zoom level. @param tileSize the tile size. @return the tile at the lower right of the bbox.
[ "Lower", "right", "tile", "for", "an", "area", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/util/LayerUtil.java#L78-L82
28,304
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/util/LayerUtil.java
LayerUtil.collisionFreeOrdered
public static List<MapElementContainer> collisionFreeOrdered(List<MapElementContainer> input) { // sort items by priority (highest first) Collections.sort(input, Collections.reverseOrder()); // in order of priority, see if an item can be drawn, i.e. none of the items // in the currentIte...
java
public static List<MapElementContainer> collisionFreeOrdered(List<MapElementContainer> input) { // sort items by priority (highest first) Collections.sort(input, Collections.reverseOrder()); // in order of priority, see if an item can be drawn, i.e. none of the items // in the currentIte...
[ "public", "static", "List", "<", "MapElementContainer", ">", "collisionFreeOrdered", "(", "List", "<", "MapElementContainer", ">", "input", ")", "{", "// sort items by priority (highest first)", "Collections", ".", "sort", "(", "input", ",", "Collections", ".", "rever...
Transforms a list of MapElements, orders it and removes those elements that overlap. This operation is useful for an early elimination of elements in a list that will never be drawn because they overlap. @param input list of MapElements @return collision-free, ordered list, a subset of the input.
[ "Transforms", "a", "list", "of", "MapElements", "orders", "it", "and", "removes", "those", "elements", "that", "overlap", ".", "This", "operation", "is", "useful", "for", "an", "early", "elimination", "of", "elements", "in", "a", "list", "that", "will", "nev...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/util/LayerUtil.java#L119-L138
28,305
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/XmlUtils.java
XmlUtils.inputStreamFromFile
private static InputStream inputStreamFromFile(String relativePathPrefix, String src) throws IOException { File file = getFile(relativePathPrefix, src); if (!file.exists()) { if (src.length() > 0 && src.charAt(0) == File.separatorChar) { file = getFile(relativePathPrefix, src...
java
private static InputStream inputStreamFromFile(String relativePathPrefix, String src) throws IOException { File file = getFile(relativePathPrefix, src); if (!file.exists()) { if (src.length() > 0 && src.charAt(0) == File.separatorChar) { file = getFile(relativePathPrefix, src...
[ "private", "static", "InputStream", "inputStreamFromFile", "(", "String", "relativePathPrefix", ",", "String", "src", ")", "throws", "IOException", "{", "File", "file", "=", "getFile", "(", "relativePathPrefix", ",", "src", ")", ";", "if", "(", "!", "file", "....
Create InputStream from file resource.
[ "Create", "InputStream", "from", "file", "resource", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/XmlUtils.java#L208-L224
28,306
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/XmlUtils.java
XmlUtils.inputStreamFromJar
private static InputStream inputStreamFromJar(String relativePathPrefix, String src) throws IOException { String absoluteName = getAbsoluteName(relativePathPrefix, src); return XmlUtils.class.getResourceAsStream(absoluteName); }
java
private static InputStream inputStreamFromJar(String relativePathPrefix, String src) throws IOException { String absoluteName = getAbsoluteName(relativePathPrefix, src); return XmlUtils.class.getResourceAsStream(absoluteName); }
[ "private", "static", "InputStream", "inputStreamFromJar", "(", "String", "relativePathPrefix", ",", "String", "src", ")", "throws", "IOException", "{", "String", "absoluteName", "=", "getAbsoluteName", "(", "relativePathPrefix", ",", "src", ")", ";", "return", "XmlU...
Create InputStream from jar resource.
[ "Create", "InputStream", "from", "jar", "resource", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/XmlUtils.java#L229-L232
28,307
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/Layers.java
Layers.add
public synchronized void add(int index, Layer layer, boolean redraw) { checkIsNull(layer); layer.setDisplayModel(this.displayModel); this.layersList.add(index, layer); layer.assign(this.redrawer); if (redraw) { this.redrawer.redrawLayers(); } }
java
public synchronized void add(int index, Layer layer, boolean redraw) { checkIsNull(layer); layer.setDisplayModel(this.displayModel); this.layersList.add(index, layer); layer.assign(this.redrawer); if (redraw) { this.redrawer.redrawLayers(); } }
[ "public", "synchronized", "void", "add", "(", "int", "index", ",", "Layer", "layer", ",", "boolean", "redraw", ")", "{", "checkIsNull", "(", "layer", ")", ";", "layer", ".", "setDisplayModel", "(", "this", ".", "displayModel", ")", ";", "this", ".", "lay...
Adds a new layer at the specified position. @param index The position at which to add the new layer (the lowest layer has position 0) @param layer The new layer to add @param redraw Whether the map should be redrawn after adding the layer @see List#add(int, Object)
[ "Adds", "a", "new", "layer", "at", "the", "specified", "position", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/Layers.java#L81-L89
28,308
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/Layers.java
Layers.addAll
public synchronized void addAll(Collection<Layer> layers, boolean redraw) { checkIsNull(layers); for (Layer layer : layers) { layer.setDisplayModel(this.displayModel); } this.layersList.addAll(layers); for (Layer layer : layers) { layer.assign(this.redrawe...
java
public synchronized void addAll(Collection<Layer> layers, boolean redraw) { checkIsNull(layers); for (Layer layer : layers) { layer.setDisplayModel(this.displayModel); } this.layersList.addAll(layers); for (Layer layer : layers) { layer.assign(this.redrawe...
[ "public", "synchronized", "void", "addAll", "(", "Collection", "<", "Layer", ">", "layers", ",", "boolean", "redraw", ")", "{", "checkIsNull", "(", "layers", ")", ";", "for", "(", "Layer", "layer", ":", "layers", ")", "{", "layer", ".", "setDisplayModel", ...
Adds multiple new layers on top. @param layers The new layers to add @param redraw Whether the map should be redrawn after adding the layers @see List#addAll(Collection)
[ "Adds", "multiple", "new", "layers", "on", "top", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/Layers.java#L142-L154
28,309
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/Layers.java
Layers.clear
public synchronized void clear(boolean redraw) { for (Layer layer : this.layersList) { layer.unassign(); } this.layersList.clear(); if (redraw) { this.redrawer.redrawLayers(); } }
java
public synchronized void clear(boolean redraw) { for (Layer layer : this.layersList) { layer.unassign(); } this.layersList.clear(); if (redraw) { this.redrawer.redrawLayers(); } }
[ "public", "synchronized", "void", "clear", "(", "boolean", "redraw", ")", "{", "for", "(", "Layer", "layer", ":", "this", ".", "layersList", ")", "{", "layer", ".", "unassign", "(", ")", ";", "}", "this", ".", "layersList", ".", "clear", "(", ")", ";...
Removes all layers. @param redraw Whether the map should be redrawn after removing the layers @see List#clear()
[ "Removes", "all", "layers", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/Layers.java#L208-L216
28,310
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteQuery.java
SQLiteQuery.fillWindow
int fillWindow(CursorWindow window, int startPos, int requiredPos, boolean countAllRows) { acquireReference(); try { window.acquireReference(); try { int numRows = getSession().executeForCursorWindow(getSql(), getBindArgs(), window, startPo...
java
int fillWindow(CursorWindow window, int startPos, int requiredPos, boolean countAllRows) { acquireReference(); try { window.acquireReference(); try { int numRows = getSession().executeForCursorWindow(getSql(), getBindArgs(), window, startPo...
[ "int", "fillWindow", "(", "CursorWindow", "window", ",", "int", "startPos", ",", "int", "requiredPos", ",", "boolean", "countAllRows", ")", "{", "acquireReference", "(", ")", ";", "try", "{", "window", ".", "acquireReference", "(", ")", ";", "try", "{", "i...
Reads rows into a buffer. @param window The window to fill into @param startPos The start position for filling the window. @param requiredPos The position of a row that MUST be in the window. If it won't fit, then the query should discard part of what it filled. @param countAllRows True to count all rows that the quer...
[ "Reads", "rows", "into", "a", "buffer", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteQuery.java#L61-L82
28,311
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/TileDependencies.java
TileDependencies.getOverlappingElements
Set<MapElementContainer> getOverlappingElements(Tile from, Tile to) { if (overlapData.containsKey(from) && overlapData.get(from).containsKey(to)) { return overlapData.get(from).get(to); } return new HashSet<MapElementContainer>(0); }
java
Set<MapElementContainer> getOverlappingElements(Tile from, Tile to) { if (overlapData.containsKey(from) && overlapData.get(from).containsKey(to)) { return overlapData.get(from).get(to); } return new HashSet<MapElementContainer>(0); }
[ "Set", "<", "MapElementContainer", ">", "getOverlappingElements", "(", "Tile", "from", ",", "Tile", "to", ")", "{", "if", "(", "overlapData", ".", "containsKey", "(", "from", ")", "&&", "overlapData", ".", "get", "(", "from", ")", ".", "containsKey", "(", ...
Retrieves the overlap data from the neighbouring tiles @param from the origin tile @param to the tile the label clashesWith to @return a List of the elements
[ "Retrieves", "the", "overlap", "data", "from", "the", "neighbouring", "tiles" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/TileDependencies.java#L58-L63
28,312
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/TileDependencies.java
TileDependencies.removeTileData
void removeTileData(Tile from, Tile to) { if (overlapData.containsKey(from)) { overlapData.get(from).remove(to); } }
java
void removeTileData(Tile from, Tile to) { if (overlapData.containsKey(from)) { overlapData.get(from).remove(to); } }
[ "void", "removeTileData", "(", "Tile", "from", ",", "Tile", "to", ")", "{", "if", "(", "overlapData", ".", "containsKey", "(", "from", ")", ")", "{", "overlapData", ".", "get", "(", "from", ")", ".", "remove", "(", "to", ")", ";", "}", "}" ]
Cache maintenance operation to remove data for a tile from the cache. This should be excuted if a tile is removed from the TileCache and will be drawn again. @param from
[ "Cache", "maintenance", "operation", "to", "remove", "data", "for", "a", "tile", "from", "the", "cache", ".", "This", "should", "be", "excuted", "if", "a", "tile", "is", "removed", "from", "the", "TileCache", "and", "will", "be", "drawn", "again", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/TileDependencies.java#L81-L86
28,313
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/util/MapViewProjection.java
MapViewProjection.fromPixels
public LatLong fromPixels(double x, double y) { if (this.mapView.getWidth() <= 0 || this.mapView.getHeight() <= 0) { return null; } // this uses the framebuffer position, the mapview position can be out of sync with // what the user sees on the screen if an animation is in p...
java
public LatLong fromPixels(double x, double y) { if (this.mapView.getWidth() <= 0 || this.mapView.getHeight() <= 0) { return null; } // this uses the framebuffer position, the mapview position can be out of sync with // what the user sees on the screen if an animation is in p...
[ "public", "LatLong", "fromPixels", "(", "double", "x", ",", "double", "y", ")", "{", "if", "(", "this", ".", "mapView", ".", "getWidth", "(", ")", "<=", "0", "||", "this", ".", "mapView", ".", "getHeight", "(", ")", "<=", "0", ")", "{", "return", ...
Computes the geographic coordinates of a screen point. @return the coordinates of the x/y point
[ "Computes", "the", "geographic", "coordinates", "of", "a", "screen", "point", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/util/MapViewProjection.java#L39-L69
28,314
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/util/MapViewProjection.java
MapViewProjection.getLatitudeSpan
public double getLatitudeSpan() { if (this.mapView.getWidth() > 0 && this.mapView.getHeight() > 0) { LatLong top = fromPixels(0, 0); LatLong bottom = fromPixels(0, this.mapView.getHeight()); return Math.abs(top.latitude - bottom.latitude); } throw new IllegalS...
java
public double getLatitudeSpan() { if (this.mapView.getWidth() > 0 && this.mapView.getHeight() > 0) { LatLong top = fromPixels(0, 0); LatLong bottom = fromPixels(0, this.mapView.getHeight()); return Math.abs(top.latitude - bottom.latitude); } throw new IllegalS...
[ "public", "double", "getLatitudeSpan", "(", ")", "{", "if", "(", "this", ".", "mapView", ".", "getWidth", "(", ")", ">", "0", "&&", "this", ".", "mapView", ".", "getHeight", "(", ")", ">", "0", ")", "{", "LatLong", "top", "=", "fromPixels", "(", "0...
Computes vertical extend of the map view. @return the latitude span of the map in degrees
[ "Computes", "vertical", "extend", "of", "the", "map", "view", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/util/MapViewProjection.java#L76-L83
28,315
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/util/MapViewProjection.java
MapViewProjection.getLongitudeSpan
public double getLongitudeSpan() { if (this.mapView.getWidth() > 0 && this.mapView.getHeight() > 0) { LatLong left = fromPixels(0, 0); LatLong right = fromPixels(this.mapView.getWidth(), 0); return Math.abs(left.longitude - right.longitude); } throw new Illega...
java
public double getLongitudeSpan() { if (this.mapView.getWidth() > 0 && this.mapView.getHeight() > 0) { LatLong left = fromPixels(0, 0); LatLong right = fromPixels(this.mapView.getWidth(), 0); return Math.abs(left.longitude - right.longitude); } throw new Illega...
[ "public", "double", "getLongitudeSpan", "(", ")", "{", "if", "(", "this", ".", "mapView", ".", "getWidth", "(", ")", ">", "0", "&&", "this", ".", "mapView", ".", "getHeight", "(", ")", ">", "0", ")", "{", "LatLong", "left", "=", "fromPixels", "(", ...
Computes horizontal extend of the map view. @return the longitude span of the map in degrees
[ "Computes", "horizontal", "extend", "of", "the", "map", "view", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/util/MapViewProjection.java#L90-L97
28,316
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java
LineSegment.angleTo
public double angleTo(LineSegment other) { double angle1 = Math.atan2(this.start.y - this.end.y, this.start.x - this.end.x); double angle2 = Math.atan2(other.start.y - other.end.y, other.start.x - other.end.x); double angle = Math.toDegrees(angle1 - angle2); if (angle <= -180) { ...
java
public double angleTo(LineSegment other) { double angle1 = Math.atan2(this.start.y - this.end.y, this.start.x - this.end.x); double angle2 = Math.atan2(other.start.y - other.end.y, other.start.x - other.end.x); double angle = Math.toDegrees(angle1 - angle2); if (angle <= -180) { ...
[ "public", "double", "angleTo", "(", "LineSegment", "other", ")", "{", "double", "angle1", "=", "Math", ".", "atan2", "(", "this", ".", "start", ".", "y", "-", "this", ".", "end", ".", "y", ",", "this", ".", "start", ".", "x", "-", "this", ".", "e...
Computes the angle between this LineSegment and another one. @param other the other LineSegment @return angle in degrees
[ "Computes", "the", "angle", "between", "this", "LineSegment", "and", "another", "one", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java#L61-L72
28,317
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java
LineSegment.intersectsRectangle
public boolean intersectsRectangle(Rectangle r, boolean bias) { int codeStart = code(r, this.start); int codeEnd = code(r, this.end); if (0 == (codeStart | codeEnd)) { // both points are inside, trivial case return true; } else if (0 != (codeStart & codeEnd)) { ...
java
public boolean intersectsRectangle(Rectangle r, boolean bias) { int codeStart = code(r, this.start); int codeEnd = code(r, this.end); if (0 == (codeStart | codeEnd)) { // both points are inside, trivial case return true; } else if (0 != (codeStart & codeEnd)) { ...
[ "public", "boolean", "intersectsRectangle", "(", "Rectangle", "r", ",", "boolean", "bias", ")", "{", "int", "codeStart", "=", "code", "(", "r", ",", "this", ".", "start", ")", ";", "int", "codeEnd", "=", "code", "(", "r", ",", "this", ".", "end", ")"...
Returns a fast computation if the line intersects the rectangle or bias if there is no fast way to compute the intersection. @param r retangle to test @param bias the result if no fast computation is possible @return either the fast and correct result or the bias (which might be wrong).
[ "Returns", "a", "fast", "computation", "if", "the", "line", "intersects", "the", "rectangle", "or", "bias", "if", "there", "is", "no", "fast", "way", "to", "compute", "the", "intersection", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java#L167-L179
28,318
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java
LineSegment.pointAlongLineSegment
public Point pointAlongLineSegment(double distance) { if (start.x == end.x) { // we have a vertical line if (start.y > end.y) { return new Point(end.x, end.y + distance); } else { return new Point(start.x, start.y + distance); } ...
java
public Point pointAlongLineSegment(double distance) { if (start.x == end.x) { // we have a vertical line if (start.y > end.y) { return new Point(end.x, end.y + distance); } else { return new Point(start.x, start.y + distance); } ...
[ "public", "Point", "pointAlongLineSegment", "(", "double", "distance", ")", "{", "if", "(", "start", ".", "x", "==", "end", ".", "x", ")", "{", "// we have a vertical line", "if", "(", "start", ".", "y", ">", "end", ".", "y", ")", "{", "return", "new",...
Computes a Point along the line segment with a given distance to the start Point. @param distance distance from start point @return point at given distance from start point
[ "Computes", "a", "Point", "along", "the", "line", "segment", "with", "a", "given", "distance", "to", "the", "start", "Point", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java#L197-L213
28,319
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java
LineSegment.subSegment
public LineSegment subSegment(double offset, double length) { Point subSegmentStart = pointAlongLineSegment(offset); Point subSegmentEnd = pointAlongLineSegment(offset + length); return new LineSegment(subSegmentStart, subSegmentEnd); }
java
public LineSegment subSegment(double offset, double length) { Point subSegmentStart = pointAlongLineSegment(offset); Point subSegmentEnd = pointAlongLineSegment(offset + length); return new LineSegment(subSegmentStart, subSegmentEnd); }
[ "public", "LineSegment", "subSegment", "(", "double", "offset", ",", "double", "length", ")", "{", "Point", "subSegmentStart", "=", "pointAlongLineSegment", "(", "offset", ")", ";", "Point", "subSegmentEnd", "=", "pointAlongLineSegment", "(", "offset", "+", "lengt...
LineSegment that starts at offset from start and runs for length towards end point @param offset offset applied at begin of line @param length length of the new segment @return new LineSegment computed
[ "LineSegment", "that", "starts", "at", "offset", "from", "start", "and", "runs", "for", "length", "towards", "end", "point" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java#L231-L235
28,320
mapsforge/mapsforge
mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/ReadBuffer.java
ReadBuffer.readFromFile
public boolean readFromFile(int length) throws IOException { // ensure that the read buffer is large enough if (this.bufferData == null || this.bufferData.length < length) { // ensure that the read buffer is not too large if (length > Parameters.MAXIMUM_BUFFER_SIZE) { ...
java
public boolean readFromFile(int length) throws IOException { // ensure that the read buffer is large enough if (this.bufferData == null || this.bufferData.length < length) { // ensure that the read buffer is not too large if (length > Parameters.MAXIMUM_BUFFER_SIZE) { ...
[ "public", "boolean", "readFromFile", "(", "int", "length", ")", "throws", "IOException", "{", "// ensure that the read buffer is large enough", "if", "(", "this", ".", "bufferData", "==", "null", "||", "this", ".", "bufferData", ".", "length", "<", "length", ")", ...
Reads the given amount of bytes from the file into the read buffer and resets the internal buffer position. If the capacity of the read buffer is too small, a larger one is created automatically. @param length the amount of bytes to read from the file. @return true if the whole data was read successfully, false otherw...
[ "Reads", "the", "given", "amount", "of", "bytes", "from", "the", "file", "into", "the", "read", "buffer", "and", "resets", "the", "internal", "buffer", "position", ".", "If", "the", "capacity", "of", "the", "read", "buffer", "is", "too", "small", "a", "l...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/ReadBuffer.java#L80-L97
28,321
mapsforge/mapsforge
mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/ReadBuffer.java
ReadBuffer.readUTF8EncodedString
public String readUTF8EncodedString(int stringLength) { if (stringLength > 0 && this.bufferPosition + stringLength <= this.bufferData.length) { this.bufferPosition += stringLength; try { return new String(this.bufferData, this.bufferPosition - stringLength, stringLength, ...
java
public String readUTF8EncodedString(int stringLength) { if (stringLength > 0 && this.bufferPosition + stringLength <= this.bufferData.length) { this.bufferPosition += stringLength; try { return new String(this.bufferData, this.bufferPosition - stringLength, stringLength, ...
[ "public", "String", "readUTF8EncodedString", "(", "int", "stringLength", ")", "{", "if", "(", "stringLength", ">", "0", "&&", "this", ".", "bufferPosition", "+", "stringLength", "<=", "this", ".", "bufferData", ".", "length", ")", "{", "this", ".", "bufferPo...
Decodes the given amount of bytes from the read buffer to a string. @param stringLength the length of the string in bytes. @return the UTF-8 decoded string (may be null).
[ "Decodes", "the", "given", "amount", "of", "bytes", "from", "the", "read", "buffer", "to", "a", "string", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/ReadBuffer.java#L272-L283
28,322
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/CanvasRasterer.java
CanvasRasterer.fillOutsideAreas
void fillOutsideAreas(int color, Rectangle insideArea) { this.canvas.setClipDifference((int) insideArea.left, (int) insideArea.top, (int) insideArea.getWidth(), (int) insideArea.getHeight()); this.canvas.fillColor(color); this.canvas.resetClip(); }
java
void fillOutsideAreas(int color, Rectangle insideArea) { this.canvas.setClipDifference((int) insideArea.left, (int) insideArea.top, (int) insideArea.getWidth(), (int) insideArea.getHeight()); this.canvas.fillColor(color); this.canvas.resetClip(); }
[ "void", "fillOutsideAreas", "(", "int", "color", ",", "Rectangle", "insideArea", ")", "{", "this", ".", "canvas", ".", "setClipDifference", "(", "(", "int", ")", "insideArea", ".", "left", ",", "(", "int", ")", "insideArea", ".", "top", ",", "(", "int", ...
Fills the area outside the specificed rectangle with color. This method is used to blank out areas that fall outside the map area. @param color the fill color for the outside area @param insideArea the inside area on which not to draw
[ "Fills", "the", "area", "outside", "the", "specificed", "rectangle", "with", "color", ".", "This", "method", "is", "used", "to", "blank", "out", "areas", "that", "fall", "outside", "the", "map", "area", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/CanvasRasterer.java#L112-L116
28,323
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/hills/DiffuseLightShadingAlgorithm.java
DiffuseLightShadingAlgorithm.calculateRaw
double calculateRaw(double n, double e) { // calculate the distance of the normal vector to a plane orthogonal to the light source and passing through zero, // the fraction of distance to vector lenght is proportional to the amount of light that would be hitting a disc // orthogonal to the norma...
java
double calculateRaw(double n, double e) { // calculate the distance of the normal vector to a plane orthogonal to the light source and passing through zero, // the fraction of distance to vector lenght is proportional to the amount of light that would be hitting a disc // orthogonal to the norma...
[ "double", "calculateRaw", "(", "double", "n", ",", "double", "e", ")", "{", "// calculate the distance of the normal vector to a plane orthogonal to the light source and passing through zero,", "// the fraction of distance to vector lenght is proportional to the amount of light that would be h...
return 0..1
[ "return", "0", "..", "1" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/hills/DiffuseLightShadingAlgorithm.java#L194-L202
28,324
mapsforge/mapsforge
mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/IndexCache.java
IndexCache.getIndexEntry
long getIndexEntry(SubFileParameter subFileParameter, long blockNumber) throws IOException { // check if the block number is out of bounds if (blockNumber >= subFileParameter.numberOfBlocks) { throw new IOException("invalid block number: " + blockNumber); } // calculate the ...
java
long getIndexEntry(SubFileParameter subFileParameter, long blockNumber) throws IOException { // check if the block number is out of bounds if (blockNumber >= subFileParameter.numberOfBlocks) { throw new IOException("invalid block number: " + blockNumber); } // calculate the ...
[ "long", "getIndexEntry", "(", "SubFileParameter", "subFileParameter", ",", "long", "blockNumber", ")", "throws", "IOException", "{", "// check if the block number is out of bounds", "if", "(", "blockNumber", ">=", "subFileParameter", ".", "numberOfBlocks", ")", "{", "thro...
Returns the index entry of a block in the given map file. If the required index entry is not cached, it will be read from the map file index and put in the cache. @param subFileParameter the parameters of the map file for which the index entry is needed. @param blockNumber the number of the block in the map file....
[ "Returns", "the", "index", "entry", "of", "a", "block", "in", "the", "given", "map", "file", ".", "If", "the", "required", "index", "entry", "is", "not", "cached", "it", "will", "be", "read", "from", "the", "map", "file", "index", "and", "put", "in", ...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/IndexCache.java#L71-L111
28,325
mapsforge/mapsforge
mapsforge-poi/src/main/java/org/mapsforge/poi/storage/PoiCategoryRangeQueryGenerator.java
PoiCategoryRangeQueryGenerator.getSQLWhereClauseString
private static String getSQLWhereClauseString(PoiCategoryFilter filter, int version) { Collection<PoiCategory> superCategories = filter.getAcceptedSuperCategories(); if (superCategories.isEmpty()) { return ""; } StringBuilder sb = new StringBuilder(); sb.append(" AN...
java
private static String getSQLWhereClauseString(PoiCategoryFilter filter, int version) { Collection<PoiCategory> superCategories = filter.getAcceptedSuperCategories(); if (superCategories.isEmpty()) { return ""; } StringBuilder sb = new StringBuilder(); sb.append(" AN...
[ "private", "static", "String", "getSQLWhereClauseString", "(", "PoiCategoryFilter", "filter", ",", "int", "version", ")", "{", "Collection", "<", "PoiCategory", ">", "superCategories", "=", "filter", ".", "getAcceptedSuperCategories", "(", ")", ";", "if", "(", "su...
Gets the WHERE clause for the SQL query that looks up POI entries. @param filter The filter object for determining all wanted categories. @param version POI specification version. @return The WHERE clause.
[ "Gets", "the", "WHERE", "clause", "for", "the", "SQL", "query", "that", "looks", "up", "POI", "entries", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-poi/src/main/java/org/mapsforge/poi/storage/PoiCategoryRangeQueryGenerator.java#L66-L107
28,326
mapsforge/mapsforge
mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/PolyLabel.java
PolyLabel.getCentroidCell
private static Cell getCentroidCell(Polygon polygon) { double area = 0.0; double x = 0.0; double y = 0.0; LineString exterior = polygon.getExteriorRing(); for (int i = 0, n = exterior.getNumPoints() - 1, j = n - 1; i < n; j = i, i++) { Coordinate a = exterior.getCoo...
java
private static Cell getCentroidCell(Polygon polygon) { double area = 0.0; double x = 0.0; double y = 0.0; LineString exterior = polygon.getExteriorRing(); for (int i = 0, n = exterior.getNumPoints() - 1, j = n - 1; i < n; j = i, i++) { Coordinate a = exterior.getCoo...
[ "private", "static", "Cell", "getCentroidCell", "(", "Polygon", "polygon", ")", "{", "double", "area", "=", "0.0", ";", "double", "x", "=", "0.0", ";", "double", "y", "=", "0.0", ";", "LineString", "exterior", "=", "polygon", ".", "getExteriorRing", "(", ...
Get polygon centroid
[ "Get", "polygon", "centroid" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/PolyLabel.java#L191-L207
28,327
mapsforge/mapsforge
mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/PolyLabel.java
PolyLabel.getSegDistSq
private static double getSegDistSq(double px, double py, Coordinate a, Coordinate b) { double x = a.x; double y = a.y; double dx = b.x - x; double dy = b.y - y; if (dx != 0f || dy != 0f) { double t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy); ...
java
private static double getSegDistSq(double px, double py, Coordinate a, Coordinate b) { double x = a.x; double y = a.y; double dx = b.x - x; double dy = b.y - y; if (dx != 0f || dy != 0f) { double t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy); ...
[ "private", "static", "double", "getSegDistSq", "(", "double", "px", ",", "double", "py", ",", "Coordinate", "a", ",", "Coordinate", "b", ")", "{", "double", "x", "=", "a", ".", "x", ";", "double", "y", "=", "a", ".", "y", ";", "double", "dx", "=", ...
Get squared distance from a point to a segment
[ "Get", "squared", "distance", "from", "a", "point", "to", "a", "segment" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/PolyLabel.java#L210-L232
28,328
mapsforge/mapsforge
mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/PolyLabel.java
PolyLabel.latitudeToY
private static double latitudeToY(double latitude) { double sinLatitude = Math.sin(latitude * (Math.PI / 180)); return 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI); }
java
private static double latitudeToY(double latitude) { double sinLatitude = Math.sin(latitude * (Math.PI / 180)); return 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI); }
[ "private", "static", "double", "latitudeToY", "(", "double", "latitude", ")", "{", "double", "sinLatitude", "=", "Math", ".", "sin", "(", "latitude", "*", "(", "Math", ".", "PI", "/", "180", ")", ")", ";", "return", "0.5", "-", "Math", ".", "log", "(...
Re-projection functions
[ "Re", "-", "projection", "functions" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/PolyLabel.java#L236-L239
28,329
mapsforge/mapsforge
mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TileCoordinate.java
TileCoordinate.translateToZoomLevel
public List<TileCoordinate> translateToZoomLevel(byte zoomlevelNew) { List<TileCoordinate> tiles = null; int zoomlevelDistance = zoomlevelNew - this.zoomlevel; int factor = (int) Math.pow(2, Math.abs(zoomlevelDistance)); if (zoomlevelDistance > 0) { tiles = new ArrayList<>((...
java
public List<TileCoordinate> translateToZoomLevel(byte zoomlevelNew) { List<TileCoordinate> tiles = null; int zoomlevelDistance = zoomlevelNew - this.zoomlevel; int factor = (int) Math.pow(2, Math.abs(zoomlevelDistance)); if (zoomlevelDistance > 0) { tiles = new ArrayList<>((...
[ "public", "List", "<", "TileCoordinate", ">", "translateToZoomLevel", "(", "byte", "zoomlevelNew", ")", "{", "List", "<", "TileCoordinate", ">", "tiles", "=", "null", ";", "int", "zoomlevelDistance", "=", "zoomlevelNew", "-", "this", ".", "zoomlevel", ";", "in...
Computes which tile on a lower zoom level covers this given tile or which tiles on a higher zoom level together cover this tile. @param zoomlevelNew the zoom level @return a list of tiles (represented by tile coordinates) which cover this tile
[ "Computes", "which", "tile", "on", "a", "lower", "zoom", "level", "covers", "this", "given", "tile", "or", "which", "tiles", "on", "a", "higher", "zoom", "level", "together", "cover", "this", "tile", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TileCoordinate.java#L109-L128
28,330
mapsforge/mapsforge
mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/JTSUtils.java
JTSUtils.toJtsGeometry
public static Geometry toJtsGeometry(TDWay way, List<TDWay> innerWays) { if (way == null) { LOGGER.warning("way is null"); return null; } if (way.isForcePolygonLine()) { // may build a single line string if inner ways are empty return buildMultiLi...
java
public static Geometry toJtsGeometry(TDWay way, List<TDWay> innerWays) { if (way == null) { LOGGER.warning("way is null"); return null; } if (way.isForcePolygonLine()) { // may build a single line string if inner ways are empty return buildMultiLi...
[ "public", "static", "Geometry", "toJtsGeometry", "(", "TDWay", "way", ",", "List", "<", "TDWay", ">", "innerWays", ")", "{", "if", "(", "way", "==", "null", ")", "{", "LOGGER", ".", "warning", "(", "\"way is null\"", ")", ";", "return", "null", ";", "}...
Converts a way with potential inner ways to a JTS geometry. @param way the way @param innerWays the inner ways or null @return the JTS geometry
[ "Converts", "a", "way", "with", "potential", "inner", "ways", "to", "a", "JTS", "geometry", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/JTSUtils.java#L74-L98
28,331
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/LineString.java
LineString.extractPart
public LineString extractPart(double startDistance, double endDistance) { LineString result = new LineString(); for (int i = 0; i < this.segments.size(); startDistance -= this.segments.get(i).length(), endDistance -= this.segments.get(i).length(), i++) { LineSegment segment = this.segments....
java
public LineString extractPart(double startDistance, double endDistance) { LineString result = new LineString(); for (int i = 0; i < this.segments.size(); startDistance -= this.segments.get(i).length(), endDistance -= this.segments.get(i).length(), i++) { LineSegment segment = this.segments....
[ "public", "LineString", "extractPart", "(", "double", "startDistance", ",", "double", "endDistance", ")", "{", "LineString", "result", "=", "new", "LineString", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "segments", ".",...
Creates a new LineString that consists of only the part between startDistance and endDistance.
[ "Creates", "a", "new", "LineString", "that", "consists", "of", "only", "the", "part", "between", "startDistance", "and", "endDistance", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LineString.java#L48-L89
28,332
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java
SQLiteDebug.shouldLogSlowQuery
public static final boolean shouldLogSlowQuery(long elapsedTimeMillis) { int slowQueryMillis = Integer.parseInt( System.getProperty("db.log.slow_query_threshold", "10000") ); return slowQueryMillis >= 0 && elapsedTimeMillis >= slowQueryMillis; }
java
public static final boolean shouldLogSlowQuery(long elapsedTimeMillis) { int slowQueryMillis = Integer.parseInt( System.getProperty("db.log.slow_query_threshold", "10000") ); return slowQueryMillis >= 0 && elapsedTimeMillis >= slowQueryMillis; }
[ "public", "static", "final", "boolean", "shouldLogSlowQuery", "(", "long", "elapsedTimeMillis", ")", "{", "int", "slowQueryMillis", "=", "Integer", ".", "parseInt", "(", "System", ".", "getProperty", "(", "\"db.log.slow_query_threshold\"", ",", "\"10000\"", ")", ")"...
Determines whether a query should be logged. Reads the "db.log.slow_query_threshold" system property, which can be changed by the user at any time. If the value is zero, then all queries will be considered slow. If the value does not exist or is negative, then no queries will be considered slow. This value can be c...
[ "Determines", "whether", "a", "query", "should", "be", "logged", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java#L85-L90
28,333
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java
SQLiteDebug.getDatabaseInfo
public static PagerStats getDatabaseInfo() { PagerStats stats = new PagerStats(); nativeGetPagerStats(stats); stats.dbStats = SQLiteDatabase.getDbStats(); return stats; }
java
public static PagerStats getDatabaseInfo() { PagerStats stats = new PagerStats(); nativeGetPagerStats(stats); stats.dbStats = SQLiteDatabase.getDbStats(); return stats; }
[ "public", "static", "PagerStats", "getDatabaseInfo", "(", ")", "{", "PagerStats", "stats", "=", "new", "PagerStats", "(", ")", ";", "nativeGetPagerStats", "(", "stats", ")", ";", "stats", ".", "dbStats", "=", "SQLiteDatabase", ".", "getDbStats", "(", ")", ";...
return all pager and database stats for the current process. @return {@link PagerStats}
[ "return", "all", "pager", "and", "database", "stats", "for", "the", "current", "process", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java#L156-L161
28,334
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java
SQLiteDebug.dump
public static void dump(Printer printer, String[] args) { boolean verbose = false; for (String arg : args) { if (arg.equals("-v")) { verbose = true; } } SQLiteDatabase.dumpAll(printer, verbose); }
java
public static void dump(Printer printer, String[] args) { boolean verbose = false; for (String arg : args) { if (arg.equals("-v")) { verbose = true; } } SQLiteDatabase.dumpAll(printer, verbose); }
[ "public", "static", "void", "dump", "(", "Printer", "printer", ",", "String", "[", "]", "args", ")", "{", "boolean", "verbose", "=", "false", ";", "for", "(", "String", "arg", ":", "args", ")", "{", "if", "(", "arg", ".", "equals", "(", "\"-v\"", "...
Dumps detailed information about all databases used by the process. @param printer The printer for dumping database state. @param args Command-line arguments supplied to dumpsys dbinfo
[ "Dumps", "detailed", "information", "about", "all", "databases", "used", "by", "the", "process", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java#L168-L177
28,335
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java
LatLongUtils.distance
public static double distance(LatLong latLong1, LatLong latLong2) { return Math.hypot(latLong1.longitude - latLong2.longitude, latLong1.latitude - latLong2.latitude); }
java
public static double distance(LatLong latLong1, LatLong latLong2) { return Math.hypot(latLong1.longitude - latLong2.longitude, latLong1.latitude - latLong2.latitude); }
[ "public", "static", "double", "distance", "(", "LatLong", "latLong1", ",", "LatLong", "latLong2", ")", "{", "return", "Math", ".", "hypot", "(", "latLong1", ".", "longitude", "-", "latLong2", ".", "longitude", ",", "latLong1", ".", "latitude", "-", "latLong2...
Calculate the Euclidean distance between two LatLongs in degrees using the Pythagorean theorem. @param latLong1 first LatLong @param latLong2 second LatLong @return distance in degrees as a double
[ "Calculate", "the", "Euclidean", "distance", "between", "two", "LatLongs", "in", "degrees", "using", "the", "Pythagorean", "theorem", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L158-L160
28,336
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java
LatLongUtils.fromString
public static LatLong fromString(String latLongString) { double[] coordinates = parseCoordinateString(latLongString, 2); return new LatLong(coordinates[0], coordinates[1]); }
java
public static LatLong fromString(String latLongString) { double[] coordinates = parseCoordinateString(latLongString, 2); return new LatLong(coordinates[0], coordinates[1]); }
[ "public", "static", "LatLong", "fromString", "(", "String", "latLongString", ")", "{", "double", "[", "]", "coordinates", "=", "parseCoordinateString", "(", "latLongString", ",", "2", ")", ";", "return", "new", "LatLong", "(", "coordinates", "[", "0", "]", "...
Creates a new LatLong from a comma-separated string of coordinates in the order latitude, longitude. All coordinate values must be in degrees. @param latLongString the string that describes the LatLong. @return a new LatLong with the given coordinates. @throws IllegalArgumentException if the string cannot be parsed or...
[ "Creates", "a", "new", "LatLong", "from", "a", "comma", "-", "separated", "string", "of", "coordinates", "in", "the", "order", "latitude", "longitude", ".", "All", "coordinate", "values", "must", "be", "in", "degrees", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L180-L183
28,337
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java
LatLongUtils.longitudeDistance
public static double longitudeDistance(int meters, double latitude) { return (meters * 360) / (2 * Math.PI * EQUATORIAL_RADIUS * Math.cos(Math.toRadians(latitude))); }
java
public static double longitudeDistance(int meters, double latitude) { return (meters * 360) / (2 * Math.PI * EQUATORIAL_RADIUS * Math.cos(Math.toRadians(latitude))); }
[ "public", "static", "double", "longitudeDistance", "(", "int", "meters", ",", "double", "latitude", ")", "{", "return", "(", "meters", "*", "360", ")", "/", "(", "2", "*", "Math", ".", "PI", "*", "EQUATORIAL_RADIUS", "*", "Math", ".", "cos", "(", "Math...
Calculates the amount of degrees of longitude for a given distance in meters. @param meters distance in meters @param latitude the latitude at which the calculation should be performed @return longitude degrees
[ "Calculates", "the", "amount", "of", "degrees", "of", "longitude", "for", "a", "given", "distance", "in", "meters", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L211-L213
28,338
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java
LatLongUtils.parseCoordinateString
public static double[] parseCoordinateString(String coordinatesString, int numberOfCoordinates) { StringTokenizer stringTokenizer = new StringTokenizer(coordinatesString, DELIMITER, true); boolean isDelimiter = true; List<String> tokens = new ArrayList<>(numberOfCoordinates); while (str...
java
public static double[] parseCoordinateString(String coordinatesString, int numberOfCoordinates) { StringTokenizer stringTokenizer = new StringTokenizer(coordinatesString, DELIMITER, true); boolean isDelimiter = true; List<String> tokens = new ArrayList<>(numberOfCoordinates); while (str...
[ "public", "static", "double", "[", "]", "parseCoordinateString", "(", "String", "coordinatesString", ",", "int", "numberOfCoordinates", ")", "{", "StringTokenizer", "stringTokenizer", "=", "new", "StringTokenizer", "(", "coordinatesString", ",", "DELIMITER", ",", "tru...
Parses a given number of comma-separated coordinate values from the supplied string. @param coordinatesString a comma-separated string of coordinate values. @param numberOfCoordinates the expected number of coordinate values in the string. @return the coordinate values in the order they have been parsed from the str...
[ "Parses", "a", "given", "number", "of", "comma", "-", "separated", "coordinate", "values", "from", "the", "supplied", "string", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L249-L275
28,339
mapsforge/mapsforge
mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/cluster/ClusterMarker.java
ClusterMarker.setMarkerBitmap
private void setMarkerBitmap() { for (markerType = 0; markerType < cluster.getClusterManager().markerIconBmps.size(); markerType++) { // Check if the number of items in this cluster is below or equal the limit of the MarkerBitMap if (cluster.getItems().size() <= cluster.getClusterManager...
java
private void setMarkerBitmap() { for (markerType = 0; markerType < cluster.getClusterManager().markerIconBmps.size(); markerType++) { // Check if the number of items in this cluster is below or equal the limit of the MarkerBitMap if (cluster.getItems().size() <= cluster.getClusterManager...
[ "private", "void", "setMarkerBitmap", "(", ")", "{", "for", "(", "markerType", "=", "0", ";", "markerType", "<", "cluster", ".", "getClusterManager", "(", ")", ".", "markerIconBmps", ".", "size", "(", ")", ";", "markerType", "++", ")", "{", "// Check if th...
change icon bitmaps according to the state and content size.
[ "change", "icon", "bitmaps", "according", "to", "the", "state", "and", "content", "size", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/cluster/ClusterMarker.java#L68-L78
28,340
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteSession.java
SQLiteSession.executeSpecial
private boolean executeSpecial(String sql, Object[] bindArgs, int connectionFlags, CancellationSignal cancellationSignal) { if (cancellationSignal != null) { cancellationSignal.throwIfCanceled(); } final int type = DatabaseUtils.getSqlStatementType(sql); switch (...
java
private boolean executeSpecial(String sql, Object[] bindArgs, int connectionFlags, CancellationSignal cancellationSignal) { if (cancellationSignal != null) { cancellationSignal.throwIfCanceled(); } final int type = DatabaseUtils.getSqlStatementType(sql); switch (...
[ "private", "boolean", "executeSpecial", "(", "String", "sql", ",", "Object", "[", "]", "bindArgs", ",", "int", "connectionFlags", ",", "CancellationSignal", "cancellationSignal", ")", "{", "if", "(", "cancellationSignal", "!=", "null", ")", "{", "cancellationSigna...
Performs special reinterpretation of certain SQL statements such as "BEGIN", "COMMIT" and "ROLLBACK" to ensure that transaction state invariants are maintained. This function is mainly used to support legacy apps that perform their own transactions by executing raw SQL rather than calling {@link #beginTransaction} and...
[ "Performs", "special", "reinterpretation", "of", "certain", "SQL", "statements", "such", "as", "BEGIN", "COMMIT", "and", "ROLLBACK", "to", "ensure", "that", "transaction", "state", "invariants", "are", "maintained", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteSession.java#L869-L892
28,341
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DefaultDatabaseErrorHandler.java
DefaultDatabaseErrorHandler.onCorruption
public void onCorruption(SQLiteDatabase dbObj) { Log.e(TAG, "Corruption reported by sqlite on database: " + dbObj.getPath()); // If this is a SEE build, do not delete any database files. // It may be that the user has specified an incorrect password. if( SQLiteDatabase.hasCodec() ) return; /...
java
public void onCorruption(SQLiteDatabase dbObj) { Log.e(TAG, "Corruption reported by sqlite on database: " + dbObj.getPath()); // If this is a SEE build, do not delete any database files. // It may be that the user has specified an incorrect password. if( SQLiteDatabase.hasCodec() ) return; /...
[ "public", "void", "onCorruption", "(", "SQLiteDatabase", "dbObj", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"Corruption reported by sqlite on database: \"", "+", "dbObj", ".", "getPath", "(", ")", ")", ";", "// If this is a SEE build, do not delete any database file...
defines the default method to be invoked when database corruption is detected. @param dbObj the {@link SQLiteDatabase} object representing the database on which corruption is detected.
[ "defines", "the", "default", "method", "to", "be", "invoked", "when", "database", "corruption", "is", "detected", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DefaultDatabaseErrorHandler.java#L58-L103
28,342
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnection.java
SQLiteConnection.executeForBlobFileDescriptor
public ParcelFileDescriptor executeForBlobFileDescriptor(String sql, Object[] bindArgs, CancellationSignal cancellationSignal) { if (sql == null) { throw new IllegalArgumentException("sql must not be null."); } final int cookie = mRecentOperations.beginOperation("execute...
java
public ParcelFileDescriptor executeForBlobFileDescriptor(String sql, Object[] bindArgs, CancellationSignal cancellationSignal) { if (sql == null) { throw new IllegalArgumentException("sql must not be null."); } final int cookie = mRecentOperations.beginOperation("execute...
[ "public", "ParcelFileDescriptor", "executeForBlobFileDescriptor", "(", "String", "sql", ",", "Object", "[", "]", "bindArgs", ",", "CancellationSignal", "cancellationSignal", ")", "{", "if", "(", "sql", "==", "null", ")", "{", "throw", "new", "IllegalArgumentExceptio...
Executes a statement that returns a single BLOB result as a file descriptor to a shared memory region. @param sql The SQL statement to execute. @param bindArgs The arguments to bind, or null if none. @param cancellationSignal A signal to cancel the operation in progress, or null if none. @return The file descriptor fo...
[ "Executes", "a", "statement", "that", "returns", "a", "single", "BLOB", "result", "as", "a", "file", "descriptor", "to", "a", "shared", "memory", "region", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnection.java#L683-L714
28,343
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnection.java
SQLiteConnection.executeForChangedRowCount
public int executeForChangedRowCount(String sql, Object[] bindArgs, CancellationSignal cancellationSignal) { if (sql == null) { throw new IllegalArgumentException("sql must not be null."); } int changedRows = 0; final int cookie = mRecentOperations.beginOperation...
java
public int executeForChangedRowCount(String sql, Object[] bindArgs, CancellationSignal cancellationSignal) { if (sql == null) { throw new IllegalArgumentException("sql must not be null."); } int changedRows = 0; final int cookie = mRecentOperations.beginOperation...
[ "public", "int", "executeForChangedRowCount", "(", "String", "sql", ",", "Object", "[", "]", "bindArgs", ",", "CancellationSignal", "cancellationSignal", ")", "{", "if", "(", "sql", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"sql ...
Executes a statement that returns a count of the number of rows that were changed. Use for UPDATE or DELETE SQL statements. @param sql The SQL statement to execute. @param bindArgs The arguments to bind, or null if none. @param cancellationSignal A signal to cancel the operation in progress, or null if none. @return ...
[ "Executes", "a", "statement", "that", "returns", "a", "count", "of", "the", "number", "of", "rows", "that", "were", "changed", ".", "Use", "for", "UPDATE", "or", "DELETE", "SQL", "statements", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnection.java#L729-L763
28,344
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/datastore/MultiMapDataStore.java
MultiMapDataStore.addMapDataStore
public void addMapDataStore(MapDataStore mapDataStore, boolean useStartZoomLevel, boolean useStartPosition) { if (this.mapDatabases.contains(mapDataStore)) { throw new IllegalArgumentException("Duplicate map database"); } this.mapDatabases.add(mapDataStore); if (useStartZoomL...
java
public void addMapDataStore(MapDataStore mapDataStore, boolean useStartZoomLevel, boolean useStartPosition) { if (this.mapDatabases.contains(mapDataStore)) { throw new IllegalArgumentException("Duplicate map database"); } this.mapDatabases.add(mapDataStore); if (useStartZoomL...
[ "public", "void", "addMapDataStore", "(", "MapDataStore", "mapDataStore", ",", "boolean", "useStartZoomLevel", ",", "boolean", "useStartPosition", ")", "{", "if", "(", "this", ".", "mapDatabases", ".", "contains", "(", "mapDataStore", ")", ")", "{", "throw", "ne...
adds another mapDataStore @param mapDataStore the mapDataStore to add @param useStartZoomLevel if true, use the start zoom level of this mapDataStore as the start zoom level @param useStartPosition if true, use the start position of this mapDataStore as the start position
[ "adds", "another", "mapDataStore" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/datastore/MultiMapDataStore.java#L65-L81
28,345
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteProgram.java
SQLiteProgram.bindAllArgsAsStrings
public void bindAllArgsAsStrings(String[] bindArgs) { if (bindArgs != null) { for (int i = bindArgs.length; i != 0; i--) { bindString(i, bindArgs[i - 1]); } } }
java
public void bindAllArgsAsStrings(String[] bindArgs) { if (bindArgs != null) { for (int i = bindArgs.length; i != 0; i--) { bindString(i, bindArgs[i - 1]); } } }
[ "public", "void", "bindAllArgsAsStrings", "(", "String", "[", "]", "bindArgs", ")", "{", "if", "(", "bindArgs", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "bindArgs", ".", "length", ";", "i", "!=", "0", ";", "i", "--", ")", "{", "bindStri...
Given an array of String bindArgs, this method binds all of them in one single call. @param bindArgs the String array of bind args, none of which must be null.
[ "Given", "an", "array", "of", "String", "bindArgs", "this", "method", "binds", "all", "of", "them", "in", "one", "single", "call", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteProgram.java#L201-L207
28,346
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/sqlite/CloseGuard.java
CloseGuard.warnIfOpen
public void warnIfOpen() { if (allocationSite == null || !ENABLED) { return; } String message = ("A resource was acquired at attached stack trace but never released. " + "See java.io.Closeable for information on avoiding resource leaks."); R...
java
public void warnIfOpen() { if (allocationSite == null || !ENABLED) { return; } String message = ("A resource was acquired at attached stack trace but never released. " + "See java.io.Closeable for information on avoiding resource leaks."); R...
[ "public", "void", "warnIfOpen", "(", ")", "{", "if", "(", "allocationSite", "==", "null", "||", "!", "ENABLED", ")", "{", "return", ";", "}", "String", "message", "=", "(", "\"A resource was acquired at attached stack trace but never released. \"", "+", "\"See java....
If CloseGuard is enabled, logs a warning if the caller did not properly cleanup by calling an explicit close method before finalization. If CloseGuard is disabled, no action is performed.
[ "If", "CloseGuard", "is", "enabled", "logs", "a", "warning", "if", "the", "caller", "did", "not", "properly", "cleanup", "by", "calling", "an", "explicit", "close", "method", "before", "finalization", ".", "If", "CloseGuard", "is", "disabled", "no", "action", ...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/CloseGuard.java#L208-L218
28,347
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/LatLong.java
LatLong.compareTo
@Override public int compareTo(LatLong latLong) { if (this.latitude > latLong.latitude || this.longitude > latLong.longitude) { return 1; } else if (this.latitude < latLong.latitude || this.longitude < latLong.longitude) { return -1; } return 0...
java
@Override public int compareTo(LatLong latLong) { if (this.latitude > latLong.latitude || this.longitude > latLong.longitude) { return 1; } else if (this.latitude < latLong.latitude || this.longitude < latLong.longitude) { return -1; } return 0...
[ "@", "Override", "public", "int", "compareTo", "(", "LatLong", "latLong", ")", "{", "if", "(", "this", ".", "latitude", ">", "latLong", ".", "latitude", "||", "this", ".", "longitude", ">", "latLong", ".", "longitude", ")", "{", "return", "1", ";", "}"...
This method is necessary for inserting LatLongs into tree data structures.
[ "This", "method", "is", "necessary", "for", "inserting", "LatLongs", "into", "tree", "data", "structures", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LatLong.java#L76-L85
28,348
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/LatLong.java
LatLong.fromMicroDegrees
public static LatLong fromMicroDegrees(int latitudeE6, int longitudeE6) { return new LatLong(LatLongUtils.microdegreesToDegrees(latitudeE6), LatLongUtils.microdegreesToDegrees(longitudeE6)); }
java
public static LatLong fromMicroDegrees(int latitudeE6, int longitudeE6) { return new LatLong(LatLongUtils.microdegreesToDegrees(latitudeE6), LatLongUtils.microdegreesToDegrees(longitudeE6)); }
[ "public", "static", "LatLong", "fromMicroDegrees", "(", "int", "latitudeE6", ",", "int", "longitudeE6", ")", "{", "return", "new", "LatLong", "(", "LatLongUtils", ".", "microdegreesToDegrees", "(", "latitudeE6", ")", ",", "LatLongUtils", ".", "microdegreesToDegrees"...
Constructs a new LatLong with the given latitude and longitude values, measured in microdegrees. @param latitudeE6 the latitude value in microdegrees. @param longitudeE6 the longitude value in microdegrees. @return the LatLong @throws IllegalArgumentException if the latitudeE6 or longitudeE6 value is invalid.
[ "Constructs", "a", "new", "LatLong", "with", "the", "given", "latitude", "and", "longitude", "values", "measured", "in", "microdegrees", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LatLong.java#L136-L139
28,349
mapsforge/mapsforge
mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/SimplestMapViewer.java
SimplestMapViewer.createLayers
@Override protected void createLayers() { TileRendererLayer tileRendererLayer = AndroidUtil.createTileRendererLayer(this.tileCaches.get(0), this.mapView.getModel().mapViewPosition, getMapFile(), getRenderTheme(), false, true, false); this.mapView.getLayerManager().getLayers().add(til...
java
@Override protected void createLayers() { TileRendererLayer tileRendererLayer = AndroidUtil.createTileRendererLayer(this.tileCaches.get(0), this.mapView.getModel().mapViewPosition, getMapFile(), getRenderTheme(), false, true, false); this.mapView.getLayerManager().getLayers().add(til...
[ "@", "Override", "protected", "void", "createLayers", "(", ")", "{", "TileRendererLayer", "tileRendererLayer", "=", "AndroidUtil", ".", "createTileRendererLayer", "(", "this", ".", "tileCaches", ".", "get", "(", "0", ")", ",", "this", ".", "mapView", ".", "get...
Creates a simple tile renderer layer with the AndroidUtil helper.
[ "Creates", "a", "simple", "tile", "renderer", "layer", "with", "the", "AndroidUtil", "helper", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/SimplestMapViewer.java#L76-L81
28,350
mapsforge/mapsforge
mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/SimplestMapViewer.java
SimplestMapViewer.createTileCaches
@Override protected void createTileCaches() { this.tileCaches.add(AndroidUtil.createTileCache(this, getPersistableId(), this.mapView.getModel().displayModel.getTileSize(), this.getScreenRatio(), this.mapView.getModel().frameBufferModel.getOverdrawFactor())); }
java
@Override protected void createTileCaches() { this.tileCaches.add(AndroidUtil.createTileCache(this, getPersistableId(), this.mapView.getModel().displayModel.getTileSize(), this.getScreenRatio(), this.mapView.getModel().frameBufferModel.getOverdrawFactor())); }
[ "@", "Override", "protected", "void", "createTileCaches", "(", ")", "{", "this", ".", "tileCaches", ".", "add", "(", "AndroidUtil", ".", "createTileCache", "(", "this", ",", "getPersistableId", "(", ")", ",", "this", ".", "mapView", ".", "getModel", "(", "...
Creates the tile cache with the AndroidUtil helper
[ "Creates", "the", "tile", "cache", "with", "the", "AndroidUtil", "helper" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/SimplestMapViewer.java#L91-L96
28,351
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getBoundingBox
public static BoundingBox getBoundingBox(Tile upperLeft, Tile lowerRight) { BoundingBox ul = upperLeft.getBoundingBox(); BoundingBox lr = lowerRight.getBoundingBox(); return ul.extendBoundingBox(lr); }
java
public static BoundingBox getBoundingBox(Tile upperLeft, Tile lowerRight) { BoundingBox ul = upperLeft.getBoundingBox(); BoundingBox lr = lowerRight.getBoundingBox(); return ul.extendBoundingBox(lr); }
[ "public", "static", "BoundingBox", "getBoundingBox", "(", "Tile", "upperLeft", ",", "Tile", "lowerRight", ")", "{", "BoundingBox", "ul", "=", "upperLeft", ".", "getBoundingBox", "(", ")", ";", "BoundingBox", "lr", "=", "lowerRight", ".", "getBoundingBox", "(", ...
Return the BoundingBox of a rectangle of tiles defined by upper left and lower right tile. @param upperLeft tile in upper left corner. @param lowerRight tile in lower right corner. @return BoundingBox defined by the area around upperLeft and lowerRight Tile.
[ "Return", "the", "BoundingBox", "of", "a", "rectangle", "of", "tiles", "defined", "by", "upper", "left", "and", "lower", "right", "tile", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L38-L42
28,352
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getBoundaryAbsolute
public static Rectangle getBoundaryAbsolute(Tile upperLeft, Tile lowerRight) { return new Rectangle(upperLeft.getOrigin().x, upperLeft.getOrigin().y, lowerRight.getOrigin().x + upperLeft.tileSize, lowerRight.getOrigin().y + upperLeft.tileSize); }
java
public static Rectangle getBoundaryAbsolute(Tile upperLeft, Tile lowerRight) { return new Rectangle(upperLeft.getOrigin().x, upperLeft.getOrigin().y, lowerRight.getOrigin().x + upperLeft.tileSize, lowerRight.getOrigin().y + upperLeft.tileSize); }
[ "public", "static", "Rectangle", "getBoundaryAbsolute", "(", "Tile", "upperLeft", ",", "Tile", "lowerRight", ")", "{", "return", "new", "Rectangle", "(", "upperLeft", ".", "getOrigin", "(", ")", ".", "x", ",", "upperLeft", ".", "getOrigin", "(", ")", ".", ...
Extend of the area defined by the two tiles in absolute coordinates. @param upperLeft tile in upper left corner of area. @param lowerRight tile in lower right corner of area. @return rectangle with the absolute coordinates.
[ "Extend", "of", "the", "area", "defined", "by", "the", "two", "tiles", "in", "absolute", "coordinates", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L51-L53
28,353
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getBoundingBox
public BoundingBox getBoundingBox() { if (this.boundingBox == null) { double minLatitude = Math.max(MercatorProjection.LATITUDE_MIN, MercatorProjection.tileYToLatitude(tileY + 1, zoomLevel)); double minLongitude = Math.max(-180, MercatorProjection.tileXToLongitude(this.tileX, zoomLevel))...
java
public BoundingBox getBoundingBox() { if (this.boundingBox == null) { double minLatitude = Math.max(MercatorProjection.LATITUDE_MIN, MercatorProjection.tileYToLatitude(tileY + 1, zoomLevel)); double minLongitude = Math.max(-180, MercatorProjection.tileXToLongitude(this.tileX, zoomLevel))...
[ "public", "BoundingBox", "getBoundingBox", "(", ")", "{", "if", "(", "this", ".", "boundingBox", "==", "null", ")", "{", "double", "minLatitude", "=", "Math", ".", "max", "(", "MercatorProjection", ".", "LATITUDE_MIN", ",", "MercatorProjection", ".", "tileYToL...
Gets the geographic extend of this Tile as a BoundingBox. @return boundaries of this tile.
[ "Gets", "the", "geographic", "extend", "of", "this", "Tile", "as", "a", "BoundingBox", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L170-L183
28,354
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getNeighbours
public Set<Tile> getNeighbours() { Set<Tile> neighbours = new HashSet<Tile>(8); neighbours.add(getLeft()); neighbours.add(getAboveLeft()); neighbours.add(getAbove()); neighbours.add(getAboveRight()); neighbours.add(getRight()); neighbours.add(getBelowRight()); ...
java
public Set<Tile> getNeighbours() { Set<Tile> neighbours = new HashSet<Tile>(8); neighbours.add(getLeft()); neighbours.add(getAboveLeft()); neighbours.add(getAbove()); neighbours.add(getAboveRight()); neighbours.add(getRight()); neighbours.add(getBelowRight()); ...
[ "public", "Set", "<", "Tile", ">", "getNeighbours", "(", ")", "{", "Set", "<", "Tile", ">", "neighbours", "=", "new", "HashSet", "<", "Tile", ">", "(", "8", ")", ";", "neighbours", ".", "add", "(", "getLeft", "(", ")", ")", ";", "neighbours", ".", ...
Returns a set of the eight neighbours of this tile. @return neighbour tiles as a set
[ "Returns", "a", "set", "of", "the", "eight", "neighbours", "of", "this", "tile", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L190-L201
28,355
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getBoundaryAbsolute
public Rectangle getBoundaryAbsolute() { return new Rectangle(getOrigin().x, getOrigin().y, getOrigin().x + tileSize, getOrigin().y + tileSize); }
java
public Rectangle getBoundaryAbsolute() { return new Rectangle(getOrigin().x, getOrigin().y, getOrigin().x + tileSize, getOrigin().y + tileSize); }
[ "public", "Rectangle", "getBoundaryAbsolute", "(", ")", "{", "return", "new", "Rectangle", "(", "getOrigin", "(", ")", ".", "x", ",", "getOrigin", "(", ")", ".", "y", ",", "getOrigin", "(", ")", ".", "x", "+", "tileSize", ",", "getOrigin", "(", ")", ...
Extend of this tile in absolute coordinates. @return rectangle with the absolute coordinates.
[ "Extend", "of", "this", "tile", "in", "absolute", "coordinates", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L208-L210
28,356
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getOrigin
public Point getOrigin() { if (this.origin == null) { double x = MercatorProjection.tileToPixel(this.tileX, this.tileSize); double y = MercatorProjection.tileToPixel(this.tileY, this.tileSize); this.origin = new Point(x, y); } return this.origin; }
java
public Point getOrigin() { if (this.origin == null) { double x = MercatorProjection.tileToPixel(this.tileX, this.tileSize); double y = MercatorProjection.tileToPixel(this.tileY, this.tileSize); this.origin = new Point(x, y); } return this.origin; }
[ "public", "Point", "getOrigin", "(", ")", "{", "if", "(", "this", ".", "origin", "==", "null", ")", "{", "double", "x", "=", "MercatorProjection", ".", "tileToPixel", "(", "this", ".", "tileX", ",", "this", ".", "tileSize", ")", ";", "double", "y", "...
Returns the top-left point of this tile in absolute coordinates. @return the top-left point
[ "Returns", "the", "top", "-", "left", "point", "of", "this", "tile", "in", "absolute", "coordinates", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L227-L234
28,357
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getLeft
public Tile getLeft() { int x = tileX - 1; if (x < 0) { x = getMaxTileNumber(this.zoomLevel); } return new Tile(x, this.tileY, this.zoomLevel, this.tileSize); }
java
public Tile getLeft() { int x = tileX - 1; if (x < 0) { x = getMaxTileNumber(this.zoomLevel); } return new Tile(x, this.tileY, this.zoomLevel, this.tileSize); }
[ "public", "Tile", "getLeft", "(", ")", "{", "int", "x", "=", "tileX", "-", "1", ";", "if", "(", "x", "<", "0", ")", "{", "x", "=", "getMaxTileNumber", "(", "this", ".", "zoomLevel", ")", ";", "}", "return", "new", "Tile", "(", "x", ",", "this",...
Returns the tile to the left of this tile. @return tile to the left.
[ "Returns", "the", "tile", "to", "the", "left", "of", "this", "tile", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L241-L247
28,358
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getRight
public Tile getRight() { int x = tileX + 1; if (x > getMaxTileNumber(this.zoomLevel)) { x = 0; } return new Tile(x, this.tileY, this.zoomLevel, this.tileSize); }
java
public Tile getRight() { int x = tileX + 1; if (x > getMaxTileNumber(this.zoomLevel)) { x = 0; } return new Tile(x, this.tileY, this.zoomLevel, this.tileSize); }
[ "public", "Tile", "getRight", "(", ")", "{", "int", "x", "=", "tileX", "+", "1", ";", "if", "(", "x", ">", "getMaxTileNumber", "(", "this", ".", "zoomLevel", ")", ")", "{", "x", "=", "0", ";", "}", "return", "new", "Tile", "(", "x", ",", "this"...
Returns the tile to the right of this tile. @return tile to the right
[ "Returns", "the", "tile", "to", "the", "right", "of", "this", "tile", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L254-L260
28,359
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getAbove
public Tile getAbove() { int y = tileY - 1; if (y < 0) { y = getMaxTileNumber(this.zoomLevel); } return new Tile(this.tileX, y, this.zoomLevel, this.tileSize); }
java
public Tile getAbove() { int y = tileY - 1; if (y < 0) { y = getMaxTileNumber(this.zoomLevel); } return new Tile(this.tileX, y, this.zoomLevel, this.tileSize); }
[ "public", "Tile", "getAbove", "(", ")", "{", "int", "y", "=", "tileY", "-", "1", ";", "if", "(", "y", "<", "0", ")", "{", "y", "=", "getMaxTileNumber", "(", "this", ".", "zoomLevel", ")", ";", "}", "return", "new", "Tile", "(", "this", ".", "ti...
Returns the tile above this tile. @return tile above
[ "Returns", "the", "tile", "above", "this", "tile", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L267-L273
28,360
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getBelow
public Tile getBelow() { int y = tileY + 1; if (y > getMaxTileNumber(this.zoomLevel)) { y = 0; } return new Tile(this.tileX, y, this.zoomLevel, this.tileSize); }
java
public Tile getBelow() { int y = tileY + 1; if (y > getMaxTileNumber(this.zoomLevel)) { y = 0; } return new Tile(this.tileX, y, this.zoomLevel, this.tileSize); }
[ "public", "Tile", "getBelow", "(", ")", "{", "int", "y", "=", "tileY", "+", "1", ";", "if", "(", "y", ">", "getMaxTileNumber", "(", "this", ".", "zoomLevel", ")", ")", "{", "y", "=", "0", ";", "}", "return", "new", "Tile", "(", "this", ".", "ti...
Returns the tile below this tile. @return tile below
[ "Returns", "the", "tile", "below", "this", "tile", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L281-L287
28,361
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java
Tile.getAboveLeft
public Tile getAboveLeft() { int y = tileY - 1; int x = tileX - 1; if (y < 0) { y = getMaxTileNumber(this.zoomLevel); } if (x < 0) { x = getMaxTileNumber(this.zoomLevel); } return new Tile(x, y, this.zoomLevel, this.tileSize); }
java
public Tile getAboveLeft() { int y = tileY - 1; int x = tileX - 1; if (y < 0) { y = getMaxTileNumber(this.zoomLevel); } if (x < 0) { x = getMaxTileNumber(this.zoomLevel); } return new Tile(x, y, this.zoomLevel, this.tileSize); }
[ "public", "Tile", "getAboveLeft", "(", ")", "{", "int", "y", "=", "tileY", "-", "1", ";", "int", "x", "=", "tileX", "-", "1", ";", "if", "(", "y", "<", "0", ")", "{", "y", "=", "getMaxTileNumber", "(", "this", ".", "zoomLevel", ")", ";", "}", ...
Returns the tile above left @return tile above left
[ "Returns", "the", "tile", "above", "left" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L294-L304
28,362
mapsforge/mapsforge
mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/group/ChildMarker.java
ChildMarker.init
public void init(int index, Bitmap bitmap, int horizontalOffset, int verticalOffset) { this.index = index; this.groupBitmapHalfHeight = bitmap.getHeight() / 2; this.groupBitmapHalfWidth = bitmap.getWidth() / 2; this.groupHOffset = horizontalOffset; this.groupVOffset = verticalOf...
java
public void init(int index, Bitmap bitmap, int horizontalOffset, int verticalOffset) { this.index = index; this.groupBitmapHalfHeight = bitmap.getHeight() / 2; this.groupBitmapHalfWidth = bitmap.getWidth() / 2; this.groupHOffset = horizontalOffset; this.groupVOffset = verticalOf...
[ "public", "void", "init", "(", "int", "index", ",", "Bitmap", "bitmap", ",", "int", "horizontalOffset", ",", "int", "verticalOffset", ")", "{", "this", ".", "index", "=", "index", ";", "this", ".", "groupBitmapHalfHeight", "=", "bitmap", ".", "getHeight", ...
Set group marker parameter. To know index and calculate position on spiral. @param index the index of this child marker. @param bitmap the bitmap of the group marker. @param horizontalOffset the horizontal offset of the group marker. @param verticalOffset the vertical offset of the group marker.
[ "Set", "group", "marker", "parameter", ".", "To", "know", "index", "and", "calculate", "position", "on", "spiral", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/group/ChildMarker.java#L125-L132
28,363
mapsforge/mapsforge
mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/BaseTileBasedDataProcessor.java
BaseTileBasedDataProcessor.addImplicitRelationInformation
protected void addImplicitRelationInformation(TDWay tdWay) { if (!this.tagValues) { return; } // FEATURE Remove this to add id to all elements (increase of space around 1/8) if (!this.partRootRelations.containsKey(tdWay.getId())) { return; } Long...
java
protected void addImplicitRelationInformation(TDWay tdWay) { if (!this.tagValues) { return; } // FEATURE Remove this to add id to all elements (increase of space around 1/8) if (!this.partRootRelations.containsKey(tdWay.getId())) { return; } Long...
[ "protected", "void", "addImplicitRelationInformation", "(", "TDWay", "tdWay", ")", "{", "if", "(", "!", "this", ".", "tagValues", ")", "{", "return", ";", "}", "// FEATURE Remove this to add id to all elements (increase of space around 1/8)", "if", "(", "!", "this", "...
Add tags to ways which describe the geo-inheritance. @param tdWay the way which should get the tags
[ "Add", "tags", "to", "ways", "which", "describe", "the", "geo", "-", "inheritance", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/BaseTileBasedDataProcessor.java#L448-L480
28,364
mapsforge/mapsforge
mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/BaseTileBasedDataProcessor.java
BaseTileBasedDataProcessor.countPoiTags
protected void countPoiTags(TDNode poi) { if (poi == null || poi.getTags() == null) { return; } for (short tag : poi.getTags().keySet()) { this.histogramPoiTags.adjustOrPutValue(tag, 1, 1); } }
java
protected void countPoiTags(TDNode poi) { if (poi == null || poi.getTags() == null) { return; } for (short tag : poi.getTags().keySet()) { this.histogramPoiTags.adjustOrPutValue(tag, 1, 1); } }
[ "protected", "void", "countPoiTags", "(", "TDNode", "poi", ")", "{", "if", "(", "poi", "==", "null", "||", "poi", ".", "getTags", "(", ")", "==", "null", ")", "{", "return", ";", "}", "for", "(", "short", "tag", ":", "poi", ".", "getTags", "(", "...
Count tags to optimize order of POI tag data. @param poi the poi which contains tags
[ "Count", "tags", "to", "optimize", "order", "of", "POI", "tag", "data", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/BaseTileBasedDataProcessor.java#L536-L543
28,365
mapsforge/mapsforge
mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/BaseTileBasedDataProcessor.java
BaseTileBasedDataProcessor.handleImplicitWayRelations
protected void handleImplicitWayRelations() { if (!this.tagValues) { return; } /*int progressImplicitRelations = 0; float limitImplicitRelations = this.tilesToPartElements.entrySet().size();*/ // Iterate through tiles which contain parts for (Map.Entry<TileC...
java
protected void handleImplicitWayRelations() { if (!this.tagValues) { return; } /*int progressImplicitRelations = 0; float limitImplicitRelations = this.tilesToPartElements.entrySet().size();*/ // Iterate through tiles which contain parts for (Map.Entry<TileC...
[ "protected", "void", "handleImplicitWayRelations", "(", ")", "{", "if", "(", "!", "this", ".", "tagValues", ")", "{", "return", ";", "}", "/*int progressImplicitRelations = 0;\n float limitImplicitRelations = this.tilesToPartElements.entrySet().size();*/", "// Iterate thro...
Calculate ids of ways whose polygon inherits part elements.
[ "Calculate", "ids", "of", "ways", "whose", "polygon", "inherits", "part", "elements", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/BaseTileBasedDataProcessor.java#L571-L667
28,366
mapsforge/mapsforge
mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/WayDecorator.java
WayDecorator.renderText
static void renderText(GraphicFactory graphicFactory, Tile upperLeft, Tile lowerRight, String text, Display display, int priority, float dy, Paint fill, Paint stroke, boolean repeat, float repeatGap, float repeatStart, boolean rotate, Point[][] coordinates, ...
java
static void renderText(GraphicFactory graphicFactory, Tile upperLeft, Tile lowerRight, String text, Display display, int priority, float dy, Paint fill, Paint stroke, boolean repeat, float repeatGap, float repeatStart, boolean rotate, Point[][] coordinates, ...
[ "static", "void", "renderText", "(", "GraphicFactory", "graphicFactory", ",", "Tile", "upperLeft", ",", "Tile", "lowerRight", ",", "String", "text", ",", "Display", "display", ",", "int", "priority", ",", "float", "dy", ",", "Paint", "fill", ",", "Paint", "s...
Finds the segments of a line along which a name can be drawn and then adds WayTextContainers to the list of drawable items. @param upperLeft the tile in the upper left corner of the drawing pane @param lowerRight the tile in the lower right corner of the drawing pane @param text the text to draw @param...
[ "Finds", "the", "segments", "of", "a", "line", "along", "which", "a", "name", "can", "be", "drawn", "and", "then", "adds", "WayTextContainers", "to", "the", "list", "of", "drawable", "items", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/WayDecorator.java#L127-L173
28,367
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.writeExceptionToParcel
public static final void writeExceptionToParcel(Parcel reply, Exception e) { int code = 0; boolean logException = true; if (e instanceof FileNotFoundException) { code = 1; logException = false; } else if (e instanceof IllegalArgumentException) { code =...
java
public static final void writeExceptionToParcel(Parcel reply, Exception e) { int code = 0; boolean logException = true; if (e instanceof FileNotFoundException) { code = 1; logException = false; } else if (e instanceof IllegalArgumentException) { code =...
[ "public", "static", "final", "void", "writeExceptionToParcel", "(", "Parcel", "reply", ",", "Exception", "e", ")", "{", "int", "code", "=", "0", ";", "boolean", "logException", "=", "true", ";", "if", "(", "e", "instanceof", "FileNotFoundException", ")", "{"...
Special function for writing an exception result at the header of a parcel, to be used when returning an exception from a transaction. exception will be re-thrown by the function in another process @param reply Parcel to write to @param e The Exception to be written. @see Parcel#writeNoException @see Parcel#writeExcept...
[ "Special", "function", "for", "writing", "an", "exception", "result", "at", "the", "header", "of", "a", "parcel", "to", "be", "used", "when", "returning", "an", "exception", "from", "a", "transaction", ".", "exception", "will", "be", "re", "-", "thrown", "...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L87-L125
28,368
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorFillWindow
public static void cursorFillWindow(final Cursor cursor, int position, final CursorWindow window) { if (position < 0 || position >= cursor.getCount()) { return; } final int oldPos = cursor.getPosition(); final int numColumns = cursor.getColumnCount(); wind...
java
public static void cursorFillWindow(final Cursor cursor, int position, final CursorWindow window) { if (position < 0 || position >= cursor.getCount()) { return; } final int oldPos = cursor.getPosition(); final int numColumns = cursor.getColumnCount(); wind...
[ "public", "static", "void", "cursorFillWindow", "(", "final", "Cursor", "cursor", ",", "int", "position", ",", "final", "CursorWindow", "window", ")", "{", "if", "(", "position", "<", "0", "||", "position", ">=", "cursor", ".", "getCount", "(", ")", ")", ...
Fills the specified cursor window by iterating over the contents of the cursor. The window is filled until the cursor is exhausted or the window runs out of space. The original position of the cursor is left unchanged by this operation. @param cursor The cursor that contains the data to put in the window. @param posi...
[ "Fills", "the", "specified", "cursor", "window", "by", "iterating", "over", "the", "contents", "of", "the", "cursor", ".", "The", "window", "is", "filled", "until", "the", "cursor", "is", "exhausted", "or", "the", "window", "runs", "out", "of", "space", "....
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L267-L322
28,369
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.appendEscapedSQLString
public static void appendEscapedSQLString(StringBuilder sb, String sqlString) { sb.append('\''); if (sqlString.indexOf('\'') != -1) { int length = sqlString.length(); for (int i = 0; i < length; i++) { char c = sqlString.charAt(i); if (c == '\'') {...
java
public static void appendEscapedSQLString(StringBuilder sb, String sqlString) { sb.append('\''); if (sqlString.indexOf('\'') != -1) { int length = sqlString.length(); for (int i = 0; i < length; i++) { char c = sqlString.charAt(i); if (c == '\'') {...
[ "public", "static", "void", "appendEscapedSQLString", "(", "StringBuilder", "sb", ",", "String", "sqlString", ")", "{", "sb", ".", "append", "(", "'", "'", ")", ";", "if", "(", "sqlString", ".", "indexOf", "(", "'", "'", ")", "!=", "-", "1", ")", "{"...
Appends an SQL string to the given StringBuilder, including the opening and closing single quotes. Any single quotes internal to sqlString will be escaped. This method is deprecated because we want to encourage everyone to use the "?" binding form. However, when implementing a ContentProvider, one may want to add WHE...
[ "Appends", "an", "SQL", "string", "to", "the", "given", "StringBuilder", "including", "the", "opening", "and", "closing", "single", "quotes", ".", "Any", "single", "quotes", "internal", "to", "sqlString", "will", "be", "escaped", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L343-L357
28,370
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.sqlEscapeString
public static String sqlEscapeString(String value) { StringBuilder escaper = new StringBuilder(); DatabaseUtils.appendEscapedSQLString(escaper, value); return escaper.toString(); }
java
public static String sqlEscapeString(String value) { StringBuilder escaper = new StringBuilder(); DatabaseUtils.appendEscapedSQLString(escaper, value); return escaper.toString(); }
[ "public", "static", "String", "sqlEscapeString", "(", "String", "value", ")", "{", "StringBuilder", "escaper", "=", "new", "StringBuilder", "(", ")", ";", "DatabaseUtils", ".", "appendEscapedSQLString", "(", "escaper", ",", "value", ")", ";", "return", "escaper"...
SQL-escape a string.
[ "SQL", "-", "escape", "a", "string", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L362-L368
28,371
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.appendValueToSql
public static final void appendValueToSql(StringBuilder sql, Object value) { if (value == null) { sql.append("NULL"); } else if (value instanceof Boolean) { Boolean bool = (Boolean)value; if (bool) { sql.append('1'); } else { ...
java
public static final void appendValueToSql(StringBuilder sql, Object value) { if (value == null) { sql.append("NULL"); } else if (value instanceof Boolean) { Boolean bool = (Boolean)value; if (bool) { sql.append('1'); } else { ...
[ "public", "static", "final", "void", "appendValueToSql", "(", "StringBuilder", "sql", ",", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "sql", ".", "append", "(", "\"NULL\"", ")", ";", "}", "else", "if", "(", "value", "insta...
Appends an Object to an SQL string with the proper escaping, etc.
[ "Appends", "an", "Object", "to", "an", "SQL", "string", "with", "the", "proper", "escaping", "etc", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L373-L386
28,372
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.concatenateWhere
public static String concatenateWhere(String a, String b) { if (TextUtils.isEmpty(a)) { return b; } if (TextUtils.isEmpty(b)) { return a; } return "(" + a + ") AND (" + b + ")"; }
java
public static String concatenateWhere(String a, String b) { if (TextUtils.isEmpty(a)) { return b; } if (TextUtils.isEmpty(b)) { return a; } return "(" + a + ") AND (" + b + ")"; }
[ "public", "static", "String", "concatenateWhere", "(", "String", "a", ",", "String", "b", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "a", ")", ")", "{", "return", "b", ";", "}", "if", "(", "TextUtils", ".", "isEmpty", "(", "b", ")", ")"...
Concatenates two SQL WHERE clauses, handling empty or null values.
[ "Concatenates", "two", "SQL", "WHERE", "clauses", "handling", "empty", "or", "null", "values", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L391-L400
28,373
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.getCollationKey
public static String getCollationKey(String name) { byte [] arr = getCollationKeyInBytes(name); try { return new String(arr, 0, getKeyLen(arr), "ISO8859_1"); } catch (Exception ex) { return ""; } }
java
public static String getCollationKey(String name) { byte [] arr = getCollationKeyInBytes(name); try { return new String(arr, 0, getKeyLen(arr), "ISO8859_1"); } catch (Exception ex) { return ""; } }
[ "public", "static", "String", "getCollationKey", "(", "String", "name", ")", "{", "byte", "[", "]", "arr", "=", "getCollationKeyInBytes", "(", "name", ")", ";", "try", "{", "return", "new", "String", "(", "arr", ",", "0", ",", "getKeyLen", "(", "arr", ...
return the collation key @param name @return the collation key
[ "return", "the", "collation", "key" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L407-L414
28,374
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.getHexCollationKey
public static String getHexCollationKey(String name) { byte[] arr = getCollationKeyInBytes(name); char[] keys = encodeHex(arr); return new String(keys, 0, getKeyLen(arr) * 2); }
java
public static String getHexCollationKey(String name) { byte[] arr = getCollationKeyInBytes(name); char[] keys = encodeHex(arr); return new String(keys, 0, getKeyLen(arr) * 2); }
[ "public", "static", "String", "getHexCollationKey", "(", "String", "name", ")", "{", "byte", "[", "]", "arr", "=", "getCollationKeyInBytes", "(", "name", ")", ";", "char", "[", "]", "keys", "=", "encodeHex", "(", "arr", ")", ";", "return", "new", "String...
return the collation key in hex format @param name @return the collation key in hex format
[ "return", "the", "collation", "key", "in", "hex", "format" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L421-L425
28,375
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.dumpCursor
public static void dumpCursor(Cursor cursor, PrintStream stream) { stream.println(">>>>> Dumping cursor " + cursor); if (cursor != null) { int startPos = cursor.getPosition(); cursor.moveToPosition(-1); while (cursor.moveToNext()) { dumpCurrentRow(cur...
java
public static void dumpCursor(Cursor cursor, PrintStream stream) { stream.println(">>>>> Dumping cursor " + cursor); if (cursor != null) { int startPos = cursor.getPosition(); cursor.moveToPosition(-1); while (cursor.moveToNext()) { dumpCurrentRow(cur...
[ "public", "static", "void", "dumpCursor", "(", "Cursor", "cursor", ",", "PrintStream", "stream", ")", "{", "stream", ".", "println", "(", "\">>>>> Dumping cursor \"", "+", "cursor", ")", ";", "if", "(", "cursor", "!=", "null", ")", "{", "int", "startPos", ...
Prints the contents of a Cursor to a PrintSteam. The position is restored after printing. @param cursor the cursor to print @param stream the stream to print to
[ "Prints", "the", "contents", "of", "a", "Cursor", "to", "a", "PrintSteam", ".", "The", "position", "is", "restored", "after", "printing", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L484-L496
28,376
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.dumpCursor
public static void dumpCursor(Cursor cursor, StringBuilder sb) { sb.append(">>>>> Dumping cursor " + cursor + "\n"); if (cursor != null) { int startPos = cursor.getPosition(); cursor.moveToPosition(-1); while (cursor.moveToNext()) { dumpCurrentRow(cur...
java
public static void dumpCursor(Cursor cursor, StringBuilder sb) { sb.append(">>>>> Dumping cursor " + cursor + "\n"); if (cursor != null) { int startPos = cursor.getPosition(); cursor.moveToPosition(-1); while (cursor.moveToNext()) { dumpCurrentRow(cur...
[ "public", "static", "void", "dumpCursor", "(", "Cursor", "cursor", ",", "StringBuilder", "sb", ")", "{", "sb", ".", "append", "(", "\">>>>> Dumping cursor \"", "+", "cursor", "+", "\"\\n\"", ")", ";", "if", "(", "cursor", "!=", "null", ")", "{", "int", "...
Prints the contents of a Cursor to a StringBuilder. The position is restored after printing. @param cursor the cursor to print @param sb the StringBuilder to print to
[ "Prints", "the", "contents", "of", "a", "Cursor", "to", "a", "StringBuilder", ".", "The", "position", "is", "restored", "after", "printing", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L505-L517
28,377
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.dumpCursorToString
public static String dumpCursorToString(Cursor cursor) { StringBuilder sb = new StringBuilder(); dumpCursor(cursor, sb); return sb.toString(); }
java
public static String dumpCursorToString(Cursor cursor) { StringBuilder sb = new StringBuilder(); dumpCursor(cursor, sb); return sb.toString(); }
[ "public", "static", "String", "dumpCursorToString", "(", "Cursor", "cursor", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "dumpCursor", "(", "cursor", ",", "sb", ")", ";", "return", "sb", ".", "toString", "(", ")", ";", "}...
Prints the contents of a Cursor to a String. The position is restored after printing. @param cursor the cursor to print @return a String that contains the dumped cursor
[ "Prints", "the", "contents", "of", "a", "Cursor", "to", "a", "String", ".", "The", "position", "is", "restored", "after", "printing", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L526-L530
28,378
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.dumpCurrentRow
public static void dumpCurrentRow(Cursor cursor, PrintStream stream) { String[] cols = cursor.getColumnNames(); stream.println("" + cursor.getPosition() + " {"); int length = cols.length; for (int i = 0; i< length; i++) { String value; try { value ...
java
public static void dumpCurrentRow(Cursor cursor, PrintStream stream) { String[] cols = cursor.getColumnNames(); stream.println("" + cursor.getPosition() + " {"); int length = cols.length; for (int i = 0; i< length; i++) { String value; try { value ...
[ "public", "static", "void", "dumpCurrentRow", "(", "Cursor", "cursor", ",", "PrintStream", "stream", ")", "{", "String", "[", "]", "cols", "=", "cursor", ".", "getColumnNames", "(", ")", ";", "stream", ".", "println", "(", "\"\"", "+", "cursor", ".", "ge...
Prints the contents of a Cursor's current row to a PrintSteam. @param cursor the cursor to print @param stream the stream to print to
[ "Prints", "the", "contents", "of", "a", "Cursor", "s", "current", "row", "to", "a", "PrintSteam", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L547-L563
28,379
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.dumpCurrentRow
public static void dumpCurrentRow(Cursor cursor, StringBuilder sb) { String[] cols = cursor.getColumnNames(); sb.append("" + cursor.getPosition() + " {\n"); int length = cols.length; for (int i = 0; i < length; i++) { String value; try { value = cu...
java
public static void dumpCurrentRow(Cursor cursor, StringBuilder sb) { String[] cols = cursor.getColumnNames(); sb.append("" + cursor.getPosition() + " {\n"); int length = cols.length; for (int i = 0; i < length; i++) { String value; try { value = cu...
[ "public", "static", "void", "dumpCurrentRow", "(", "Cursor", "cursor", ",", "StringBuilder", "sb", ")", "{", "String", "[", "]", "cols", "=", "cursor", ".", "getColumnNames", "(", ")", ";", "sb", ".", "append", "(", "\"\"", "+", "cursor", ".", "getPositi...
Prints the contents of a Cursor's current row to a StringBuilder. @param cursor the cursor to print @param sb the StringBuilder to print to
[ "Prints", "the", "contents", "of", "a", "Cursor", "s", "current", "row", "to", "a", "StringBuilder", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L571-L587
28,380
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.dumpCurrentRowToString
public static String dumpCurrentRowToString(Cursor cursor) { StringBuilder sb = new StringBuilder(); dumpCurrentRow(cursor, sb); return sb.toString(); }
java
public static String dumpCurrentRowToString(Cursor cursor) { StringBuilder sb = new StringBuilder(); dumpCurrentRow(cursor, sb); return sb.toString(); }
[ "public", "static", "String", "dumpCurrentRowToString", "(", "Cursor", "cursor", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "dumpCurrentRow", "(", "cursor", ",", "sb", ")", ";", "return", "sb", ".", "toString", "(", ")", "...
Dump the contents of a Cursor's current row to a String. @param cursor the cursor to print @return a String that contains the dumped cursor row
[ "Dump", "the", "contents", "of", "a", "Cursor", "s", "current", "row", "to", "a", "String", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L595-L599
28,381
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorStringToInsertHelper
public static void cursorStringToInsertHelper(Cursor cursor, String field, InsertHelper inserter, int index) { inserter.bind(index, cursor.getString(cursor.getColumnIndexOrThrow(field))); }
java
public static void cursorStringToInsertHelper(Cursor cursor, String field, InsertHelper inserter, int index) { inserter.bind(index, cursor.getString(cursor.getColumnIndexOrThrow(field))); }
[ "public", "static", "void", "cursorStringToInsertHelper", "(", "Cursor", "cursor", ",", "String", "field", ",", "InsertHelper", "inserter", ",", "int", "index", ")", "{", "inserter", ".", "bind", "(", "index", ",", "cursor", ".", "getString", "(", "cursor", ...
Reads a String out of a field in a Cursor and writes it to an InsertHelper. @param cursor The cursor to read from @param field The TEXT field to read @param inserter The InsertHelper to bind into @param index the index of the bind entry in the InsertHelper
[ "Reads", "a", "String", "out", "of", "a", "field", "in", "a", "Cursor", "and", "writes", "it", "to", "an", "InsertHelper", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L621-L624
28,382
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorIntToContentValues
public static void cursorIntToContentValues(Cursor cursor, String field, ContentValues values) { cursorIntToContentValues(cursor, field, values, field); }
java
public static void cursorIntToContentValues(Cursor cursor, String field, ContentValues values) { cursorIntToContentValues(cursor, field, values, field); }
[ "public", "static", "void", "cursorIntToContentValues", "(", "Cursor", "cursor", ",", "String", "field", ",", "ContentValues", "values", ")", "{", "cursorIntToContentValues", "(", "cursor", ",", "field", ",", "values", ",", "field", ")", ";", "}" ]
Reads an Integer out of a field in a Cursor and writes it to a Map. @param cursor The cursor to read from @param field The INTEGER field to read @param values The {@link ContentValues} to put the value into, with the field as the key
[ "Reads", "an", "Integer", "out", "of", "a", "field", "in", "a", "Cursor", "and", "writes", "it", "to", "a", "Map", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L646-L648
28,383
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorIntToContentValues
public static void cursorIntToContentValues(Cursor cursor, String field, ContentValues values, String key) { int colIndex = cursor.getColumnIndex(field); if (!cursor.isNull(colIndex)) { values.put(key, cursor.getInt(colIndex)); } else { values.put(key, (Intege...
java
public static void cursorIntToContentValues(Cursor cursor, String field, ContentValues values, String key) { int colIndex = cursor.getColumnIndex(field); if (!cursor.isNull(colIndex)) { values.put(key, cursor.getInt(colIndex)); } else { values.put(key, (Intege...
[ "public", "static", "void", "cursorIntToContentValues", "(", "Cursor", "cursor", ",", "String", "field", ",", "ContentValues", "values", ",", "String", "key", ")", "{", "int", "colIndex", "=", "cursor", ".", "getColumnIndex", "(", "field", ")", ";", "if", "(...
Reads a Integer out of a field in a Cursor and writes it to a Map. @param cursor The cursor to read from @param field The INTEGER field to read @param values The {@link ContentValues} to put the value into, with the field as the key @param key The key to store the value with in the map
[ "Reads", "a", "Integer", "out", "of", "a", "field", "in", "a", "Cursor", "and", "writes", "it", "to", "a", "Map", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L658-L666
28,384
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorRowToContentValues
public static void cursorRowToContentValues(Cursor cursor, ContentValues values) { String[] columns = cursor.getColumnNames(); int length = columns.length; for (int i = 0; i < length; i++) { if (cursor.getType(i) == Cursor.FIELD_TYPE_BLOB) { values.put(columns[i], cur...
java
public static void cursorRowToContentValues(Cursor cursor, ContentValues values) { String[] columns = cursor.getColumnNames(); int length = columns.length; for (int i = 0; i < length; i++) { if (cursor.getType(i) == Cursor.FIELD_TYPE_BLOB) { values.put(columns[i], cur...
[ "public", "static", "void", "cursorRowToContentValues", "(", "Cursor", "cursor", ",", "ContentValues", "values", ")", "{", "String", "[", "]", "columns", "=", "cursor", ".", "getColumnNames", "(", ")", ";", "int", "length", "=", "columns", ".", "length", ";"...
Read the entire contents of a cursor row and store them in a ContentValues. @param cursor the cursor to read from. @param values the {@link ContentValues} to put the row into.
[ "Read", "the", "entire", "contents", "of", "a", "cursor", "row", "and", "store", "them", "in", "a", "ContentValues", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L735-L745
28,385
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.queryIsEmpty
public static boolean queryIsEmpty(SQLiteDatabase db, String table) { long isEmpty = longForQuery(db, "select exists(select 1 from " + table + ")", null); return isEmpty == 0; }
java
public static boolean queryIsEmpty(SQLiteDatabase db, String table) { long isEmpty = longForQuery(db, "select exists(select 1 from " + table + ")", null); return isEmpty == 0; }
[ "public", "static", "boolean", "queryIsEmpty", "(", "SQLiteDatabase", "db", ",", "String", "table", ")", "{", "long", "isEmpty", "=", "longForQuery", "(", "db", ",", "\"select exists(select 1 from \"", "+", "table", "+", "\")\"", ",", "null", ")", ";", "return...
Query the table to check whether a table is empty or not @param db the database the table is in @param table the name of the table to query @return True if the table is empty @hide
[ "Query", "the", "table", "to", "check", "whether", "a", "table", "is", "empty", "or", "not" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L823-L826
28,386
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.blobFileDescriptorForQuery
public static ParcelFileDescriptor blobFileDescriptorForQuery(SQLiteDatabase db, String query, String[] selectionArgs) { SQLiteStatement prog = db.compileStatement(query); try { return blobFileDescriptorForQuery(prog, selectionArgs); } finally { prog.close(); ...
java
public static ParcelFileDescriptor blobFileDescriptorForQuery(SQLiteDatabase db, String query, String[] selectionArgs) { SQLiteStatement prog = db.compileStatement(query); try { return blobFileDescriptorForQuery(prog, selectionArgs); } finally { prog.close(); ...
[ "public", "static", "ParcelFileDescriptor", "blobFileDescriptorForQuery", "(", "SQLiteDatabase", "db", ",", "String", "query", ",", "String", "[", "]", "selectionArgs", ")", "{", "SQLiteStatement", "prog", "=", "db", ".", "compileStatement", "(", "query", ")", ";"...
Utility method to run the query on the db and return the blob value in the first column of the first row. @return A read-only file descriptor for a copy of the blob value.
[ "Utility", "method", "to", "run", "the", "query", "on", "the", "db", "and", "return", "the", "blob", "value", "in", "the", "first", "column", "of", "the", "first", "row", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L878-L886
28,387
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.blobFileDescriptorForQuery
public static ParcelFileDescriptor blobFileDescriptorForQuery(SQLiteStatement prog, String[] selectionArgs) { prog.bindAllArgsAsStrings(selectionArgs); return prog.simpleQueryForBlobFileDescriptor(); }
java
public static ParcelFileDescriptor blobFileDescriptorForQuery(SQLiteStatement prog, String[] selectionArgs) { prog.bindAllArgsAsStrings(selectionArgs); return prog.simpleQueryForBlobFileDescriptor(); }
[ "public", "static", "ParcelFileDescriptor", "blobFileDescriptorForQuery", "(", "SQLiteStatement", "prog", ",", "String", "[", "]", "selectionArgs", ")", "{", "prog", ".", "bindAllArgsAsStrings", "(", "selectionArgs", ")", ";", "return", "prog", ".", "simpleQueryForBlo...
Utility method to run the pre-compiled query and return the blob value in the first column of the first row. @return A read-only file descriptor for a copy of the blob value.
[ "Utility", "method", "to", "run", "the", "pre", "-", "compiled", "query", "and", "return", "the", "blob", "value", "in", "the", "first", "column", "of", "the", "first", "row", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L894-L898
28,388
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorStringToContentValuesIfPresent
public static void cursorStringToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getString(index)); } }
java
public static void cursorStringToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getString(index)); } }
[ "public", "static", "void", "cursorStringToContentValuesIfPresent", "(", "Cursor", "cursor", ",", "ContentValues", "values", ",", "String", "column", ")", "{", "final", "int", "index", "=", "cursor", ".", "getColumnIndex", "(", "column", ")", ";", "if", "(", "...
Reads a String out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null. @param cursor The cursor to read from @param column The column to read @param values The {@link ContentValues} to put the value into
[ "Reads", "a", "String", "out", "of", "a", "column", "in", "a", "Cursor", "and", "writes", "it", "to", "a", "ContentValues", ".", "Adds", "nothing", "to", "the", "ContentValues", "if", "the", "column", "isn", "t", "present", "or", "if", "its", "value", ...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L908-L914
28,389
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorLongToContentValuesIfPresent
public static void cursorLongToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getLong(index)); } }
java
public static void cursorLongToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getLong(index)); } }
[ "public", "static", "void", "cursorLongToContentValuesIfPresent", "(", "Cursor", "cursor", ",", "ContentValues", "values", ",", "String", "column", ")", "{", "final", "int", "index", "=", "cursor", ".", "getColumnIndex", "(", "column", ")", ";", "if", "(", "in...
Reads a Long out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null. @param cursor The cursor to read from @param column The column to read @param values The {@link ContentValues} to put the value into
[ "Reads", "a", "Long", "out", "of", "a", "column", "in", "a", "Cursor", "and", "writes", "it", "to", "a", "ContentValues", ".", "Adds", "nothing", "to", "the", "ContentValues", "if", "the", "column", "isn", "t", "present", "or", "if", "its", "value", "i...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L924-L930
28,390
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorShortToContentValuesIfPresent
public static void cursorShortToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getShort(index)); } }
java
public static void cursorShortToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getShort(index)); } }
[ "public", "static", "void", "cursorShortToContentValuesIfPresent", "(", "Cursor", "cursor", ",", "ContentValues", "values", ",", "String", "column", ")", "{", "final", "int", "index", "=", "cursor", ".", "getColumnIndex", "(", "column", ")", ";", "if", "(", "i...
Reads a Short out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null. @param cursor The cursor to read from @param column The column to read @param values The {@link ContentValues} to put the value into
[ "Reads", "a", "Short", "out", "of", "a", "column", "in", "a", "Cursor", "and", "writes", "it", "to", "a", "ContentValues", ".", "Adds", "nothing", "to", "the", "ContentValues", "if", "the", "column", "isn", "t", "present", "or", "if", "its", "value", "...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L940-L946
28,391
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorIntToContentValuesIfPresent
public static void cursorIntToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getInt(index)); } }
java
public static void cursorIntToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getInt(index)); } }
[ "public", "static", "void", "cursorIntToContentValuesIfPresent", "(", "Cursor", "cursor", ",", "ContentValues", "values", ",", "String", "column", ")", "{", "final", "int", "index", "=", "cursor", ".", "getColumnIndex", "(", "column", ")", ";", "if", "(", "ind...
Reads a Integer out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null. @param cursor The cursor to read from @param column The column to read @param values The {@link ContentValues} to put the value into
[ "Reads", "a", "Integer", "out", "of", "a", "column", "in", "a", "Cursor", "and", "writes", "it", "to", "a", "ContentValues", ".", "Adds", "nothing", "to", "the", "ContentValues", "if", "the", "column", "isn", "t", "present", "or", "if", "its", "value", ...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L956-L962
28,392
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorFloatToContentValuesIfPresent
public static void cursorFloatToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getFloat(index)); } }
java
public static void cursorFloatToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getFloat(index)); } }
[ "public", "static", "void", "cursorFloatToContentValuesIfPresent", "(", "Cursor", "cursor", ",", "ContentValues", "values", ",", "String", "column", ")", "{", "final", "int", "index", "=", "cursor", ".", "getColumnIndex", "(", "column", ")", ";", "if", "(", "i...
Reads a Float out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null. @param cursor The cursor to read from @param column The column to read @param values The {@link ContentValues} to put the value into
[ "Reads", "a", "Float", "out", "of", "a", "column", "in", "a", "Cursor", "and", "writes", "it", "to", "a", "ContentValues", ".", "Adds", "nothing", "to", "the", "ContentValues", "if", "the", "column", "isn", "t", "present", "or", "if", "its", "value", "...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L972-L978
28,393
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.cursorDoubleToContentValuesIfPresent
public static void cursorDoubleToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getDouble(index)); } }
java
public static void cursorDoubleToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getDouble(index)); } }
[ "public", "static", "void", "cursorDoubleToContentValuesIfPresent", "(", "Cursor", "cursor", ",", "ContentValues", "values", ",", "String", "column", ")", "{", "final", "int", "index", "=", "cursor", ".", "getColumnIndex", "(", "column", ")", ";", "if", "(", "...
Reads a Double out of a column in a Cursor and writes it to a ContentValues. Adds nothing to the ContentValues if the column isn't present or if its value is null. @param cursor The cursor to read from @param column The column to read @param values The {@link ContentValues} to put the value into
[ "Reads", "a", "Double", "out", "of", "a", "column", "in", "a", "Cursor", "and", "writes", "it", "to", "a", "ContentValues", ".", "Adds", "nothing", "to", "the", "ContentValues", "if", "the", "column", "isn", "t", "present", "or", "if", "its", "value", ...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L988-L994
28,394
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.createDbFromSqlStatements
static public void createDbFromSqlStatements( Context context, String dbName, int dbVersion, String sqlStatements) { File f = context.getDatabasePath(dbName); f.getParentFile().mkdirs(); SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(f, null); // TODO: this is not ...
java
static public void createDbFromSqlStatements( Context context, String dbName, int dbVersion, String sqlStatements) { File f = context.getDatabasePath(dbName); f.getParentFile().mkdirs(); SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(f, null); // TODO: this is not ...
[ "static", "public", "void", "createDbFromSqlStatements", "(", "Context", "context", ",", "String", "dbName", ",", "int", "dbVersion", ",", "String", "sqlStatements", ")", "{", "File", "f", "=", "context", ".", "getDatabasePath", "(", "dbName", ")", ";", "f", ...
Creates a db and populates it with the sql statements in sqlStatements. @param context the context to use to create the db @param dbName the name of the db to create @param dbVersion the version to set on the db @param sqlStatements the statements to use to populate the db. This should be a single string of the form r...
[ "Creates", "a", "db", "and", "populates", "it", "with", "the", "sql", "statements", "in", "sqlStatements", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L1367-L1384
28,395
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.appendSelectionArgs
public static String[] appendSelectionArgs(String[] originalValues, String[] newValues) { if (originalValues == null || originalValues.length == 0) { return newValues; } String[] result = new String[originalValues.length + newValues.length ]; System.arraycopy(originalValues, ...
java
public static String[] appendSelectionArgs(String[] originalValues, String[] newValues) { if (originalValues == null || originalValues.length == 0) { return newValues; } String[] result = new String[originalValues.length + newValues.length ]; System.arraycopy(originalValues, ...
[ "public", "static", "String", "[", "]", "appendSelectionArgs", "(", "String", "[", "]", "originalValues", ",", "String", "[", "]", "newValues", ")", "{", "if", "(", "originalValues", "==", "null", "||", "originalValues", ".", "length", "==", "0", ")", "{",...
Appends one set of selection args to another. This is useful when adding a selection argument to a user provided set.
[ "Appends", "one", "set", "of", "selection", "args", "to", "another", ".", "This", "is", "useful", "when", "adding", "a", "selection", "argument", "to", "a", "user", "provided", "set", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L1438-L1446
28,396
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.findRowIdColumnIndex
public static int findRowIdColumnIndex(String[] columnNames) { int length = columnNames.length; for (int i = 0; i < length; i++) { if (columnNames[i].equals("_id")) { return i; } } return -1; }
java
public static int findRowIdColumnIndex(String[] columnNames) { int length = columnNames.length; for (int i = 0; i < length; i++) { if (columnNames[i].equals("_id")) { return i; } } return -1; }
[ "public", "static", "int", "findRowIdColumnIndex", "(", "String", "[", "]", "columnNames", ")", "{", "int", "length", "=", "columnNames", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", ...
Returns column index of "_id" column, or -1 if not found. @hide
[ "Returns", "column", "index", "of", "_id", "column", "or", "-", "1", "if", "not", "found", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L1452-L1460
28,397
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java
MercatorProjection.getPixelRelativeToTile
public static Point getPixelRelativeToTile(LatLong latLong, Tile tile) { return getPixelRelative(latLong, tile.mapSize, tile.getOrigin()); }
java
public static Point getPixelRelativeToTile(LatLong latLong, Tile tile) { return getPixelRelative(latLong, tile.mapSize, tile.getOrigin()); }
[ "public", "static", "Point", "getPixelRelativeToTile", "(", "LatLong", "latLong", ",", "Tile", "tile", ")", "{", "return", "getPixelRelative", "(", "latLong", ",", "tile", ".", "mapSize", ",", "tile", ".", "getOrigin", "(", ")", ")", ";", "}" ]
Calculates the absolute pixel position for a tile and tile size relative to origin @param latLong the geographic position. @param tile tile @return the relative pixel position to the origin values (e.g. for a tile)
[ "Calculates", "the", "absolute", "pixel", "position", "for", "a", "tile", "and", "tile", "size", "relative", "to", "origin" ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L175-L177
28,398
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java
MercatorProjection.metersToPixelsWithScaleFactor
public static double metersToPixelsWithScaleFactor(float meters, double latitude, double scaleFactor, int tileSize) { return meters / MercatorProjection.calculateGroundResolutionWithScaleFactor(latitude, scaleFactor, tileSize); }
java
public static double metersToPixelsWithScaleFactor(float meters, double latitude, double scaleFactor, int tileSize) { return meters / MercatorProjection.calculateGroundResolutionWithScaleFactor(latitude, scaleFactor, tileSize); }
[ "public", "static", "double", "metersToPixelsWithScaleFactor", "(", "float", "meters", ",", "double", "latitude", ",", "double", "scaleFactor", ",", "int", "tileSize", ")", "{", "return", "meters", "/", "MercatorProjection", ".", "calculateGroundResolutionWithScaleFacto...
Converts meters to pixels at latitude for zoom-level. @param meters the meters to convert @param latitude the latitude for the conversion. @param scaleFactor the scale factor for the conversion. @return pixels that represent the meters at the given zoom-level and latitude.
[ "Converts", "meters", "to", "pixels", "at", "latitude", "for", "zoom", "-", "level", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L312-L314
28,399
mapsforge/mapsforge
mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java
MercatorProjection.pixelXToLongitudeWithScaleFactor
public static double pixelXToLongitudeWithScaleFactor(double pixelX, double scaleFactor, int tileSize) { long mapSize = getMapSizeWithScaleFactor(scaleFactor, tileSize); if (pixelX < 0 || pixelX > mapSize) { throw new IllegalArgumentException("invalid pixelX coordinate at scale " + scaleFact...
java
public static double pixelXToLongitudeWithScaleFactor(double pixelX, double scaleFactor, int tileSize) { long mapSize = getMapSizeWithScaleFactor(scaleFactor, tileSize); if (pixelX < 0 || pixelX > mapSize) { throw new IllegalArgumentException("invalid pixelX coordinate at scale " + scaleFact...
[ "public", "static", "double", "pixelXToLongitudeWithScaleFactor", "(", "double", "pixelX", ",", "double", "scaleFactor", ",", "int", "tileSize", ")", "{", "long", "mapSize", "=", "getMapSizeWithScaleFactor", "(", "scaleFactor", ",", "tileSize", ")", ";", "if", "("...
Converts a pixel X coordinate at a certain scale to a longitude coordinate. @param pixelX the pixel X coordinate that should be converted. @param scaleFactor the scale factor at which the coordinate should be converted. @return the longitude value of the pixel X coordinate. @throws IllegalArgumentException if the...
[ "Converts", "a", "pixel", "X", "coordinate", "at", "a", "certain", "scale", "to", "a", "longitude", "coordinate", "." ]
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L336-L342