switch to slf4j
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.android;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
public class AndroidLog implements org.oscim.backend.Log.Logger {
|
||||
|
||||
@Override
|
||||
public void d(String tag, String msg) {
|
||||
Log.d(tag, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void w(String tag, String msg) {
|
||||
Log.w(tag, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(String tag, String msg) {
|
||||
Log.e(tag, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void i(String tag, String msg) {
|
||||
Log.i(tag, msg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,14 +5,12 @@ import javax.microedition.khronos.egl.EGLConfig;
|
||||
import javax.microedition.khronos.egl.EGLDisplay;
|
||||
|
||||
import android.opengl.GLSurfaceView;
|
||||
import org.oscim.backend.Log;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class GlConfigChooser implements GLSurfaceView.EGLConfigChooser {
|
||||
static private final String TAG = "ConfigChooser";
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -78,7 +76,7 @@ public class GlConfigChooser implements GLSurfaceView.EGLConfigChooser {
|
||||
// You need to explicitly filter the data returned by eglChooseConfig!
|
||||
|
||||
// for (int i = 0; i < configs.length; ++i) {
|
||||
// Log.i(TAG, printConfig(egl, display, configs[i]));
|
||||
// log.info(configs[i]));
|
||||
// }
|
||||
|
||||
// int index = -1;
|
||||
@@ -100,12 +98,12 @@ public class GlConfigChooser implements GLSurfaceView.EGLConfigChooser {
|
||||
// }
|
||||
// }
|
||||
// if (index == -1) {
|
||||
// Log.w(TAG, "Did not find sane config, using first");
|
||||
// log.warn(using first");
|
||||
// index = 0;
|
||||
// }
|
||||
int index = 0;
|
||||
|
||||
Log.i(TAG, "using: " + printConfig(egl, display, configs[index]));
|
||||
//log.info(configs[index]);
|
||||
|
||||
EGLConfig config = configs.length > 0 ? configs[index] : null;
|
||||
if (config == null) {
|
||||
|
||||
@@ -21,9 +21,10 @@ import org.oscim.android.input.AndroidMotionEvent;
|
||||
import org.oscim.backend.AssetAdapter;
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.map.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
@@ -37,7 +38,7 @@ import android.widget.RelativeLayout;
|
||||
*/
|
||||
public class MapView extends RelativeLayout {
|
||||
|
||||
final static String TAG = MapView.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(MapView.class);
|
||||
|
||||
public static final boolean debugFrameTime = false;
|
||||
public static final boolean testRegionZoom = false;
|
||||
@@ -91,7 +92,7 @@ public class MapView extends RelativeLayout {
|
||||
"context is not an instance of MapActivity");
|
||||
}
|
||||
|
||||
Log.logger = new AndroidLog();
|
||||
//Log.logger = new AndroidLog();
|
||||
CanvasAdapter.g = AndroidGraphics.INSTANCE;
|
||||
AssetAdapter.g = new AndroidAssetAdapter(context);
|
||||
GLAdapter.g = new AndroidGL();
|
||||
@@ -198,7 +199,7 @@ public class MapView extends RelativeLayout {
|
||||
}
|
||||
|
||||
public void onStop() {
|
||||
Log.d(TAG, "onStop");
|
||||
log.debug("onStop");
|
||||
//mMap.destroy();
|
||||
}
|
||||
|
||||
@@ -235,7 +236,7 @@ public class MapView extends RelativeLayout {
|
||||
@Override
|
||||
protected void onSizeChanged(int width, int height,
|
||||
int oldWidth, int oldHeight) {
|
||||
Log.d(TAG, "onSizeChanged: " + width + "x" + height);
|
||||
log.debug("onSizeChanged: " + width + "x" + height);
|
||||
|
||||
super.onSizeChanged(width, height, oldWidth, oldHeight);
|
||||
|
||||
@@ -280,7 +281,7 @@ public class MapView extends RelativeLayout {
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
Log.d(TAG, "TODO Auto-generated method stub");
|
||||
log.debug("TODO Auto-generated method stub");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/vtm"/>
|
||||
<classpathentry exported="true" kind="lib" path="/vtm-libs/extras/jackson-core-2.1.4.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="/vtm-libs/extras/osmosis-osm-binary-0.43.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="/vtm-libs/extras/protobuf-java-2.4.1.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="/vtm-libs/extras/protobuf-java-2.4.1.jar" sourcepath="/home/jeff/.m2/repository/com/google/protobuf/protobuf-java/2.4.1/protobuf-java-2.4.1-sources.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.List;
|
||||
|
||||
import org.openstreetmap.osmosis.osmbinary.BinaryParser;
|
||||
import org.openstreetmap.osmosis.osmbinary.Osmformat;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.Tag;
|
||||
import org.oscim.core.TagSet;
|
||||
import org.oscim.utils.osm.OSMData;
|
||||
@@ -311,7 +310,7 @@ public class OsmPbfParser extends BinaryParser {
|
||||
ArrayList<OSMWay> ways = new ArrayList<OSMWay>(mWayMap.values());
|
||||
ArrayList<OSMNode> nodes = new ArrayList<OSMNode>(mNodeMap.values());
|
||||
|
||||
Log.d("..", "nodes: " + nodes.size() + " ways: " + ways.size());
|
||||
//log.debug("nodes: " + nodes.size() + " ways: " + ways.size());
|
||||
|
||||
return new OSMData(null, nodes, ways, null);
|
||||
}
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
<classpathentry exported="true" kind="lib" path="/vtm-libs/gdx/gdx-natives.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="/vtm-libs/gdx/vtm-jni-natives.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="/vtm-libs/gdx/gdx-backend-lwjgl.jar"/>
|
||||
<classpathentry kind="lib" path="/vtm-libs/libs/slf4j-simple-1.7.5.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -10,5 +10,6 @@
|
||||
<classpathentry kind="lib" path="/vtm-libs/gdx/gdx-backend-gwt.jar"/>
|
||||
<classpathentry kind="lib" path="/vtm-libs/gdx/gdx-sources.jar"/>
|
||||
<classpathentry kind="lib" path="/vtm-libs/gdx/gdx.jar"/>
|
||||
<classpathentry kind="lib" path="/vtm-libs/libs/hudson-gwt-slf4j-2.1.2.jar"/>
|
||||
<classpathentry kind="output" path="war/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<module>
|
||||
<entry-point class="org.oscim.gdx.client.GwtLauncher"/>
|
||||
<entry-point class="org.oscim.gdx.client.GwtLauncher" />
|
||||
<inherits name="com.google.gwt.xml.XML" />
|
||||
<inherits name="GdxMap"/>
|
||||
<inherits name="com.badlogic.gdx.backends.gdx_backends_gwt"/>
|
||||
<inherits name="com.google.gwt.user.theme.chrome.Chrome"/>
|
||||
<inherits name="org.slf4j.Slf4j" />
|
||||
|
||||
<!-- <inherits name="de.benediktmeurer.gwt.slf4j.api.API"/>
|
||||
<inherits name="de.benediktmeurer.gwt.slf4j.jul.JUL"/> -->
|
||||
<set-property name='gwt.logging.enabled' value='TRUE' />
|
||||
<set-property name='gwt.logging.consoleHandler' value='ENABLED' />
|
||||
<set-property name='gwt.logging.firebugHandler' value='ENABLED' />
|
||||
<set-property name='gwt.logging.popupHandler' value='DISABLED' />
|
||||
|
||||
<inherits name="GdxMap" />
|
||||
<inherits name="com.badlogic.gdx.backends.gdx_backends_gwt" />
|
||||
<inherits name="com.google.gwt.user.theme.chrome.Chrome" />
|
||||
<super-source path="emu" />
|
||||
<set-configuration-property name="gdx.assetpath" value="../vtm/assets"/>
|
||||
<!--<set-property name="user.agent" value="safari"/>-->
|
||||
<set-configuration-property name="gdx.assetpath" value="../vtm/assets" />
|
||||
<!--<set-property name="user.agent" value="safari"/> -->
|
||||
</module>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.oscim.gdx.client;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
@@ -65,7 +64,7 @@ public class GwtBitmap implements Bitmap {
|
||||
pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels());
|
||||
|
||||
if (disposable || image != null) {
|
||||
Log.d("", "dispose pixmap " + getWidth() + "/" + getHeight());
|
||||
//log.debug("dispose pixmap " + getWidth() + "/" + getHeight());
|
||||
pixmap.dispose();
|
||||
|
||||
if (image != null)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.oscim.gdx.client;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
import org.oscim.backend.canvas.Paint;
|
||||
|
||||
@@ -26,7 +25,7 @@ public class GwtCanvas implements org.oscim.backend.canvas.Canvas {
|
||||
@Override
|
||||
public void drawText(String string, float x, float y, Paint paint) {
|
||||
if (bitmap == null) {
|
||||
Log.d("BUG", "no bitmap set");
|
||||
//log.debug("no bitmap set");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ package org.oscim.gdx.client;
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.core.MercatorProjection;
|
||||
import org.oscim.gdx.GdxMap;
|
||||
@@ -20,7 +21,7 @@ import com.google.gwt.user.client.Timer;
|
||||
import com.google.gwt.user.client.Window;
|
||||
|
||||
class GwtGdxMap extends GdxMap {
|
||||
private static final String TAG = GwtGdxMap.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(GwtGdxMap.class);
|
||||
|
||||
SearchBox mSearchBox;
|
||||
|
||||
@@ -77,7 +78,7 @@ class GwtGdxMap extends GdxMap {
|
||||
MapPosition p = new MapPosition();
|
||||
p.setZoomLevel(zoom);
|
||||
p.setPosition(lat, lon);
|
||||
Log.d(TAG, "map position: " + p.x + "/" + p.y + " " + lat + "/" + lon);
|
||||
log.debug("map position: " + p.x + "/" + p.y + " " + lat + "/" + lon);
|
||||
|
||||
p.angle = rotation;
|
||||
p.tilt = tilt;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.oscim.gdx.client;
|
||||
|
||||
// -draftCompile -localWorkers 2
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.Tile;
|
||||
|
||||
import com.badlogic.gdx.ApplicationListener;
|
||||
@@ -66,7 +65,7 @@ public class GwtLauncher extends GwtApplication {
|
||||
|
||||
@Override
|
||||
public void error(String file) {
|
||||
Log.d(this.getClass().getName(), "error loading " + file);
|
||||
//log.debug("error loading " + file);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ package org.oscim.gdx.client;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.core.BoundingBox;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.core.MapPosition;
|
||||
@@ -40,7 +41,7 @@ import com.google.gwt.view.client.SingleSelectionModel;
|
||||
*/
|
||||
public class SearchBox {
|
||||
|
||||
protected static final String TAG = SearchBox.class.getName();
|
||||
protected static final Logger log = LoggerFactory.getLogger(SearchBox.class);
|
||||
|
||||
private static final String NOMINATIM_GLOBAL = "http://nominatim.openstreetmap.org/search?polygon_text=1&addressdetails=0&format=json&limit=25&q=";
|
||||
|
||||
@@ -230,7 +231,7 @@ public class SearchBox {
|
||||
|
||||
mOverlay.clearPath();
|
||||
|
||||
//Log.d(TAG, "selected " + d.getName() + " " + d.getLatitude() + " "
|
||||
//log.debug("selected " + d.getName() + " " + d.getLatitude() + " "
|
||||
// + d.getLongitude());
|
||||
|
||||
BoundingBox b = d.getBoundingBox();
|
||||
@@ -249,11 +250,11 @@ public class SearchBox {
|
||||
try {
|
||||
r.parse(wkt, g);
|
||||
} catch (Exception e) {
|
||||
Log.d(TAG, wkt);
|
||||
log.debug(wkt);
|
||||
}
|
||||
mOverlay.setGeom(g);
|
||||
|
||||
//Log.d(TAG, "add polygon " + p.length());
|
||||
//log.debug("add polygon " + p.length());
|
||||
} else {
|
||||
mOverlay.addPoint(b.maxLatitudeE6, b.minLongitudeE6);
|
||||
mOverlay.addPoint(b.maxLatitudeE6, b.maxLongitudeE6);
|
||||
@@ -319,7 +320,7 @@ public class SearchBox {
|
||||
builder.setCallbackParam("json_callback");
|
||||
builder.requestObject(url, new AsyncCallback<JsArray<NominatimData>>() {
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.d(TAG, "request failed");
|
||||
log.debug("request failed");
|
||||
searchButton.setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,49 +34,41 @@ public class MyAttributes implements Attributes {
|
||||
|
||||
@Override
|
||||
public String getURI(int paramInt) {
|
||||
Log.d("..", "missing");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQName(int paramInt) {
|
||||
Log.d("..", "missing");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType(int paramInt) {
|
||||
Log.d("..", "missing");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIndex(String paramString1, String paramString2) {
|
||||
Log.d("..", "missing");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIndex(String paramString) {
|
||||
Log.d("..", "missing");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType(String paramString1, String paramString2) {
|
||||
Log.d("..", "missing");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType(String paramString) {
|
||||
Log.d("..", "missing");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue(String paramString1, String paramString2) {
|
||||
Log.d("..", "missing");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.oscim.backend;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
@@ -14,7 +13,6 @@ import com.google.gwt.xml.client.XMLParser;
|
||||
|
||||
public class MyXMLReader {
|
||||
public void parse(InputStream is) throws SAXException {
|
||||
Log.d("..", "read theme");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
byte[] buf = new byte[8192];
|
||||
int read;
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
*/
|
||||
package org.oscim.layers.tile.vector;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
||||
import org.oscim.core.MapElement;
|
||||
import org.oscim.core.MercatorProjection;
|
||||
@@ -49,7 +50,7 @@ import org.oscim.utils.LineClipper;
|
||||
|
||||
public class VectorTileLoader extends TileLoader implements IRenderTheme.Callback, ITileDataSink {
|
||||
|
||||
private static final String TAG = VectorTileLoader.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(VectorTileLoader.class);
|
||||
|
||||
private static final double STROKE_INCREASE = Math.sqrt(2.5);
|
||||
private static final byte LAYERS = 11;
|
||||
@@ -230,7 +231,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
}
|
||||
|
||||
//private void debugUnmatched(boolean closed, TagSet tags) {
|
||||
// Log.d(TAG, "DBG way not matched: " + closed + " "
|
||||
// log.debug("DBG way not matched: " + closed + " "
|
||||
// + Arrays.deepToString(tags));
|
||||
//
|
||||
// mTagName = new Tag("name", tags[0].key + ":"
|
||||
@@ -268,7 +269,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
|
||||
if (line.stipple == 0) {
|
||||
if (line.outline && mCurLineLayer == null) {
|
||||
Log.e(TAG, "BUG in theme: line must come before outline!");
|
||||
log.error("BUG in theme: line must come before outline!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -378,7 +379,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
@Override
|
||||
public void renderPointSymbol(Symbol symbol) {
|
||||
if (symbol.texture == null) {
|
||||
Log.d(TAG, "missing symbol for " + mElement.tags.toString());
|
||||
log.debug("missing symbol for " + mElement.tags.toString());
|
||||
return;
|
||||
}
|
||||
for (int i = 0, n = mElement.getNumPoints(); i < n; i++) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.google.gwt.xhr.client.XMLHttpRequest;
|
||||
import com.google.gwt.xhr.client.XMLHttpRequest.ResponseType;
|
||||
|
||||
public class LwHttp {
|
||||
//private static final String TAG = LwHttp.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(LwHttp.class);
|
||||
|
||||
private final String mUrlFileExtension;
|
||||
private final String mUrlPath;
|
||||
@@ -107,7 +107,7 @@ public class LwHttp {
|
||||
@Override
|
||||
public void onReadyStateChange(XMLHttpRequest xhr) {
|
||||
int state = xhr.getReadyState();
|
||||
//Log.d(TAG, mCurrentUrl + "response " + status + "/" + state);
|
||||
//log.debug(mCurrentUrl + "response " + status + "/" + state);
|
||||
|
||||
if (state == XMLHttpRequest.DONE) {
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ package org.oscim.tiling.source.common;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.tiling.MapTile;
|
||||
import org.oscim.tiling.source.ITileDataSink;
|
||||
import org.oscim.tiling.source.ITileDataSource;
|
||||
@@ -27,7 +28,7 @@ import org.oscim.tiling.source.ITileDataSource;
|
||||
*
|
||||
*/
|
||||
public abstract class PbfTileDataSource implements ITileDataSource {
|
||||
private static final String TAG = PbfTileDataSource.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(PbfTileDataSource.class);
|
||||
|
||||
protected LwHttp mConn;
|
||||
protected final PbfDecoder mTileDecoder;
|
||||
@@ -65,7 +66,7 @@ public abstract class PbfTileDataSource implements ITileDataSource {
|
||||
}
|
||||
}
|
||||
if (!win)
|
||||
Log.d(TAG, mTile + " failed");
|
||||
log.debug(mTile + " failed");
|
||||
|
||||
mConn.requestCompleted();
|
||||
mSink.completed(win);
|
||||
|
||||
@@ -20,8 +20,6 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
|
||||
/**
|
||||
* A utility class with IO-specific helper methods.
|
||||
*/
|
||||
@@ -41,7 +39,7 @@ public final class IOUtils {
|
||||
closeable.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.d(IOUtils.class.getName(), e.getMessage() + " " + e);
|
||||
//log.debug(e.getMessage() + " " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +49,7 @@ public final class IOUtils {
|
||||
closeable.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.d(IOUtils.class.getName(), e.getMessage() + " " + e);
|
||||
//log.debug(e.getMessage() + " " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.oscim.utils;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.renderer.elements.VertexItem;
|
||||
|
||||
@@ -29,18 +28,18 @@ public class Tessellator {
|
||||
//Int32Array io = getIndices(o);
|
||||
|
||||
if (io == null) {
|
||||
Log.d("Triangulator", "building tessellation failed");
|
||||
//log.debug("building tessellation failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if (vo.length() != plen) {
|
||||
// // TODO handle different output points
|
||||
// Log.d("", "other points out" + plen + ":" + vo.length() + ", " + io.length());
|
||||
// log.debug(" + io.length());
|
||||
//
|
||||
// //for (int i = 0; i < vo.length(); i += 2)
|
||||
// // Log.d("<", vo.get(i) + " " + vo.get(i + 1));
|
||||
// // log.debug(vo.get(i) + " " + vo.get(i + 1));
|
||||
// //for (int i = ppos; i < ppos + plen; i += 2)
|
||||
// // Log.d(">", points[i]+ " " + points[i + 1]);
|
||||
// // log.debug( points[i]+ " " + points[i + 1]);
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.oscim.gdx;
|
||||
|
||||
import org.oscim.backend.Log.Logger;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
|
||||
public class GdxLog implements Logger {
|
||||
|
||||
@Override
|
||||
public void d(String tag, String msg) {
|
||||
Gdx.app.debug(tag, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void w(String tag, String msg) {
|
||||
Gdx.app.log(tag, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(String tag, String msg) {
|
||||
Gdx.app.error(tag, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void i(String tag, String msg) {
|
||||
Gdx.app.log(tag, msg);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.oscim.gdx;
|
||||
|
||||
import org.oscim.backend.AssetAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.layers.GenericLayer;
|
||||
import org.oscim.layers.tile.vector.BuildingLayer;
|
||||
@@ -149,8 +148,6 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
public void create() {
|
||||
|
||||
Gdx.graphics.setContinuousRendering(false);
|
||||
|
||||
Log.logger = new GdxLog();
|
||||
Gdx.app.setLogLevel(Application.LOG_DEBUG);
|
||||
|
||||
int w = Gdx.graphics.getWidth();
|
||||
@@ -453,7 +450,7 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
@Override
|
||||
public boolean fling(final float velocityX, final float velocityY,
|
||||
int button) {
|
||||
//Log.d("", "fling " + button + " " + velocityX + "/" + velocityY);
|
||||
//log.debug("fling " + button + " " + velocityX + "/" + velocityY);
|
||||
if (mayFling && button == Buttons.LEFT) {
|
||||
int m = Tile.SIZE * 4;
|
||||
mMap.getAnimator().animateFling((int) velocityX, (int) velocityY, -m, m, -m, m);
|
||||
@@ -550,7 +547,7 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
float fx = (x2 + x1) / 2 - mWidth / 2;
|
||||
float fy = (y2 + y1) / 2 - mHeight / 2;
|
||||
|
||||
// Log.d(TAG, "zoom " + deltaPinchWidth + " " + scale + " " +
|
||||
// log.debug("zoom " + deltaPinchWidth + " " + scale + " " +
|
||||
// mSumScale);
|
||||
changed = mMapPosition.scaleMap(scale, fx, fy);
|
||||
}
|
||||
@@ -559,7 +556,7 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
float my2 = y2 - mPrevY2;
|
||||
float threshold = PINCH_TILT_THRESHOLD;
|
||||
|
||||
// Log.d(TAG, r + " " + slope + " m1:" + my + " m2:" + my2);
|
||||
// log.debug(r + " " + slope + " m1:" + my + " m2:" + my2);
|
||||
|
||||
if ((my > threshold && my2 > threshold)
|
||||
|| (my < -threshold && my2 < -threshold)) {
|
||||
@@ -570,7 +567,7 @@ public abstract class GdxMap implements ApplicationListener {
|
||||
|
||||
if (!mBeginTilt
|
||||
&& (mBeginRotate || (Math.abs(slope) > 1 && Math.abs(r) > PINCH_ROTATE_THRESHOLD))) {
|
||||
// Log.d(TAG, "rotate: " + mBeginRotate + " " +
|
||||
// log.debug("rotate: " + mBeginRotate + " " +
|
||||
// Math.toDegrees(rad));
|
||||
if (!mBeginRotate) {
|
||||
mAngle = rad;
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="/vtm-libs/findbugs/annotations.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="/vtm-libs/libs/slf4j-api-1.7.5.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -83,7 +83,7 @@ public abstract class CanvasAdapter {
|
||||
|
||||
InputStream inputStream = AssetAdapter.g.openFileAsStream(src);
|
||||
if (inputStream == null) {
|
||||
Log.e(CanvasAdapter.class.getName(), "invalid bitmap source: " + src);
|
||||
//log.error("invalid bitmap source: " + src);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013 Hannes Janetzek
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.oscim.backend;
|
||||
|
||||
public class Log {
|
||||
|
||||
/** The instance provided by backend */
|
||||
public static Logger logger;
|
||||
|
||||
public static void d(String tag, String msg) {
|
||||
logger.d(tag, msg);
|
||||
}
|
||||
|
||||
public static void w(String tag, String msg) {
|
||||
logger.w(tag, msg);
|
||||
}
|
||||
|
||||
public static void e(String tag, String msg) {
|
||||
logger.e(tag, msg);
|
||||
}
|
||||
|
||||
public static void i(String tag, String msg) {
|
||||
logger.i(tag, msg);
|
||||
}
|
||||
|
||||
public interface Logger {
|
||||
void d(String tag, String msg);
|
||||
|
||||
void w(String tag, String msg);
|
||||
|
||||
void e(String tag, String msg);
|
||||
|
||||
void i(String tag, String msg);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,16 @@
|
||||
package org.oscim.layers;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.map.Map.UpdateListener;
|
||||
import org.oscim.renderer.LayerRenderer;
|
||||
import org.oscim.renderer.MapRenderer.Matrices;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CustomRenderLayer extends Layer implements UpdateListener {
|
||||
|
||||
private static final String TAG = CustomRenderLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(CustomRenderLayer.class);
|
||||
|
||||
class CustomRenderer extends LayerRenderer {
|
||||
|
||||
@@ -22,7 +23,7 @@ public class CustomRenderLayer extends Layer implements UpdateListener {
|
||||
currentState = someConccurentVariable;
|
||||
compile();
|
||||
}
|
||||
Log.d(TAG, "state " + currentState);
|
||||
log.debug("state " + currentState);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
*/
|
||||
package org.oscim.layers;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.event.EventListener;
|
||||
import org.oscim.event.MapEvent;
|
||||
import org.oscim.event.MotionEvent;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.map.Viewport;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Changes Viewport for scroll, fling, scale, rotation and tilt gestures
|
||||
@@ -34,7 +35,7 @@ import org.oscim.map.Viewport;
|
||||
|
||||
public class MapEventLayer extends Layer implements EventListener {
|
||||
private static final boolean debug = false;
|
||||
private static final String TAG = MapEventLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(MapEventLayer.class);
|
||||
|
||||
private float mSumScale;
|
||||
private float mSumRotate;
|
||||
@@ -172,7 +173,7 @@ public class MapEventLayer extends Layer implements EventListener {
|
||||
// double-tap + hold
|
||||
if (mDoubleTap) {
|
||||
if (debug)
|
||||
Log.d(TAG, "tap scale: " + mx + " " + my);
|
||||
log.debug("tap scale: " + mx + " " + my);
|
||||
mMapPosition.scaleMap(1 - my / (height / 8), 0, 0);
|
||||
mMap.updateMap(true);
|
||||
|
||||
@@ -234,14 +235,14 @@ public class MapEventLayer extends Layer implements EventListener {
|
||||
float fx = (x2 + x1) / 2 - width / 2;
|
||||
float fy = (y2 + y1) / 2 - height / 2;
|
||||
|
||||
//Log.d(TAG, "zoom " + deltaPinchWidth + " " + scale + " " + mSumScale);
|
||||
//log.debug("zoom " + deltaPinchWidth + " " + scale + " " + mSumScale);
|
||||
changed = mMapPosition.scaleMap(scale, fx, fy);
|
||||
}
|
||||
|
||||
if (mEnableTilt && !mBeginRotate && Math.abs(slope) < 1) {
|
||||
float my2 = y2 - mPrevY2;
|
||||
float threshold = PINCH_TILT_THRESHOLD;
|
||||
//Log.d(TAG, r + " " + slope + " m1:" + my + " m2:" + my2);
|
||||
//log.debug(r + " " + slope + " m1:" + my + " m2:" + my2);
|
||||
|
||||
if ((my > threshold && my2 > threshold)
|
||||
|| (my < -threshold && my2 < -threshold))
|
||||
@@ -251,7 +252,7 @@ public class MapEventLayer extends Layer implements EventListener {
|
||||
}
|
||||
} else if (mEnableRotation && !mBeginTilt &&
|
||||
(mBeginRotate || Math.abs(r) > PINCH_ROTATE_THRESHOLD)) {
|
||||
//Log.d(TAG, "rotate: " + mBeginRotate + " " + Math.toDegrees(rad));
|
||||
//log.debug("rotate: " + mBeginRotate + " " + Math.toDegrees(rad));
|
||||
if (!mBeginRotate) {
|
||||
mAngle = rad;
|
||||
|
||||
@@ -350,7 +351,7 @@ public class MapEventLayer extends Layer implements EventListener {
|
||||
|
||||
//
|
||||
//private void printState(String action) {
|
||||
// Log.d(TAG, action
|
||||
// log.debug(action
|
||||
// + " " + mDoubleTap
|
||||
// + " " + mBeginScale
|
||||
// + " " + mBeginRotate
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.oscim.map.Viewport;
|
||||
|
||||
public class ItemizedIconLayer<Item extends MarkerItem> extends ItemizedLayer<Item>
|
||||
implements TouchListener {
|
||||
//private static final String TAG = ItemizedIconOverlay.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(ItemizedIconOverlay.class);
|
||||
|
||||
protected final List<Item> mItemList;
|
||||
protected OnItemGestureListener<Item> mOnItemGestureListener;
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.oscim.utils.GeometryUtils;
|
||||
public abstract class ItemizedLayer<Item extends MarkerItem> extends MarkerLayer implements
|
||||
MarkerLayer.Snappable {
|
||||
|
||||
//private final static String TAG = ItemizedOverlay.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(ItemizedOverlay.class);
|
||||
|
||||
protected final MarkerSymbol mDefaultMarker;
|
||||
protected boolean mDrawFocusedItem = true;
|
||||
@@ -130,7 +130,7 @@ public abstract class ItemizedLayer<Item extends MarkerItem> extends MarkerLayer
|
||||
|
||||
}
|
||||
|
||||
//Log.d(TAG, numVisible + " " + changedVisible + " " + changesInvisible);
|
||||
//log.debug(numVisible + " " + changedVisible + " " + changesInvisible);
|
||||
|
||||
// only update when zoomlevel changed, new items are visible
|
||||
// or more than 10 of the current items became invisible
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.oscim.tiling.TileManager;
|
||||
import org.oscim.tiling.TileRenderer;
|
||||
|
||||
public abstract class TileLayer<T extends TileLoader> extends Layer implements Map.UpdateListener {
|
||||
//private final static String TAG = TileLayer.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(TileLayer.class);
|
||||
private final static int MAX_ZOOMLEVEL = 17;
|
||||
private final static int MIN_ZOOMLEVEL = 2;
|
||||
private final static int CACHE_LIMIT = 250;
|
||||
|
||||
@@ -33,11 +33,15 @@ import org.oscim.tiling.MapTile;
|
||||
import org.oscim.tiling.TileLoader;
|
||||
import org.oscim.tiling.TileManager;
|
||||
import org.oscim.utils.FastMath;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class BitmapTileLayer extends TileLayer<TileLoader> {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger(BitmapTileLayer.class);
|
||||
|
||||
private static final int TIMEOUT_CONNECT = 5000;
|
||||
private static final int TIMEOUT_READ = 10000;
|
||||
protected static final String TAG = BitmapTileLayer.class.getName();
|
||||
|
||||
final TileSource mTileSource;
|
||||
private final FadeStep[] mFade;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
package org.oscim.layers.tile.example;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.oscim.backend.canvas.Paint.Cap;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
@@ -28,9 +27,11 @@ import org.oscim.theme.renderinstruction.Line;
|
||||
import org.oscim.tiling.MapTile;
|
||||
import org.oscim.tiling.TileLoader;
|
||||
import org.oscim.tiling.TileManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TestTileLayer extends TileLayer<TestTileLoader> {
|
||||
final static String TAG = TestTileLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TestTileLayer.class);
|
||||
|
||||
public TestTileLayer(Map map) {
|
||||
super(map);
|
||||
@@ -51,7 +52,7 @@ public class TestTileLayer extends TileLayer<TestTileLoader> {
|
||||
|
||||
@Override
|
||||
public boolean executeJob(MapTile tile) {
|
||||
Log.d(TAG, "load tile " + tile);
|
||||
log.debug("load tile " + tile);
|
||||
tile.layers = new ElementLayers();
|
||||
|
||||
LineLayer ll = tile.layers.getLineLayer(0);
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.oscim.tiling.TileRenderer;
|
||||
import org.oscim.utils.FastMath;
|
||||
|
||||
public class BuildingLayer extends Layer {
|
||||
//private final static String TAG = BuildingOverlay.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(BuildingOverlay.class);
|
||||
|
||||
final ExtrusionRenderer mExtLayer;
|
||||
|
||||
@@ -64,7 +64,7 @@ public class BuildingLayer extends Layer {
|
||||
} else
|
||||
mStartTime = 0;
|
||||
}
|
||||
//Log.d(TAG, show + " > " + mAlpha);
|
||||
//log.debug(show + " > " + mAlpha);
|
||||
super.update(pos, changed, m);
|
||||
}
|
||||
};
|
||||
@@ -88,12 +88,12 @@ public class BuildingLayer extends Layer {
|
||||
// multi--;
|
||||
// if (!mActive && mAlpha > 0) {
|
||||
// // finish hiding
|
||||
// //Log.d(TAG, "add multi hide timer " + mAlpha);
|
||||
// //log.debug("add multi hide timer " + mAlpha);
|
||||
// addShowTimer(mFadeTime * mAlpha, false);
|
||||
// }
|
||||
// } else if (action == MotionEvent.ACTION_CANCEL) {
|
||||
// multi = 0;
|
||||
// Log.d(TAG, "cancel " + multi);
|
||||
// log.debug("cancel " + multi);
|
||||
// if (mTimer != null) {
|
||||
// mTimer.cancel();
|
||||
// mTimer = null;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
package org.oscim.layers.tile.vector;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.layers.tile.TileLayer;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.theme.IRenderTheme;
|
||||
@@ -23,6 +22,8 @@ import org.oscim.tiling.TileManager;
|
||||
import org.oscim.tiling.source.ITileDataSource;
|
||||
import org.oscim.tiling.source.TileSource;
|
||||
import org.oscim.tiling.source.TileSource.OpenResult;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The vector-tile-map layer. This class manages instances of
|
||||
@@ -30,7 +31,7 @@ import org.oscim.tiling.source.TileSource.OpenResult;
|
||||
* for rendering.
|
||||
*/
|
||||
public class VectorTileLayer extends TileLayer<VectorTileLoader> {
|
||||
private final static String TAG = VectorTileLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(VectorTileLayer.class);
|
||||
|
||||
private TileSource mTileSource;
|
||||
|
||||
@@ -62,7 +63,7 @@ public class VectorTileLayer extends TileLayer<VectorTileLoader> {
|
||||
OpenResult msg = tileSource.open();
|
||||
|
||||
if (msg != OpenResult.SUCCESS) {
|
||||
Log.d(TAG, msg.getErrorMessage());
|
||||
log.debug(msg.getErrorMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
*/
|
||||
package org.oscim.layers.tile.vector;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
||||
import org.oscim.core.MapElement;
|
||||
import org.oscim.core.MercatorProjection;
|
||||
@@ -50,7 +51,7 @@ import org.oscim.utils.LineClipper;
|
||||
|
||||
public class VectorTileLoader extends TileLoader implements IRenderTheme.Callback, ITileDataSink {
|
||||
|
||||
private static final String TAG = VectorTileLoader.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(VectorTileLoader.class);
|
||||
|
||||
private static final double STROKE_INCREASE = Math.sqrt(2.5);
|
||||
private static final byte LAYERS = 11;
|
||||
@@ -104,17 +105,17 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
public boolean executeJob(MapTile tile) {
|
||||
|
||||
if (mTileDataSource == null) {
|
||||
Log.d(TAG, "no tile source is set");
|
||||
log.debug("no tile source is set");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (renderTheme == null) {
|
||||
Log.d(TAG, "no theme is set");
|
||||
log.debug("no theme is set");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Map.debugTheme)
|
||||
Log.d(TAG, tile.toString());
|
||||
log.debug(tile.toString());
|
||||
|
||||
// account for area changes with latitude
|
||||
double lat = MercatorProjection.toLatitude(tile.y);
|
||||
@@ -232,7 +233,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
}
|
||||
|
||||
//private void debugUnmatched(boolean closed, TagSet tags) {
|
||||
// Log.d(TAG, "DBG way not matched: " + closed + " "
|
||||
// log.debug("DBG way not matched: " + closed + " "
|
||||
// + Arrays.deepToString(tags));
|
||||
//
|
||||
// mTagName = new Tag("name", tags[0].key + ":"
|
||||
@@ -246,7 +247,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
private void renderWay(RenderInstruction[] ri) {
|
||||
if (ri == null) {
|
||||
if (Map.debugTheme)
|
||||
Log.d(TAG, "no rule for way: " + mElement.tags);
|
||||
log.debug("no rule for way: " + mElement.tags);
|
||||
return;
|
||||
}
|
||||
for (int i = 0, n = ri.length; i < n; i++)
|
||||
@@ -256,7 +257,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
private void renderNode(RenderInstruction[] ri) {
|
||||
if (ri == null) {
|
||||
if (Map.debugTheme)
|
||||
Log.d(TAG, "no rule for node: " + mElement.tags);
|
||||
log.debug("no rule for node: " + mElement.tags);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -275,7 +276,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
|
||||
if (line.stipple == 0) {
|
||||
if (line.outline && mCurLineLayer == null) {
|
||||
Log.d(TAG, "missing line for outline! " + mElement.tags
|
||||
log.debug("missing line for outline! " + mElement.tags
|
||||
+ " lvl:" + level + " layer:" + mElement.layer);
|
||||
return;
|
||||
}
|
||||
@@ -397,7 +398,7 @@ public class VectorTileLoader extends TileLoader implements IRenderTheme.Callbac
|
||||
public void renderPointSymbol(Symbol symbol) {
|
||||
if (symbol.texture == null) {
|
||||
if (Map.debugTheme)
|
||||
Log.d(TAG, "missing symbol for " + mElement.tags.toString());
|
||||
log.debug("missing symbol for " + mElement.tags.toString());
|
||||
return;
|
||||
}
|
||||
for (int i = 0, n = mElement.getNumPoints(); i < n; i++) {
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
package org.oscim.layers.tile.vector.labeling;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.event.EventListener;
|
||||
import org.oscim.event.MapEvent;
|
||||
@@ -22,9 +21,11 @@ import org.oscim.event.MotionEvent;
|
||||
import org.oscim.layers.Layer;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.tiling.TileRenderer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class LabelLayer extends Layer implements EventListener, Map.UpdateListener {
|
||||
private final static String TAG = LabelLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(LabelLayer.class);
|
||||
private final TextRenderer mTextRenderer;
|
||||
|
||||
private int multi;
|
||||
@@ -62,7 +63,7 @@ public class LabelLayer extends Layer implements EventListener, Map.UpdateListen
|
||||
mTextRenderer.hold(false);
|
||||
} else if (action == MotionEvent.ACTION_CANCEL) {
|
||||
multi = 0;
|
||||
Log.d(TAG, "cancel " + multi);
|
||||
log.debug("cancel " + multi);
|
||||
mTextRenderer.hold(false);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +87,7 @@ public class LabelLayer extends Layer implements EventListener, Map.UpdateListen
|
||||
// mTextRenderer.hold(false);
|
||||
// } else if (action == MotionEvent.ACTION_CANCEL) {
|
||||
// multi = 0;
|
||||
// Log.d(TAG, "cancel " + multi);
|
||||
// log.debug("cancel " + multi);
|
||||
// mTextRenderer.hold(false);
|
||||
// }
|
||||
//
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.oscim.utils.OBB2D;
|
||||
import org.oscim.utils.pool.Pool;
|
||||
|
||||
class TextRenderer extends ElementRenderer {
|
||||
//private final static String TAG = TextRenderLayer.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(TextRenderLayer.class);
|
||||
|
||||
private final static float MIN_CAPTION_DIST = 5;
|
||||
private final static float MIN_WAY_DIST = 3;
|
||||
@@ -210,7 +210,7 @@ class TextRenderer extends ElementRenderer {
|
||||
if (ll.active <= l.active)
|
||||
return 1;
|
||||
|
||||
//Log.d(TAG, "intersection " + lp.string + " <> " + ti.string
|
||||
//log.debug("intersection " + lp.string + " <> " + ti.string
|
||||
// + " at " + ti.x + ":" + ti.y);
|
||||
|
||||
if (!ll.text.caption
|
||||
@@ -282,7 +282,7 @@ class TextRenderer extends ElementRenderer {
|
||||
boolean changedPos;
|
||||
|
||||
if (mTileSet.cnt == 0) {
|
||||
//Log.d(TAG, "no tiles "+ mTileSet.getSerial());
|
||||
//log.debug("no tiles "+ mTileSet.getSerial());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ class TextRenderer extends ElementRenderer {
|
||||
}
|
||||
|
||||
if (!changedTiles && !changedPos) {
|
||||
//Log.d(TAG, "not changed " + changedTiles + " " + changedPos);
|
||||
//log.debug("not changed " + changedTiles + " " + changedPos);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -636,7 +636,7 @@ class TextRenderer extends ElementRenderer {
|
||||
return;
|
||||
}
|
||||
long now = System.currentTimeMillis();
|
||||
//Log.d(TAG, "relabel after " + (now - mLastRun));
|
||||
//log.debug("relabel after " + (now - mLastRun));
|
||||
mLastRun = now;
|
||||
|
||||
labelsChanged = updateLabels();
|
||||
@@ -678,7 +678,7 @@ class TextRenderer extends ElementRenderer {
|
||||
} else {
|
||||
mRequestRun = true;
|
||||
long delay = (mLastRun + MAX_RELABEL_DELAY) - System.currentTimeMillis();
|
||||
//Log.d(TAG, "relabel in: " + delay);
|
||||
//log.debug("relabel in: " + delay);
|
||||
mMap.postDelayed(mLabelUpdate, Math.max(delay, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public final class WayDecorator {
|
||||
float area = GeometryUtils.area(prevX, prevY, curX, curY, nextX, nextY);
|
||||
|
||||
if (area > 1000) {
|
||||
//Log.d(">>>", "b: " + string + " " + area );
|
||||
//log.debug("b: " + string + " " + area );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public final class WayDecorator {
|
||||
|
||||
// avoid adding short segments that add much area
|
||||
if (area / 2 > a * a) {
|
||||
//Log.d(">>>", "a: " +string + " " + area + " " + a*a);
|
||||
//log.debug("a: " +string + " " + area + " " + a*a);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public final class WayDecorator {
|
||||
|
||||
// maximum angle between segments
|
||||
if (diff > 0.1 || diff < -0.1) {
|
||||
//Log.d(">>>", "c: " + string + " " + area );
|
||||
//log.debug("c: " + string + " " + area );
|
||||
break;
|
||||
}
|
||||
curX = nextX;
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.BoundingBox;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.event.Dispatcher;
|
||||
@@ -37,10 +36,12 @@ import org.oscim.theme.InternalRenderTheme;
|
||||
import org.oscim.theme.ThemeLoader;
|
||||
import org.oscim.tiling.source.TileSource;
|
||||
import org.oscim.utils.async.AsyncExecutor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public abstract class Map implements EventDispatcher {
|
||||
|
||||
private static final String TAG = Map.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(Map.class);
|
||||
|
||||
public static final boolean debugTheme = false;
|
||||
|
||||
@@ -99,18 +100,18 @@ public abstract class Map implements EventDispatcher {
|
||||
*/
|
||||
public void setTheme(InternalRenderTheme theme) {
|
||||
if (mBaseLayer == null) {
|
||||
Log.e(TAG, "No base layer set");
|
||||
log.error("No base layer set");
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
if (mCurrentTheme == theme) {
|
||||
Log.d(TAG, "same theme: " + theme);
|
||||
log.debug("same theme: " + theme);
|
||||
return;
|
||||
}
|
||||
|
||||
IRenderTheme t = ThemeLoader.load(theme);
|
||||
if (t == null) {
|
||||
Log.e(TAG, "Invalid theme");
|
||||
log.error("Invalid theme");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.oscim.utils.FastMath;
|
||||
|
||||
public class MapAnimator {
|
||||
|
||||
//private static final String TAG = MapAnimator.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(MapAnimator.class);
|
||||
|
||||
public MapAnimator(Map map, Viewport viewport) {
|
||||
mViewport = viewport;
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.oscim.utils.FastMath;
|
||||
* Public methods are thread safe.
|
||||
*/
|
||||
public class Viewport {
|
||||
//private static final String TAG = Viewport.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(Viewport.class);
|
||||
|
||||
public final static int MAX_ZOOMLEVEL = 22;
|
||||
public final static int MIN_ZOOMLEVEL = 2;
|
||||
|
||||
@@ -20,10 +20,11 @@ import java.nio.Buffer;
|
||||
import javax.annotation.CheckReturnValue;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public final class BufferObject {
|
||||
private final static String TAG = BufferObject.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(BufferObject.class);
|
||||
private static final int MB = 1024 * 1024;
|
||||
private static final int LIMIT_BUFFERS = 16 * MB;
|
||||
|
||||
@@ -83,11 +84,11 @@ public final class BufferObject {
|
||||
if (mBufferMemoryUsage < LIMIT_BUFFERS)
|
||||
return;
|
||||
|
||||
Log.d(TAG, "use: " + mBufferMemoryUsage / MB + "MB");
|
||||
log.debug("use: " + mBufferMemoryUsage / MB + "MB");
|
||||
|
||||
mBufferMemoryUsage -= BufferObject.limitUsage(1024 * 1024);
|
||||
|
||||
Log.d(TAG, "now: " + mBufferMemoryUsage / MB + "MB");
|
||||
log.debug("now: " + mBufferMemoryUsage / MB + "MB");
|
||||
}
|
||||
|
||||
private final static BufferObject pool[] = new BufferObject[2];
|
||||
@@ -137,7 +138,7 @@ public final class BufferObject {
|
||||
return null;
|
||||
|
||||
// if (counter > 200) {
|
||||
// Log.d(TAG, "should clear some buffers " + counter);
|
||||
// log.debug("should clear some buffers " + counter);
|
||||
// }
|
||||
int t = (bo.target == GL20.GL_ARRAY_BUFFER) ? 0 : 1;
|
||||
|
||||
@@ -160,7 +161,7 @@ public final class BufferObject {
|
||||
BufferObject prev = pool[t];
|
||||
|
||||
if (prev == null) {
|
||||
Log.d(TAG, "nothing to free");
|
||||
log.debug("nothing to free");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ package org.oscim.renderer;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.renderer.MapRenderer.Matrices;
|
||||
@@ -30,13 +29,15 @@ import org.oscim.renderer.elements.PolygonLayer;
|
||||
import org.oscim.renderer.elements.RenderElement;
|
||||
import org.oscim.renderer.elements.TextureLayer;
|
||||
import org.oscim.utils.FastMath;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Base class to use the renderer.elements for drawing
|
||||
*/
|
||||
public abstract class ElementRenderer extends LayerRenderer {
|
||||
|
||||
private static final String TAG = ElementRenderer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(ElementRenderer.class);
|
||||
|
||||
private static short[] fillCoords;
|
||||
|
||||
@@ -95,7 +96,7 @@ public abstract class ElementRenderer extends LayerRenderer {
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.d(TAG, "invalid layer");
|
||||
log.debug("invalid layer");
|
||||
l = l.next;
|
||||
break;
|
||||
}
|
||||
@@ -155,7 +156,7 @@ public abstract class ElementRenderer extends LayerRenderer {
|
||||
layers.compile(sbuf, addFill);
|
||||
|
||||
if (newSize != sbuf.position()) {
|
||||
Log.d(TAG, "wrong size: "
|
||||
log.debug("wrong size: "
|
||||
+ " new size: " + newSize
|
||||
+ " buffer pos: " + sbuf.position()
|
||||
+ " buffer limit: " + sbuf.limit()
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
package org.oscim.renderer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.core.Tile;
|
||||
@@ -29,7 +30,7 @@ import org.oscim.tiling.TileSet;
|
||||
// this class work on ExtrusionLayers
|
||||
|
||||
public class ExtrusionRenderer extends LayerRenderer {
|
||||
private final static String TAG = ExtrusionRenderer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(ExtrusionRenderer.class);
|
||||
|
||||
private final TileRenderer mTileLayer;
|
||||
|
||||
@@ -69,7 +70,7 @@ public class ExtrusionRenderer extends LayerRenderer {
|
||||
}
|
||||
|
||||
if (shaderProgram[i] == 0) {
|
||||
Log.e(TAG, "Could not create extrusion shader program. " + i);
|
||||
log.error("Could not create extrusion shader program. " + i);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,12 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.FloatBuffer;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GLMatrix {
|
||||
|
||||
private final static String TAG = GLMatrix.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(GLMatrix.class);
|
||||
private final static boolean dbg = false;
|
||||
|
||||
private final long pointer;
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
package org.oscim.renderer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GLState {
|
||||
private final static String TAG = GLState.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(GLState.class);
|
||||
|
||||
private static GL20 GL;
|
||||
|
||||
@@ -89,7 +90,7 @@ public class GLState {
|
||||
|
||||
public static void enableVertexArrays(int va1, int va2) {
|
||||
if (va1 > 1 || va2 > 1)
|
||||
Log.d(TAG, "FIXME: enableVertexArrays...");
|
||||
log.debug("FIXME: enableVertexArrays...");
|
||||
|
||||
if ((va1 == 0 || va2 == 0)) {
|
||||
if (!vertexArray[0]) {
|
||||
|
||||
@@ -21,14 +21,15 @@ import java.nio.IntBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.utils.FastMath;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Utility functions
|
||||
*/
|
||||
public class GLUtils {
|
||||
private static String TAG = GLUtils.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(GLUtils.class);
|
||||
|
||||
private static GL20 GL;
|
||||
|
||||
@@ -169,8 +170,8 @@ public class GLUtils {
|
||||
GL.glGetShaderiv(shader, GL20.GL_COMPILE_STATUS, compiled);
|
||||
compiled.position(0);
|
||||
if (compiled.get() == 0) {
|
||||
Log.e(TAG, "Could not compile shader " + shaderType + ":");
|
||||
Log.e(TAG, GL.glGetShaderInfoLog(shader));
|
||||
log.error("Could not compile shader " + shaderType + ":");
|
||||
log.error(GL.glGetShaderInfoLog(shader));
|
||||
GL.glDeleteShader(shader);
|
||||
shader = 0;
|
||||
}
|
||||
@@ -208,8 +209,8 @@ public class GLUtils {
|
||||
GL.glGetProgramiv(program, GL20.GL_LINK_STATUS, linkStatus);
|
||||
linkStatus.position(0);
|
||||
if (linkStatus.get() != GL20.GL_TRUE) {
|
||||
Log.e(TAG, "Could not link program: ");
|
||||
Log.e(TAG, GL.glGetProgramInfoLog(program));
|
||||
log.error("Could not link program: ");
|
||||
log.error(GL.glGetProgramInfoLog(program));
|
||||
GL.glDeleteProgram(program);
|
||||
program = 0;
|
||||
}
|
||||
@@ -226,7 +227,7 @@ public class GLUtils {
|
||||
|
||||
int error;
|
||||
while ((error = GL.glGetError()) != 0) { // GL20.GL_NO_ERROR) {
|
||||
Log.e(TAG, op + ": glError " + error);
|
||||
log.error(op + ": glError " + error);
|
||||
// throw new RuntimeException(op + ": glError " + error);
|
||||
}
|
||||
}
|
||||
@@ -235,7 +236,7 @@ public class GLUtils {
|
||||
int error;
|
||||
boolean oom = false;
|
||||
while ((error = GL.glGetError()) != 0) {// GL20.GL_NO_ERROR) {
|
||||
Log.e(TAG, op + ": glError " + error);
|
||||
log.error(op + ": glError " + error);
|
||||
// throw new RuntimeException(op + ": glError " + error);
|
||||
if (error == 1285)
|
||||
oom = true;
|
||||
@@ -248,7 +249,7 @@ public class GLUtils {
|
||||
GL.glUniform4f(handle, c[0], c[1], c[2], c[3]);
|
||||
} else {
|
||||
if (alpha < 0) {
|
||||
Log.d(TAG, "setColor: " + alpha);
|
||||
log.debug("setColor: " + alpha);
|
||||
alpha = 0;
|
||||
GL.glUniform4f(handle, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.map.Map;
|
||||
import org.oscim.map.Viewport;
|
||||
@@ -30,9 +29,11 @@ import org.oscim.renderer.elements.ElementLayers;
|
||||
import org.oscim.tiling.MapTile;
|
||||
import org.oscim.utils.pool.Inlist;
|
||||
import org.oscim.utils.pool.Pool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class MapRenderer {
|
||||
private static final String TAG = MapRenderer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(MapRenderer.class);
|
||||
|
||||
static GL20 GL;
|
||||
|
||||
@@ -165,7 +166,7 @@ public class MapRenderer {
|
||||
int tmpBufferSize;
|
||||
|
||||
void growBuffer(int size) {
|
||||
//Log.d(TAG, "grow buffer " + size);
|
||||
//log.debug("grow buffer " + size);
|
||||
// 32kb min size
|
||||
if (size < (1 << 15))
|
||||
size = (1 << 15);
|
||||
@@ -258,7 +259,7 @@ public class MapRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
//Log.d(TAG, "begin frame");
|
||||
//log.debug("begin frame");
|
||||
GLState.bindTex2D(-1);
|
||||
GLState.useProgram(-1);
|
||||
//GL.glBindTexture(GL20.GL_TEXTURE_2D, 0);
|
||||
@@ -294,7 +295,7 @@ public class MapRenderer {
|
||||
}
|
||||
|
||||
public void onSurfaceChanged(int width, int height) {
|
||||
Log.d(TAG, "SurfaceChanged:" + mNewSurface + " " + width + "x" + height);
|
||||
log.debug("SurfaceChanged:" + mNewSurface + " " + width + "x" + height);
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
@@ -379,8 +380,8 @@ public class MapRenderer {
|
||||
public void onSurfaceCreated() {
|
||||
GL = GLAdapter.get();
|
||||
|
||||
// Log.d(TAG, "surface created");
|
||||
// Log.d(TAG, GL.glGetString(GL20.GL_EXTENSIONS));
|
||||
// log.debug("surface created");
|
||||
// log.debug(GL.glGetString(GL20.GL_EXTENSIONS));
|
||||
|
||||
GLState.init(GL);
|
||||
GLUtils.init(GL);
|
||||
|
||||
@@ -61,13 +61,14 @@ package org.oscim.renderer.atlas;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
import org.oscim.renderer.elements.TextureItem;
|
||||
import org.oscim.utils.pool.Inlist;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TextureAtlas extends Inlist<TextureAtlas> {
|
||||
private final static String TAG = TextureAtlas.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TextureAtlas.class);
|
||||
|
||||
/** Allocated slots */
|
||||
public Slot mSlots;
|
||||
@@ -96,7 +97,7 @@ public class TextureAtlas extends Inlist<TextureAtlas> {
|
||||
return texture;
|
||||
}
|
||||
|
||||
Log.d(TAG, "Missing atlas texture");
|
||||
log.debug("Missing atlas texture");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.oscim.renderer.MapRenderer.Matrices;
|
||||
*/
|
||||
public class BitmapLayer extends TextureLayer {
|
||||
|
||||
// private final static String TAG = BitmapLayer.class.getName();
|
||||
// static final Logger log = LoggerFactory.getLogger(BitmapLayer.class);
|
||||
private Bitmap mBitmap;
|
||||
private final boolean mReuseBitmap;
|
||||
private final short[] mVertices;
|
||||
@@ -151,7 +151,7 @@ public class BitmapLayer extends TextureLayer {
|
||||
|
||||
public static final class Renderer {
|
||||
|
||||
//private final static String TAG = BitmapRenderer.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(BitmapRenderer.class);
|
||||
|
||||
public final static boolean debug = true;
|
||||
|
||||
|
||||
@@ -17,12 +17,13 @@ package org.oscim.renderer.elements;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.renderer.BufferObject;
|
||||
import org.oscim.theme.renderinstruction.Line;
|
||||
|
||||
public class ElementLayers {
|
||||
private final static String TAG = ElementLayers.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(ElementLayers.class);
|
||||
|
||||
public static void initRenderer(GL20 gl) {
|
||||
RenderElement.GL = gl;
|
||||
@@ -183,7 +184,7 @@ public class ElementLayers {
|
||||
|
||||
if (renderElement.type != type) {
|
||||
// check if found layer matches requested type
|
||||
Log.d(TAG, "BUG wrong layer " + renderElement.type + " " + type +
|
||||
log.debug("BUG wrong layer " + renderElement.type + " " + type +
|
||||
" on layer " + renderElement.level);
|
||||
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
@@ -18,7 +18,8 @@ import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.core.MapElement;
|
||||
import org.oscim.core.Tile;
|
||||
@@ -34,7 +35,7 @@ import org.oscim.utils.pool.Inlist;
|
||||
* angles! or bad things might happen in Triangle
|
||||
*/
|
||||
public class ExtrusionLayer extends RenderElement {
|
||||
private final static String TAG = ExtrusionLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(ExtrusionLayer.class);
|
||||
|
||||
private static final float S = MapRenderer.COORD_SCALE;
|
||||
private VertexItem mVertices;
|
||||
@@ -129,7 +130,7 @@ public class ExtrusionLayer extends RenderElement {
|
||||
if (points[ppos] == points[ppos + len - 2]
|
||||
&& points[ppos + 1] == points[ppos + len - 1]) {
|
||||
len -= 2;
|
||||
Log.d(TAG, "explicit closed poly " + len);
|
||||
log.debug("explicit closed poly " + len);
|
||||
}
|
||||
|
||||
// need at least three points
|
||||
|
||||
@@ -18,7 +18,8 @@ import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.backend.canvas.Paint.Cap;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.core.MapPosition;
|
||||
@@ -33,7 +34,7 @@ import org.oscim.utils.FastMath;
|
||||
/**
|
||||
*/
|
||||
public final class LineLayer extends RenderElement {
|
||||
private final static String TAG = LineLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(LineLayer.class);
|
||||
|
||||
private static final float COORD_SCALE = MapRenderer.COORD_SCALE;
|
||||
// scale factor mapping extrusion vector to short values
|
||||
@@ -85,7 +86,7 @@ public final class LineLayer extends RenderElement {
|
||||
else if (geom.isLine())
|
||||
addLine(geom.points, geom.index, -1, false);
|
||||
else
|
||||
Log.d(TAG, "geometry must be LINE or POLYGON");
|
||||
log.debug("geometry must be LINE or POLYGON");
|
||||
}
|
||||
|
||||
public void addLine(float[] points, int numPoints, boolean closed) {
|
||||
@@ -606,14 +607,14 @@ public final class LineLayer extends RenderElement {
|
||||
lineProgram[0] = GLUtils.createProgram(lineVertexShader,
|
||||
lineFragmentShader);
|
||||
if (lineProgram[0] == 0) {
|
||||
Log.e(TAG, "Could not create line program.");
|
||||
log.error("Could not create line program.");
|
||||
//return false;
|
||||
}
|
||||
|
||||
lineProgram[1] = GLUtils.createProgram(lineVertexShader,
|
||||
lineSimpleFragmentShader);
|
||||
if (lineProgram[1] == 0) {
|
||||
Log.e(TAG, "Could not create simple line program.");
|
||||
log.error("Could not create simple line program.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.nio.ByteOrder;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.renderer.GLState;
|
||||
@@ -27,6 +26,8 @@ import org.oscim.renderer.GLUtils;
|
||||
import org.oscim.renderer.MapRenderer;
|
||||
import org.oscim.renderer.MapRenderer.Matrices;
|
||||
import org.oscim.theme.renderinstruction.Line;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* RenderElement for textured or stippled lines
|
||||
@@ -34,7 +35,7 @@ import org.oscim.theme.renderinstruction.Line;
|
||||
*/
|
||||
public final class LineTexLayer extends RenderElement {
|
||||
|
||||
private final static String TAG = LineTexLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(LineTexLayer.class);
|
||||
|
||||
// Interleave two segment quads in one block to be able to use
|
||||
// vertices twice. pos0 and pos1 use the same vertex array where
|
||||
@@ -276,7 +277,7 @@ public final class LineTexLayer extends RenderElement {
|
||||
|
||||
shader = GLUtils.createProgram(vertexShader, fragmentShader);
|
||||
if (shader == 0) {
|
||||
Log.e(TAG, "Could not create program.");
|
||||
log.error("Could not create program.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ package org.oscim.renderer.elements;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.core.MapPosition;
|
||||
@@ -28,9 +27,11 @@ import org.oscim.renderer.MapRenderer;
|
||||
import org.oscim.renderer.MapRenderer.Matrices;
|
||||
import org.oscim.utils.Tessellator;
|
||||
import org.oscim.utils.pool.Inlist;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class MeshLayer extends RenderElement {
|
||||
private static final String TAG = MeshLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(MeshLayer.class);
|
||||
|
||||
BufferObject indicesVbo;
|
||||
int numIndices;
|
||||
@@ -44,7 +45,7 @@ public class MeshLayer extends RenderElement {
|
||||
|
||||
public void addMesh(GeometryBuffer geom) {
|
||||
if (geom.index[0] < 6) {
|
||||
Log.d(TAG, "invalid poly");
|
||||
log.debug("invalid poly");
|
||||
return;
|
||||
}
|
||||
if (vertexItems == null) {
|
||||
@@ -59,7 +60,7 @@ public class MeshLayer extends RenderElement {
|
||||
|
||||
verticesCnt = vertexItems.getSize() / 2;
|
||||
|
||||
//Log.d(TAG, "-> " + verticesCnt + " " + numIndices);
|
||||
//log.debug("-> " + verticesCnt + " " + numIndices);
|
||||
|
||||
if (numIndices <= 0) {
|
||||
vertexItems = VertexItem.pool.releaseAll(vertexItems);
|
||||
@@ -74,13 +75,13 @@ public class MeshLayer extends RenderElement {
|
||||
return;
|
||||
}
|
||||
|
||||
//Log.d(TAG, "compile");
|
||||
//log.debug("compile");
|
||||
// add vertices to shared VBO
|
||||
ElementLayers.addPoolItems(this, sbuf);
|
||||
|
||||
int cnt = indiceItems.getSize();
|
||||
|
||||
//Log.d(TAG, "check " + cnt + ":" + numIndices);
|
||||
//log.debug("check " + cnt + ":" + numIndices);
|
||||
|
||||
if (cnt != numIndices) {
|
||||
numIndices = cnt;
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.nio.FloatBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.core.Tile;
|
||||
@@ -32,12 +31,14 @@ import org.oscim.renderer.MapRenderer.Matrices;
|
||||
import org.oscim.theme.renderinstruction.Area;
|
||||
import org.oscim.utils.FastMath;
|
||||
import org.oscim.utils.Interpolation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Special Renderer for drawing tile polygons
|
||||
*/
|
||||
public final class PolygonLayer extends RenderElement {
|
||||
private static final String TAG = PolygonLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(PolygonLayer.class);
|
||||
|
||||
private static final float S = MapRenderer.COORD_SCALE;
|
||||
|
||||
@@ -164,7 +165,7 @@ public final class PolygonLayer extends RenderElement {
|
||||
}
|
||||
|
||||
if (polygonProgram[i] == 0) {
|
||||
Log.e(TAG, "Could not create polygon program.");
|
||||
log.error("Could not create polygon program.");
|
||||
return false;
|
||||
}
|
||||
hPolygonMatrix[i] = GL.glGetUniformLocation(polygonProgram[i], "u_mvp");
|
||||
|
||||
@@ -16,13 +16,14 @@ package org.oscim.renderer.elements;
|
||||
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
import org.oscim.renderer.atlas.TextureAtlas;
|
||||
import org.oscim.utils.pool.Inlist;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public final class SymbolLayer extends TextureLayer {
|
||||
private final static String TAG = SymbolLayer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(SymbolLayer.class);
|
||||
|
||||
private final static float SCALE = 8.0f;
|
||||
private final static int VERTICES_PER_SPRITE = 4;
|
||||
@@ -109,7 +110,7 @@ public final class SymbolLayer extends TextureLayer {
|
||||
}
|
||||
|
||||
if (to == null) {
|
||||
Log.d(TAG, "Bad SymbolItem");
|
||||
log.debug("Bad SymbolItem");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.oscim.utils.pool.Inlist;
|
||||
import org.oscim.utils.pool.SyncPool;
|
||||
|
||||
public class TextItem extends Inlist<TextItem> {
|
||||
//private final static String TAG = TextItem.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(TextItem.class);
|
||||
private final static int MAX_POOL = 250;
|
||||
|
||||
public final static SyncPool<TextItem> pool = new SyncPool<TextItem>(MAX_POOL) {
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.oscim.backend.canvas.Canvas;
|
||||
|
||||
public final class TextLayer extends TextureLayer {
|
||||
|
||||
//private static String TAG = TextureLayer.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(TextureLayer.class);
|
||||
|
||||
private final static int LBIT_MASK = 0xfffffffe;
|
||||
|
||||
|
||||
@@ -18,19 +18,20 @@ import java.util.ArrayList;
|
||||
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.oscim.renderer.GLState;
|
||||
import org.oscim.renderer.GLUtils;
|
||||
import org.oscim.utils.pool.Inlist;
|
||||
import org.oscim.utils.pool.SyncPool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
// FIXME needs rewrite!
|
||||
// TODO use separate pools for different bitmap types and dimensions
|
||||
|
||||
public class TextureItem extends Inlist<TextureItem> {
|
||||
private final static String TAG = TextureItem.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TextureItem.class);
|
||||
|
||||
private static GL20 GL;
|
||||
|
||||
@@ -126,7 +127,7 @@ public class TextureItem extends Inlist<TextureItem> {
|
||||
@Override
|
||||
public void init(int num) {
|
||||
if (pool != null) {
|
||||
Log.d(TAG, "still textures in pool! " + fill);
|
||||
log.debug("still textures in pool! " + fill);
|
||||
pool = null;
|
||||
}
|
||||
|
||||
@@ -242,12 +243,12 @@ public class TextureItem extends Inlist<TextureItem> {
|
||||
t.id = textureIds[0];
|
||||
initTexture(t);
|
||||
if (TextureLayer.Renderer.debug)
|
||||
Log.d(TAG, "fill:" + pool.getFill()
|
||||
log.debug("fill:" + pool.getFill()
|
||||
+ " count:" + mTexCnt
|
||||
+ " new texture " + t.id);
|
||||
}
|
||||
|
||||
//Log.d(TAG, "UPLOAD ID: " + t.id);
|
||||
//log.debug("UPLOAD ID: " + t.id);
|
||||
|
||||
uploadTexture(t, t.bitmap,
|
||||
mBitmapFormat, mBitmapType,
|
||||
@@ -265,7 +266,7 @@ public class TextureItem extends Inlist<TextureItem> {
|
||||
int format, int type, int w, int h) {
|
||||
|
||||
if (t == null) {
|
||||
Log.d(TAG, "no texture!");
|
||||
log.debug("no texture!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -282,7 +283,7 @@ public class TextureItem extends Inlist<TextureItem> {
|
||||
}
|
||||
|
||||
if (TextureLayer.Renderer.debug)
|
||||
GLUtils.checkGlError(TAG);
|
||||
GLUtils.checkGlError(TextureItem.class.getName());
|
||||
}
|
||||
|
||||
private static void initTexture(TextureItem t) {
|
||||
@@ -309,7 +310,7 @@ public class TextureItem extends Inlist<TextureItem> {
|
||||
static void init(GL20 gl, int num) {
|
||||
GL = gl;
|
||||
|
||||
Log.d(TAG, "init textures " + num);
|
||||
log.debug("init textures " + num);
|
||||
mTexCnt = num;
|
||||
pool.init(num);
|
||||
|
||||
@@ -342,7 +343,7 @@ public class TextureItem extends Inlist<TextureItem> {
|
||||
// Bitmap.Config.ARGB_8888);
|
||||
//
|
||||
// if (TextureRenderer.debug)
|
||||
// Log.d(TAG, "alloc bitmap: " +
|
||||
// log.debug("alloc bitmap: " +
|
||||
// android.os.Debug.getNativeHeapAllocatedSize() / (1024 *
|
||||
// 1024));
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public abstract class TextureLayer extends RenderElement {
|
||||
}
|
||||
|
||||
public static final class Renderer {
|
||||
//private final static String TAG = TextureRenderer.class.getName();
|
||||
//static final Logger log = LoggerFactory.getLogger(TextureRenderer.class);
|
||||
|
||||
public final static boolean debug = false;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.oscim.renderer.test;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
import org.oscim.backend.canvas.Paint.Cap;
|
||||
import org.oscim.core.MapPosition;
|
||||
@@ -16,9 +15,13 @@ import org.oscim.renderer.elements.TextItem;
|
||||
import org.oscim.renderer.elements.TextLayer;
|
||||
import org.oscim.theme.renderinstruction.Line;
|
||||
import org.oscim.theme.renderinstruction.Text;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class AtlasRenderLayer extends ElementRenderer {
|
||||
|
||||
Logger log = LoggerFactory.getLogger(AtlasRenderLayer.class);
|
||||
|
||||
public AtlasRenderLayer() {
|
||||
|
||||
TextureAtlas mAtlas = TextureAtlas.create(2048, 2048, 1);
|
||||
@@ -46,7 +49,7 @@ public class AtlasRenderLayer extends ElementRenderer {
|
||||
int h = (int) (20 + Math.random() * 56);
|
||||
Rect r = mAtlas.getRegion(w, h);
|
||||
if (r == null) {
|
||||
Log.d("...", "no space left");
|
||||
log.debug("no space left");
|
||||
continue;
|
||||
}
|
||||
r.x += 1;
|
||||
@@ -77,7 +80,7 @@ public class AtlasRenderLayer extends ElementRenderer {
|
||||
points[8] = r.x;
|
||||
points[9] = r.y;
|
||||
|
||||
Log.d("...", "add region: " + Arrays.toString(points));
|
||||
log.debug("add region: " + Arrays.toString(points));
|
||||
ll2.addLine(points, 10, false);
|
||||
|
||||
TextItem ti = TextItem.pool.get();
|
||||
|
||||
@@ -19,19 +19,20 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
||||
import org.oscim.core.TagSet;
|
||||
import org.oscim.theme.renderinstruction.RenderInstruction;
|
||||
import org.oscim.theme.rule.Element;
|
||||
import org.oscim.theme.rule.Rule;
|
||||
import org.oscim.utils.LRUCache;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A RenderTheme defines how map elements are drawn.
|
||||
*/
|
||||
public class RenderTheme implements IRenderTheme {
|
||||
private final static String TAG = RenderTheme.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(RenderTheme.class);
|
||||
|
||||
private static final int MATCHING_CACHE_SIZE = 512;
|
||||
|
||||
@@ -117,7 +118,7 @@ public class RenderTheme implements IRenderTheme {
|
||||
|
||||
int type = geometryType.nativeInt;
|
||||
if (type < 1 || type > 3) {
|
||||
Log.d(TAG, "invalid geometry type for RenderTheme " + geometryType.name());
|
||||
log.debug("invalid geometry type for RenderTheme " + geometryType.name());
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -134,7 +135,7 @@ public class RenderTheme implements IRenderTheme {
|
||||
} else {
|
||||
// compare if tags match previous instructions
|
||||
if (cache.cacheKey.set(tags, cache.prevItem.key)) {
|
||||
//Log.d(TAG, "same as previous " + Arrays.deepToString(tags));
|
||||
//log.debug("same as previous " + Arrays.deepToString(tags));
|
||||
ri = cache.prevItem;
|
||||
}
|
||||
}
|
||||
@@ -151,7 +152,7 @@ public class RenderTheme implements IRenderTheme {
|
||||
|
||||
if (ri == null) {
|
||||
// cache miss
|
||||
//Log.d(TAG, missCnt++ + " / " + hitCnt + " Cache Miss");
|
||||
//log.debug(missCnt++ + " / " + hitCnt + " Cache Miss");
|
||||
|
||||
List<RenderInstruction> matches = cache.instructionList;
|
||||
matches.clear();
|
||||
@@ -165,7 +166,7 @@ public class RenderTheme implements IRenderTheme {
|
||||
RenderInstruction r = matches.get(i);
|
||||
for (int j = i + 1; j < size; j++) {
|
||||
if (matches.get(j) == r) {
|
||||
Log.d(TAG, "fix duplicate instruction! "
|
||||
log.debug("fix duplicate instruction! "
|
||||
+ Arrays.deepToString(cache.cacheKey.mTags)
|
||||
+ " zoom:" + zoomLevel + " "
|
||||
+ r.getClass().getName());
|
||||
@@ -207,12 +208,10 @@ public class RenderTheme implements IRenderTheme {
|
||||
// this zoom level to the existing RenderInstructionItem.
|
||||
ri.zoom |= zoomMask;
|
||||
|
||||
//Log.d(TAG,
|
||||
// zoomLevel + " same instructions " + size + " "
|
||||
//log.debug( // zoomLevel + " same instructions " + size + " "
|
||||
// + Arrays.deepToString(tags));
|
||||
} else {
|
||||
//Log.d(TAG,
|
||||
// zoomLevel + " new instructions " + size + " "
|
||||
//log.debug( // zoomLevel + " new instructions " + size + " "
|
||||
// + Arrays.deepToString(tags));
|
||||
|
||||
ri = new RenderInstructionItem();
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.Stack;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.backend.XMLReaderAdapter;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
@@ -45,6 +44,8 @@ import org.oscim.theme.renderinstruction.RenderInstruction;
|
||||
import org.oscim.theme.renderinstruction.Symbol;
|
||||
import org.oscim.theme.renderinstruction.Text;
|
||||
import org.oscim.theme.rule.Rule;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
@@ -54,7 +55,7 @@ import org.xml.sax.helpers.DefaultHandler;
|
||||
* SAX2 handler to parse XML render theme files.
|
||||
*/
|
||||
public class RenderThemeHandler extends DefaultHandler {
|
||||
private final static String TAG = RenderThemeHandler.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(RenderThemeHandler.class);
|
||||
|
||||
private static final int RENDER_THEME_VERSION = 1;
|
||||
|
||||
@@ -119,7 +120,7 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
sb.append(name);
|
||||
sb.append('=');
|
||||
sb.append(value);
|
||||
Log.d(TAG, sb.toString());
|
||||
log.debug(sb.toString());
|
||||
}
|
||||
|
||||
private ArrayList<Rule> mRulesList = new ArrayList<Rule>();
|
||||
@@ -171,12 +172,12 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
|
||||
@Override
|
||||
public void error(SAXParseException exception) {
|
||||
Log.d(TAG, exception.getMessage());
|
||||
log.debug(exception.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warning(SAXParseException exception) {
|
||||
Log.d(TAG, exception.getMessage());
|
||||
log.debug(exception.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,7 +248,7 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
if (pt != null)
|
||||
mCurrentRule.addRenderingInstruction(pt);
|
||||
else
|
||||
Log.d(TAG, "BUG not a path text style: " + style);
|
||||
log.debug("BUG not a path text style: " + style);
|
||||
}
|
||||
|
||||
} else if ("symbol".equals(localName)) {
|
||||
@@ -273,7 +274,7 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
createTextureRegion(localName, attributes);
|
||||
|
||||
} else {
|
||||
Log.d(TAG, "unknown element: " + localName);
|
||||
log.debug("unknown element: " + localName);
|
||||
//throw new SAXException("unknown element: " + localName);
|
||||
}
|
||||
} catch (ThemeException e) {
|
||||
@@ -290,7 +291,7 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
TextureRegion texture = mTextureAtlas.getTextureRegion(src);
|
||||
|
||||
if (texture == null)
|
||||
Log.d(TAG, "missing texture atlas item '" + src + "'");
|
||||
log.debug("missing texture atlas item '" + src + "'");
|
||||
|
||||
return texture;
|
||||
}
|
||||
@@ -304,7 +305,7 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
if (use != null) {
|
||||
style = (Line) mStyles.get(LINE_STYLE + use);
|
||||
if (style == null) {
|
||||
Log.d(TAG, "missing line style 'use': " + use);
|
||||
log.debug("missing line style 'use': " + use);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -453,7 +454,7 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
if (use != null) {
|
||||
style = (Area) mStyles.get(AREA_STYLE + use);
|
||||
if (style == null) {
|
||||
Log.d(TAG, "missing area style 'use': " + use);
|
||||
log.debug("missing area style 'use': " + use);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -545,7 +546,7 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
if (b != null)
|
||||
texture = new TextureItem(b, true);
|
||||
} catch (Exception e) {
|
||||
Log.d(TAG, e.getMessage());
|
||||
log.debug(e.getMessage());
|
||||
}
|
||||
}
|
||||
return new Area(style, fill, stroke, strokeWidth, fade, level, blend,
|
||||
@@ -558,7 +559,7 @@ public class RenderThemeHandler extends DefaultHandler {
|
||||
if (line != null && line.outline)
|
||||
mCurrentRule.addRenderingInstruction(line);
|
||||
else
|
||||
Log.d(TAG, "BUG not an outline style: " + style);
|
||||
log.debug("BUG not an outline style: " + style);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,12 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.utils.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ThemeLoader {
|
||||
private final static String TAG = ThemeLoader.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(ThemeLoader.class);
|
||||
|
||||
/**
|
||||
* Load internal theme, see {@link InternalRenderTheme}.
|
||||
@@ -59,7 +60,7 @@ public class ThemeLoader {
|
||||
|
||||
return t;
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
log.error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ import static org.oscim.tiling.MapTile.STATE_NONE;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.map.Map;
|
||||
@@ -35,7 +36,7 @@ import org.oscim.utils.quadtree.QuadTree;
|
||||
import org.oscim.utils.quadtree.QuadTreeIndex;
|
||||
|
||||
public class TileManager {
|
||||
static final String TAG = TileManager.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TileManager.class);
|
||||
|
||||
private int mCacheLimit;
|
||||
private int mCacheReduce;
|
||||
@@ -97,7 +98,7 @@ public class TileManager {
|
||||
@Override
|
||||
public void remove(MapTile t) {
|
||||
if (t.rel == null) {
|
||||
Log.d(TAG, "BUG already removed " + t);
|
||||
log.debug("BUG already removed " + t);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -172,7 +173,7 @@ public class TileManager {
|
||||
|
||||
mNewTiles = new TileSet(numTiles);
|
||||
mCurrentTiles = new TileSet(numTiles);
|
||||
Log.d(TAG, "max tiles: " + numTiles);
|
||||
log.debug("max tiles: " + numTiles);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -273,7 +274,7 @@ public class TileManager {
|
||||
if (mCacheReduce < mCacheLimit / 2) {
|
||||
if (BufferObject.isMaxFill()) {
|
||||
mCacheReduce += 10;
|
||||
Log.d(TAG, "reduce tile cache " + (mCacheLimit - mCacheReduce));
|
||||
log.debug("reduce tile cache " + (mCacheLimit - mCacheReduce));
|
||||
} else
|
||||
mCacheReduce = 0;
|
||||
}
|
||||
@@ -387,7 +388,7 @@ public class TileManager {
|
||||
}
|
||||
|
||||
if (mTilesSize == mTiles.length) {
|
||||
Log.d(TAG, "realloc tiles " + mTilesSize);
|
||||
log.debug("realloc tiles " + mTilesSize);
|
||||
MapTile[] tmp = new MapTile[mTiles.length + 20];
|
||||
System.arraycopy(mTiles, 0, tmp, 0, mTilesCount);
|
||||
mTiles = tmp;
|
||||
@@ -483,15 +484,15 @@ public class TileManager {
|
||||
// so end of mTiles is at mTilesCount now
|
||||
size = mTilesSize = mTilesCount;
|
||||
|
||||
// Log.d(TAG, "remove:" + remove + " new:" + newTileCnt);
|
||||
// Log.d(TAG, "cur: " + mapPosition);
|
||||
// log.debug("remove:" + remove + " new:" + newTileCnt);
|
||||
// log.debug("cur: " + mapPosition);
|
||||
|
||||
for (int i = size - 1; i >= 0 && remove > 0; i--) {
|
||||
MapTile t = tiles[i];
|
||||
if (t.isLocked()) {
|
||||
// dont remove tile used by GLRenderer, or somewhere else
|
||||
// try again in next run.
|
||||
//Log.d(TAG, "locked " + t
|
||||
//log.debug("locked " + t
|
||||
// + " " + t.distance
|
||||
// + " " + (t.state == STATE_NEW_DATA)
|
||||
// + " " + (t.state == STATE_LOADING)
|
||||
@@ -501,13 +502,13 @@ public class TileManager {
|
||||
// added to load queue again while still processed in
|
||||
// MapTileLoader => need tile.cancel flag.
|
||||
// t.isLoading = false;
|
||||
Log.d(TAG, "cancel loading " + t
|
||||
log.debug("cancel loading " + t
|
||||
+ " " + t.distance);
|
||||
} else {
|
||||
// clear unused tile
|
||||
|
||||
if (t.state == STATE_NEW_DATA) {
|
||||
// Log.d(TAG, "limitCache: clear unused " + t
|
||||
// log.debug("limitCache: clear unused " + t
|
||||
// + " " + t.distance);
|
||||
newTileCnt--;
|
||||
}
|
||||
@@ -533,7 +534,7 @@ public class TileManager {
|
||||
}
|
||||
|
||||
mTilesForUpload += newTileCnt;
|
||||
// Log.d(TAG, "cleanup load queue " + tilesForUpload + "/" + r +
|
||||
// log.debug("cleanup load queue " + tilesForUpload + "/" + r +
|
||||
// " - " + remove);
|
||||
}
|
||||
}
|
||||
@@ -577,7 +578,7 @@ public class TileManager {
|
||||
MapTile tile = null;
|
||||
|
||||
if (cnt == maxTiles) {
|
||||
Log.d(TAG, "reached maximum tiles " + maxTiles);
|
||||
log.debug("reached maximum tiles " + maxTiles);
|
||||
break;
|
||||
}
|
||||
int xx = x;
|
||||
|
||||
@@ -18,7 +18,6 @@ import static org.oscim.tiling.MapTile.STATE_NEW_DATA;
|
||||
import static org.oscim.tiling.MapTile.STATE_READY;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.MapPosition;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.renderer.BufferObject;
|
||||
@@ -35,9 +34,11 @@ import org.oscim.renderer.elements.RenderElement;
|
||||
import org.oscim.utils.FastMath;
|
||||
import org.oscim.utils.ScanBox;
|
||||
import org.oscim.utils.quadtree.QuadTree;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TileRenderer extends LayerRenderer {
|
||||
private final static String TAG = TileRenderer.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TileRenderer.class);
|
||||
|
||||
private final TileManager mTileManager;
|
||||
private int mUploadSerial;
|
||||
@@ -171,7 +172,7 @@ public class TileRenderer extends LayerRenderer {
|
||||
tile.layers.vbo = BufferObject.get(GL20.GL_ARRAY_BUFFER, newSize);
|
||||
|
||||
if (!ElementRenderer.uploadLayers(tile.layers, newSize, true)) {
|
||||
Log.d(TAG, "BUG uploadTileData " + tile + " failed!");
|
||||
log.debug("BUG uploadTileData " + tile + " failed!");
|
||||
|
||||
tile.layers.vbo = BufferObject.release(tile.layers.vbo);
|
||||
tile.layers.clear();
|
||||
@@ -320,7 +321,7 @@ public class TileRenderer extends LayerRenderer {
|
||||
continue;
|
||||
|
||||
if (cnt + mNumTileHolder >= tiles.length) {
|
||||
Log.e(TAG, "too many tiles " + cnt + ", " + mNumTileHolder);
|
||||
//log.error(" + mNumTileHolder");
|
||||
break;
|
||||
}
|
||||
holder = new MapTile(x, y, (byte) mZoom);
|
||||
@@ -417,7 +418,7 @@ public class TileRenderer extends LayerRenderer {
|
||||
t = t.holder;
|
||||
|
||||
if (t.layers == null || t.layers.vbo == null) {
|
||||
//Log.d(TAG, "missing data " + (t.layers == null) + " " + (t.vbo == null));
|
||||
//log.debug("missing data " + (t.layers == null) + " " + (t.vbo == null));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -536,7 +537,7 @@ public class TileRenderer extends LayerRenderer {
|
||||
if ((tile.proxies & MapTile.PROXY_PARENT) != 0) {
|
||||
proxy = r.parent.item;
|
||||
if (proxy.state == STATE_READY) {
|
||||
//Log.d(TAG, "1. draw parent " + proxy);
|
||||
//log.debug("1. draw parent " + proxy);
|
||||
drawTile(proxy, pos);
|
||||
}
|
||||
}
|
||||
@@ -558,7 +559,7 @@ public class TileRenderer extends LayerRenderer {
|
||||
if ((tile.proxies & MapTile.PROXY_PARENT) != 0) {
|
||||
proxy = r.parent.item;
|
||||
if (proxy != null && proxy.state == STATE_READY) {
|
||||
//Log.d(TAG, "2. draw parent " + proxy);
|
||||
//log.debug("2. draw parent " + proxy);
|
||||
drawTile(proxy, pos);
|
||||
return;
|
||||
|
||||
|
||||
@@ -24,9 +24,10 @@ import java.net.SocketAddress;
|
||||
import java.net.URL;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.utils.ArrayUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Lightweight HTTP connection for tile loading.
|
||||
@@ -35,7 +36,7 @@ import org.oscim.utils.ArrayUtils;
|
||||
* different format.
|
||||
*/
|
||||
public class LwHttp {
|
||||
private static final String TAG = LwHttp.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(LwHttp.class);
|
||||
|
||||
private final static byte[] HEADER_HTTP_OK = "200 OK".getBytes();
|
||||
private final static byte[] HEADER_CONTENT_TYPE = "Content-Type".getBytes();
|
||||
@@ -85,7 +86,7 @@ public class LwHttp {
|
||||
|
||||
String host = url.getHost();
|
||||
String path = url.getPath();
|
||||
Log.d(TAG, "open database: " + host + " " + port + " " + path);
|
||||
log.debug("open database: " + host + " " + port + " " + path);
|
||||
|
||||
REQUEST_GET_START = ("GET " + path).getBytes();
|
||||
|
||||
@@ -188,7 +189,7 @@ public class LwHttp {
|
||||
|
||||
if (!ok) {
|
||||
String line = new String(buf, pos, end - pos - 1);
|
||||
Log.d(TAG, ">" + line + "< ");
|
||||
log.debug(">" + line + "< ");
|
||||
}
|
||||
|
||||
pos += (end - pos) + 1;
|
||||
@@ -217,10 +218,10 @@ public class LwHttp {
|
||||
try {
|
||||
mSocket.close();
|
||||
} catch (IOException e) {
|
||||
Log.d(TAG, e.getMessage());
|
||||
log.debug(e.getMessage());
|
||||
}
|
||||
|
||||
// Log.d(TAG, "not alive - recreate connection " + mMaxReq);
|
||||
// log.debug("not alive - recreate connection " + mMaxReq);
|
||||
mSocket = null;
|
||||
}
|
||||
|
||||
@@ -228,12 +229,12 @@ public class LwHttp {
|
||||
lwHttpConnect();
|
||||
// we know our server
|
||||
mMaxReq = RESPONSE_EXPECTED_LIVES;
|
||||
// Log.d(TAG, "create connection");
|
||||
// log.debug("create connection");
|
||||
} else {
|
||||
// FIXME not sure if this is correct way to drain socket
|
||||
int avail = mResponseStream.available();
|
||||
if (avail > 0) {
|
||||
Log.d(TAG, "Consume left-over bytes: " + avail);
|
||||
log.debug("Consume left-over bytes: " + avail);
|
||||
while ((avail = mResponseStream.available()) > 0)
|
||||
mResponseStream.read(buffer);
|
||||
}
|
||||
@@ -263,7 +264,7 @@ public class LwHttp {
|
||||
mCommandStream.flush();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
Log.d(TAG, "recreate connection");
|
||||
log.debug("recreate connection");
|
||||
}
|
||||
|
||||
lwHttpConnect();
|
||||
|
||||
@@ -17,13 +17,14 @@ package org.oscim.tiling.source.common;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.tiling.source.ITileDataSink;
|
||||
import org.oscim.utils.UTF8Decoder;
|
||||
|
||||
public abstract class PbfDecoder {
|
||||
private final static String TAG = PbfDecoder.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(PbfDecoder.class);
|
||||
|
||||
private final static int S1 = 7;
|
||||
private final static int S2 = 14;
|
||||
@@ -424,7 +425,7 @@ public abstract class PbfDecoder {
|
||||
if (size > maxSize) {
|
||||
|
||||
if (debug)
|
||||
Log.d(TAG, "increase read buffer to " + size + " bytes");
|
||||
log.debug("increase read buffer to " + size + " bytes");
|
||||
|
||||
maxSize = size;
|
||||
|
||||
@@ -445,7 +446,7 @@ public abstract class PbfDecoder {
|
||||
} else if (bufferPos + size > maxSize) {
|
||||
// copy bytes left to the beginning of buffer
|
||||
if (debug)
|
||||
Log.d(TAG, "shift " + bufferFill + " " + bufferPos + " " + size);
|
||||
log.debug("shift " + bufferFill + " " + bufferPos + " " + size);
|
||||
|
||||
System.arraycopy(buffer, bufferPos, buffer, 0, bytesLeft);
|
||||
|
||||
@@ -471,7 +472,7 @@ public abstract class PbfDecoder {
|
||||
if (len < 0) {
|
||||
mMsgEnd = mMsgPos;
|
||||
if (debug)
|
||||
Log.d(TAG, " finished reading " + mMsgPos);
|
||||
log.debug(" finished reading " + mMsgPos);
|
||||
|
||||
// finished reading, mark end
|
||||
buffer[bufferFill] = 0;
|
||||
|
||||
@@ -22,15 +22,15 @@ import java.net.UnknownHostException;
|
||||
import org.oscim.tiling.MapTile;
|
||||
import org.oscim.tiling.source.ITileDataSink;
|
||||
import org.oscim.tiling.source.ITileDataSource;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class PbfTileDataSource implements ITileDataSource {
|
||||
private static final String TAG = PbfTileDataSource.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(PbfTileDataSource.class);
|
||||
|
||||
protected LwHttp mConn;
|
||||
protected final PbfDecoder mTileDecoder;
|
||||
@@ -46,24 +46,24 @@ public abstract class PbfTileDataSource implements ITileDataSource {
|
||||
try {
|
||||
InputStream is;
|
||||
if (!mConn.sendRequest(tile)) {
|
||||
Log.d(TAG, tile + " Request Failed");
|
||||
log.debug(tile + " Request Failed");
|
||||
result = QueryResult.FAILED;
|
||||
} else if ((is = mConn.readHeader()) != null) {
|
||||
boolean win = mTileDecoder.decode(tile, sink, is, mConn.getContentLength());
|
||||
if (!win)
|
||||
Log.d(TAG, tile + " failed");
|
||||
log.debug(tile + " failed");
|
||||
} else {
|
||||
Log.d(TAG, tile + " Network Error");
|
||||
log.debug(tile + " Network Error");
|
||||
result = QueryResult.FAILED;
|
||||
}
|
||||
} catch (SocketException e) {
|
||||
Log.d(TAG, tile + " Socket exception: " + e.getMessage());
|
||||
log.debug(tile + " Socket exception: " + e.getMessage());
|
||||
result = QueryResult.FAILED;
|
||||
} catch (SocketTimeoutException e) {
|
||||
Log.d(TAG, tile + " Socket Timeout");
|
||||
log.debug(tile + " Socket Timeout");
|
||||
result = QueryResult.FAILED;
|
||||
} catch (UnknownHostException e) {
|
||||
Log.d(TAG, tile + " No Network");
|
||||
log.debug(tile + " No Network");
|
||||
result = QueryResult.FAILED;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.oscim.tiling.source.mapfile;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
||||
import org.oscim.core.MapElement;
|
||||
@@ -30,6 +29,8 @@ import org.oscim.tiling.source.ITileDataSink;
|
||||
import org.oscim.tiling.source.ITileDataSource;
|
||||
import org.oscim.tiling.source.mapfile.header.SubFileParameter;
|
||||
import org.oscim.utils.TileClipper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A class for reading binary map files.
|
||||
@@ -56,7 +57,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
/** Error message for an invalid first way offset. */
|
||||
private static final String INVALID_FIRST_WAY_OFFSET = "invalid first way offset: ";
|
||||
|
||||
private static final String TAG = MapDatabase.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(MapDatabase.class);
|
||||
|
||||
/** Maximum way nodes sequence length which is considered as valid. */
|
||||
private static final int MAXIMUM_WAY_NODES_SEQUENCE_LENGTH = 8192;
|
||||
@@ -172,7 +173,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
//mReductionCnt = 0;
|
||||
//mSkipPoly = 0;
|
||||
|
||||
//Log.d(TAG, "simplify by " + minLat + "/" + minLon);
|
||||
//log.debug("simplify by " + minLat + "/" + minLon);
|
||||
|
||||
QueryParameters queryParameters = new QueryParameters();
|
||||
queryParameters.queryZoomLevel =
|
||||
@@ -183,7 +184,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
mTileSource.fileHeader.getSubFileParameter(queryParameters.queryZoomLevel);
|
||||
|
||||
if (subFileParameter == null) {
|
||||
Log.w(TAG, "no sub-file for zoom level: "
|
||||
log.warn("no sub-file for zoom level: "
|
||||
+ queryParameters.queryZoomLevel);
|
||||
|
||||
return QueryResult.FAILED;
|
||||
@@ -193,11 +194,11 @@ public class MapDatabase implements ITileDataSource {
|
||||
QueryCalculations.calculateBlocks(queryParameters, subFileParameter);
|
||||
processBlocks(mapDataSink, queryParameters, subFileParameter);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
log.error(e.getMessage());
|
||||
return QueryResult.FAILED;
|
||||
}
|
||||
|
||||
//Log.d(TAG, "reduced points " + mReductionCnt + " / polys " + mSkipPoly);
|
||||
//log.debug("reduced points " + mReductionCnt + " / polys " + mSkipPoly);
|
||||
|
||||
return QueryResult.SUCCESS;
|
||||
}
|
||||
@@ -211,7 +212,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
mReadBuffer = new ReadBuffer(mInputFile);
|
||||
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
log.error(e.getMessage());
|
||||
// make sure that the file is closed
|
||||
destroy();
|
||||
throw new IOException();
|
||||
@@ -227,7 +228,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
mInputFile.close();
|
||||
mInputFile = null;
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,8 +238,8 @@ public class MapDatabase implements ITileDataSource {
|
||||
*/
|
||||
private void logDebugSignatures() {
|
||||
if (mDebugFile) {
|
||||
Log.w(TAG, DEBUG_SIGNATURE_WAY + mSignatureWay);
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn(DEBUG_SIGNATURE_WAY + mSignatureWay);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,9 +272,9 @@ public class MapDatabase implements ITileDataSource {
|
||||
// get the relative offset to the first stored way in the block
|
||||
int firstWayOffset = mReadBuffer.readUnsignedInt();
|
||||
if (firstWayOffset < 0) {
|
||||
Log.w(TAG, INVALID_FIRST_WAY_OFFSET + firstWayOffset);
|
||||
log.warn(INVALID_FIRST_WAY_OFFSET + firstWayOffset);
|
||||
if (mDebugFile) {
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -281,9 +282,9 @@ public class MapDatabase implements ITileDataSource {
|
||||
// add the current buffer position to the relative first way offset
|
||||
firstWayOffset += mReadBuffer.getBufferPosition();
|
||||
if (firstWayOffset > mReadBuffer.getBufferSize()) {
|
||||
Log.w(TAG, INVALID_FIRST_WAY_OFFSET + firstWayOffset);
|
||||
log.warn(INVALID_FIRST_WAY_OFFSET + firstWayOffset);
|
||||
if (mDebugFile) {
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -294,9 +295,9 @@ public class MapDatabase implements ITileDataSource {
|
||||
|
||||
// finished reading POIs, check if the current buffer position is valid
|
||||
if (mReadBuffer.getBufferPosition() > firstWayOffset) {
|
||||
Log.w(TAG, "invalid buffer position: " + mReadBuffer.getBufferPosition());
|
||||
log.warn("invalid buffer position: " + mReadBuffer.getBufferPosition());
|
||||
if (mDebugFile) {
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -345,8 +346,8 @@ public class MapDatabase implements ITileDataSource {
|
||||
long currentBlockPointer = currentBlockIndexEntry & BITMASK_INDEX_OFFSET;
|
||||
if (currentBlockPointer < 1
|
||||
|| currentBlockPointer > subFileParameter.subFileSize) {
|
||||
Log.w(TAG, "invalid current block pointer: " + currentBlockPointer);
|
||||
Log.w(TAG, "subFileSize: " + subFileParameter.subFileSize);
|
||||
log.warn("invalid current block pointer: " + currentBlockPointer);
|
||||
log.warn("subFileSize: " + subFileParameter.subFileSize);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -363,8 +364,8 @@ public class MapDatabase implements ITileDataSource {
|
||||
& BITMASK_INDEX_OFFSET;
|
||||
if (nextBlockPointer < 1
|
||||
|| nextBlockPointer > subFileParameter.subFileSize) {
|
||||
Log.w(TAG, "invalid next block pointer: " + nextBlockPointer);
|
||||
Log.w(TAG, "sub-file size: " + subFileParameter.subFileSize);
|
||||
log.warn("invalid next block pointer: " + nextBlockPointer);
|
||||
log.warn("sub-file size: " + subFileParameter.subFileSize);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -372,7 +373,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
// calculate the size of the current block
|
||||
int currentBlockSize = (int) (nextBlockPointer - currentBlockPointer);
|
||||
if (currentBlockSize < 0) {
|
||||
Log.w(TAG, "current block size must not be negative: "
|
||||
log.warn("current block size must not be negative: "
|
||||
+ currentBlockSize);
|
||||
return;
|
||||
} else if (currentBlockSize == 0) {
|
||||
@@ -381,10 +382,10 @@ public class MapDatabase implements ITileDataSource {
|
||||
} else if (currentBlockSize > ReadBuffer.MAXIMUM_BUFFER_SIZE) {
|
||||
// the current block is too large, continue with the next
|
||||
// block
|
||||
Log.w(TAG, "current block size too large: " + currentBlockSize);
|
||||
log.warn("current block size too large: " + currentBlockSize);
|
||||
continue;
|
||||
} else if (currentBlockPointer + currentBlockSize > mFileSize) {
|
||||
Log.w(TAG, "current block larger than file size: "
|
||||
log.warn("current block larger than file size: "
|
||||
+ currentBlockSize);
|
||||
return;
|
||||
}
|
||||
@@ -395,7 +396,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
// read the current block into the buffer
|
||||
if (!mReadBuffer.readFromFile(currentBlockSize)) {
|
||||
// skip the current block
|
||||
Log.w(TAG, "reading current block has failed: " + currentBlockSize);
|
||||
log.warn("reading current block has failed: " + currentBlockSize);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -437,7 +438,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
// get and check the block signature
|
||||
mSignatureBlock = mReadBuffer.readUTF8EncodedString(SIGNATURE_LENGTH_BLOCK);
|
||||
if (!mSignatureBlock.startsWith("###TileStart")) {
|
||||
Log.w(TAG, "invalid block signature: " + mSignatureBlock);
|
||||
log.warn("invalid block signature: " + mSignatureBlock);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -473,8 +474,8 @@ public class MapDatabase implements ITileDataSource {
|
||||
// get and check the POI signature
|
||||
mSignaturePoi = mReadBuffer.readUTF8EncodedString(SIGNATURE_LENGTH_POI);
|
||||
if (!mSignaturePoi.startsWith("***POIStart")) {
|
||||
Log.w(TAG, "invalid POI signature: " + mSignaturePoi);
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn("invalid POI signature: " + mSignaturePoi);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -549,7 +550,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
// get and check the number of way coordinate blocks (VBE-U)
|
||||
int numBlocks = mReadBuffer.readUnsignedInt();
|
||||
if (numBlocks < 1 || numBlocks > Short.MAX_VALUE) {
|
||||
Log.w(TAG, "invalid number of way coordinate blocks: " + numBlocks);
|
||||
log.warn("invalid number of way coordinate blocks: " + numBlocks);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -566,7 +567,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
int numWayNodes = mReadBuffer.readUnsignedInt();
|
||||
|
||||
if (numWayNodes < 2 || numWayNodes > MAXIMUM_WAY_NODES_SEQUENCE_LENGTH) {
|
||||
Log.w(TAG, "invalid number of way nodes: " + numWayNodes);
|
||||
log.warn("invalid number of way nodes: " + numWayNodes);
|
||||
logDebugSignatures();
|
||||
return false;
|
||||
}
|
||||
@@ -728,7 +729,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
long numRows = queryParameters.toBlockY - queryParameters.fromBlockY;
|
||||
long numCols = queryParameters.toBlockX - queryParameters.fromBlockX;
|
||||
|
||||
//Log.d(TAG, numCols + "/" + numRows + " " + mCurrentCol + " " + mCurrentRow);
|
||||
//log.debug(numCols + "/" + numRows + " " + mCurrentCol + " " + mCurrentRow);
|
||||
if (numRows > 0) {
|
||||
int minX = -2;
|
||||
int minY = -2;
|
||||
@@ -749,7 +750,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
|
||||
if (mCurrentRow < numRows)
|
||||
maxY = (int) (mCurrentRow * h + h);
|
||||
//Log.d(TAG, minX + " " + minY + " " + maxX + " " + maxY);
|
||||
//log.debug(minX + " " + minY + " " + maxX + " " + maxY);
|
||||
mTileClipper.setRect(minX, minY, maxX, maxY);
|
||||
} else {
|
||||
mTileClipper.setRect(-2, -2, Tile.SIZE + 2, Tile.SIZE + 2);
|
||||
@@ -760,8 +761,8 @@ public class MapDatabase implements ITileDataSource {
|
||||
// get and check the way signature
|
||||
mSignatureWay = mReadBuffer.readUTF8EncodedString(SIGNATURE_LENGTH_WAY);
|
||||
if (!mSignatureWay.startsWith("---WayStart")) {
|
||||
Log.w(TAG, "invalid way signature: " + mSignatureWay);
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn("invalid way signature: " + mSignatureWay);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -792,11 +793,11 @@ public class MapDatabase implements ITileDataSource {
|
||||
} else {
|
||||
int wayDataSize = mReadBuffer.readUnsignedInt();
|
||||
if (wayDataSize < 0) {
|
||||
Log.w(TAG, "invalid way data size: " + wayDataSize);
|
||||
log.warn("invalid way data size: " + wayDataSize);
|
||||
if (mDebugFile) {
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
Log.e(TAG, "BUG way 2");
|
||||
log.error("BUG way 2");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -871,7 +872,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
wayDataBlocks = mReadBuffer.readUnsignedInt();
|
||||
|
||||
if (wayDataBlocks < 1) {
|
||||
Log.w(TAG, "invalid number of way data blocks: " + wayDataBlocks);
|
||||
log.warn("invalid number of way data blocks: " + wayDataBlocks);
|
||||
logDebugSignatures();
|
||||
return false;
|
||||
}
|
||||
@@ -933,18 +934,18 @@ public class MapDatabase implements ITileDataSource {
|
||||
|
||||
if (cumulatedNumberOfPois < 0
|
||||
|| cumulatedNumberOfPois > MAXIMUM_ZOOM_TABLE_OBJECTS) {
|
||||
Log.w(TAG, "invalid cumulated number of POIs in row " + row + ' '
|
||||
log.warn("invalid cumulated number of POIs in row " + row + ' '
|
||||
+ cumulatedNumberOfPois);
|
||||
if (mDebugFile) {
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
return null;
|
||||
} else if (cumulatedNumberOfWays < 0
|
||||
|| cumulatedNumberOfWays > MAXIMUM_ZOOM_TABLE_OBJECTS) {
|
||||
Log.w(TAG, "invalid cumulated number of ways in row " + row + ' '
|
||||
log.warn("invalid cumulated number of ways in row " + row + ' '
|
||||
+ cumulatedNumberOfWays);
|
||||
if (mTileSource.fileInfo.debugFile) {
|
||||
Log.w(TAG, DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -995,7 +996,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
if (cnt != 0) {
|
||||
// drop small distance intermediate nodes
|
||||
if (lat == prevLat && lon == prevLon) {
|
||||
//Log.d(TAG, "drop zero delta ");
|
||||
//log.debug("drop zero delta ");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1006,7 +1007,7 @@ public class MapDatabase implements ITileDataSource {
|
||||
}
|
||||
|
||||
if (coords[first] == prevLon && coords[first + 1] == prevLat) {
|
||||
//Log.d(TAG, "drop closed");
|
||||
//log.debug("drop closed");
|
||||
indices[i] = (short) (cnt - 2);
|
||||
outPos -= 2;
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ import org.oscim.tiling.source.ITileDataSource;
|
||||
import org.oscim.tiling.source.TileSource;
|
||||
import org.oscim.tiling.source.mapfile.header.MapFileHeader;
|
||||
import org.oscim.tiling.source.mapfile.header.MapFileInfo;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class MapFileTileSource extends TileSource {
|
||||
private final static String TAG = MapFileTileSource.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(MapFileTileSource.class);
|
||||
|
||||
/**
|
||||
* Amount of cache blocks that the index cache should store.
|
||||
@@ -95,10 +95,10 @@ public class MapFileTileSource extends TileSource {
|
||||
|
||||
experimental = fileInfo.fileVersion == 4;
|
||||
|
||||
Log.d(TAG, "File version: " + fileInfo.fileVersion);
|
||||
log.debug("File version: " + fileInfo.fileVersion);
|
||||
return OpenResult.SUCCESS;
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
log.error(e.getMessage());
|
||||
// make sure that the file is closed
|
||||
close();
|
||||
return new OpenResult(e.getMessage());
|
||||
@@ -110,7 +110,7 @@ public class MapFileTileSource extends TileSource {
|
||||
try {
|
||||
return new MapDatabase(this);
|
||||
} catch (IOException e) {
|
||||
Log.d(TAG, e.getMessage());
|
||||
log.debug(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
||||
import org.oscim.core.MapElement;
|
||||
import org.oscim.core.Tag;
|
||||
@@ -27,9 +26,11 @@ import org.oscim.tiling.source.ITileDataSink;
|
||||
import org.oscim.tiling.source.common.PbfDecoder;
|
||||
import org.oscim.utils.pool.Inlist;
|
||||
import org.oscim.utils.pool.Pool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TileDecoder extends PbfDecoder {
|
||||
private final static String TAG = TileDecoder.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TileDecoder.class);
|
||||
|
||||
private static final int TAG_TILE_LAYERS = 3;
|
||||
|
||||
@@ -72,7 +73,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
int contentLength)
|
||||
throws IOException {
|
||||
if (debug)
|
||||
Log.d(TAG, tile + " decode");
|
||||
log.debug(tile + " decode");
|
||||
|
||||
setInputStream(is, Integer.MAX_VALUE);
|
||||
mTile = tile;
|
||||
@@ -187,7 +188,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
}
|
||||
|
||||
if (mLocale.equals(key.substring(5))) {
|
||||
//Log.d(TAG, "found local " + key);
|
||||
//log.debug("found local " + key);
|
||||
matchedLocal = i;
|
||||
} else
|
||||
ignoreLocal[numIgnore++] = i;
|
||||
@@ -309,7 +310,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
Feature curFeature = null;
|
||||
int numTags = 0;
|
||||
|
||||
//Log.d(TAG, "start feature");
|
||||
//log.debug("start feature");
|
||||
while (position() < end) {
|
||||
// read tag and wire type
|
||||
int val = decodeVarint32();
|
||||
@@ -336,7 +337,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
|
||||
case TAG_FEATURE_TYPE:
|
||||
type = decodeVarint32();
|
||||
//Log.d(TAG, "got type " + type);
|
||||
//log.debug("got type " + type);
|
||||
break;
|
||||
|
||||
case TAG_FEATURE_GEOMETRY:
|
||||
@@ -519,7 +520,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
}
|
||||
|
||||
if (isPoly && isOuter && simplify && !testBBox(xmax - xmin, ymax - ymin)) {
|
||||
//Log.d(TAG, "skip small poly "+ elem.indexPos + " > "
|
||||
//log.debug("skip small poly "+ elem.indexPos + " > "
|
||||
// + (xmax - xmin) * (ymax - ymin));
|
||||
elem.pointPos -= elem.index[elem.indexPos];
|
||||
if (elem.indexPos > 0) {
|
||||
|
||||
@@ -26,11 +26,11 @@ import org.oscim.core.Tag;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.tiling.source.ITileDataSink;
|
||||
import org.oscim.tiling.source.common.PbfDecoder;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TileDecoder extends PbfDecoder {
|
||||
private final static String TAG = TileDecoder.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TileDecoder.class);
|
||||
|
||||
private final static float REF_TILE_SIZE = 4096.0f;
|
||||
|
||||
@@ -119,7 +119,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.d(TAG, "invalid type for tile: " + tag);
|
||||
log.debug("invalid type for tile: " + tag);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -188,14 +188,14 @@ public class TileDecoder extends PbfDecoder {
|
||||
|
||||
case TAG_WAY_COORDS:
|
||||
if (coordCnt == 0) {
|
||||
Log.d(TAG, mTile + " no coordinates");
|
||||
log.debug(mTile + " no coordinates");
|
||||
}
|
||||
|
||||
mElem.ensurePointSize(coordCnt, false);
|
||||
int cnt = decodeInterleavedPoints(mElem.points, mScale);
|
||||
|
||||
if (cnt != coordCnt) {
|
||||
Log.d(TAG, mTile + " wrong number of coordintes "
|
||||
log.debug(mTile + " wrong number of coordintes "
|
||||
+ coordCnt + "/" + cnt);
|
||||
fail = true;
|
||||
}
|
||||
@@ -219,12 +219,12 @@ public class TileDecoder extends PbfDecoder {
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.d(TAG, "X invalid type for way: " + tag);
|
||||
log.debug("X invalid type for way: " + tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (fail || indexCnt == 0 || tagCnt == 0) {
|
||||
Log.d(TAG, "failed reading way: bytes:" + bytes + " index:"
|
||||
log.debug("failed reading way: bytes:" + bytes + " index:"
|
||||
//+ (tags != null ? tags.toString() : "...") + " "
|
||||
+ indexCnt + " " + coordCnt + " " + tagCnt);
|
||||
return false;
|
||||
@@ -264,7 +264,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
case TAG_NODE_COORDS:
|
||||
int cnt = decodeNodeCoordinates(coordCnt, layer);
|
||||
if (cnt != coordCnt) {
|
||||
Log.d(TAG, "X wrong number of coordintes");
|
||||
log.debug("X wrong number of coordintes");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -282,7 +282,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.d(TAG, "X invalid type for node: " + tag);
|
||||
log.debug("X invalid type for node: " + tag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
int tagNum = decodeVarint32();
|
||||
|
||||
if (tagNum < 0 || cnt == tagCnt) {
|
||||
Log.d(TAG, "NULL TAG: " + mTile
|
||||
log.debug("NULL TAG: " + mTile
|
||||
+ " invalid tag:" + tagNum
|
||||
+ " " + tagCnt + "/" + cnt);
|
||||
continue;
|
||||
@@ -347,7 +347,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
if (tagNum >= 0 && tagNum < max) {
|
||||
mElem.tags.add(curTags[tagNum]);
|
||||
} else {
|
||||
Log.d(TAG, "NULL TAG: " + mTile
|
||||
log.debug("NULL TAG: " + mTile
|
||||
+ " could find tag:"
|
||||
+ tagNum + " " + tagCnt
|
||||
+ "/" + cnt);
|
||||
@@ -355,7 +355,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
}
|
||||
|
||||
if (tagCnt != cnt) {
|
||||
Log.d(TAG, "NULL TAG: " + mTile);
|
||||
log.debug("NULL TAG: " + mTile);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
||||
import org.oscim.core.MapElement;
|
||||
import org.oscim.core.Tag;
|
||||
@@ -31,6 +30,8 @@ import org.oscim.tiling.source.common.LwHttp;
|
||||
import org.oscim.tiling.source.common.PbfDecoder;
|
||||
import org.oscim.tiling.source.common.PbfTileDataSource;
|
||||
import org.oscim.tiling.source.common.UrlTileSource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class OSciMap2TileSource extends UrlTileSource {
|
||||
|
||||
@@ -47,7 +48,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
}
|
||||
|
||||
static class TileDecoder extends PbfDecoder {
|
||||
private final static String TAG = TileDecoder.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TileDecoder.class);
|
||||
private static final int TAG_TILE_NUM_TAGS = 1;
|
||||
private static final int TAG_TILE_TAG_KEYS = 2;
|
||||
private static final int TAG_TILE_TAG_VALUES = 3;
|
||||
@@ -92,9 +93,9 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
throws IOException {
|
||||
|
||||
int byteCount = readUnsignedInt(is, buffer);
|
||||
//Log.d(TAG, tile + " contentLength:" + byteCount);
|
||||
//log.debug(tile + " contentLength:" + byteCount);
|
||||
if (byteCount < 0) {
|
||||
Log.d(TAG, tile + " invalid content length: " + byteCount);
|
||||
log.debug(tile + " invalid content length: " + byteCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -139,7 +140,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.d(TAG, mTile + " invalid type for tile: " + tag);
|
||||
log.debug(mTile + " invalid type for tile: " + tag);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -159,7 +160,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
else
|
||||
tag = new Tag(key, tagString, true);
|
||||
if (debug)
|
||||
Log.d(TAG, mTile + " add tag: " + curTag + " " + tag);
|
||||
log.debug(mTile + " add tag: " + curTag + " " + tag);
|
||||
|
||||
mTileTags.add(tag);
|
||||
|
||||
@@ -229,14 +230,14 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
|
||||
case TAG_ELEM_COORDS:
|
||||
if (coordCnt == 0) {
|
||||
Log.d(TAG, mTile + " no coordinates");
|
||||
log.debug(mTile + " no coordinates");
|
||||
}
|
||||
|
||||
mElem.ensurePointSize(coordCnt, false);
|
||||
int cnt = decodeInterleavedPoints(mElem.points, mScale);
|
||||
|
||||
if (cnt != coordCnt) {
|
||||
Log.d(TAG, mTile + " wrong number of coordintes");
|
||||
log.debug(mTile + " wrong number of coordintes");
|
||||
fail = true;
|
||||
}
|
||||
break;
|
||||
@@ -260,12 +261,12 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.d(TAG, mTile + " invalid type for way: " + tag);
|
||||
log.debug(mTile + " invalid type for way: " + tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (fail || indexCnt == 0) {
|
||||
Log.d(TAG, mTile + " failed reading way: bytes:" + bytes + " index:"
|
||||
log.debug(mTile + " failed reading way: bytes:" + bytes + " index:"
|
||||
+ (Arrays.toString(index)) + " tag:"
|
||||
+ (mElem.tags.numTags > 0 ? Arrays.deepToString(mElem.tags.tags) : "null")
|
||||
+ " " + indexCnt + " " + coordCnt);
|
||||
@@ -302,7 +303,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
int tagNum = decodeVarint32();
|
||||
|
||||
if (tagNum < 0) {
|
||||
Log.d(TAG, "NULL TAG: " + mTile
|
||||
log.debug("NULL TAG: " + mTile
|
||||
+ " invalid tag:"
|
||||
+ tagNum + " " + cnt);
|
||||
return false;
|
||||
@@ -315,7 +316,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
tagNum -= Tags.LIMIT;
|
||||
|
||||
if (tagNum < 0 || tagNum > max) {
|
||||
Log.d(TAG, "NULL TAG: " + mTile
|
||||
log.debug("NULL TAG: " + mTile
|
||||
+ " could not find tag:"
|
||||
+ tagNum + " " + cnt);
|
||||
return false;
|
||||
@@ -325,7 +326,7 @@ public class OSciMap2TileSource extends UrlTileSource {
|
||||
}
|
||||
|
||||
if (cnt == 0) {
|
||||
Log.d(TAG, "got no TAG!");
|
||||
log.debug("got no TAG!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer.GeometryType;
|
||||
import org.oscim.core.MapElement;
|
||||
import org.oscim.core.Tag;
|
||||
@@ -26,9 +25,11 @@ import org.oscim.core.TagSet;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.tiling.source.ITileDataSink;
|
||||
import org.oscim.tiling.source.common.PbfDecoder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TileDecoder extends PbfDecoder {
|
||||
private final static String TAG = TileDecoder.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(TileDecoder.class);
|
||||
|
||||
private static final int TAG_TILE_VERSION = 1;
|
||||
//private static final int TAG_TILE_TIMESTAMP = 2;
|
||||
@@ -77,9 +78,9 @@ public class TileDecoder extends PbfDecoder {
|
||||
throws IOException {
|
||||
|
||||
int byteCount = readUnsignedInt(is, buffer);
|
||||
//Log.d(TAG, tile + " contentLength:" + byteCount);
|
||||
//log.debug(tile + " contentLength:" + byteCount);
|
||||
if (byteCount < 0) {
|
||||
Log.d(TAG, "invalid contentLength: " + byteCount);
|
||||
log.debug("invalid contentLength: " + byteCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
while (hasData() && (val = decodeVarint32()) > 0) {
|
||||
// read tag and wire type
|
||||
int tag = (val >> 3);
|
||||
//Log.d(TAG, "tag: " + tag);
|
||||
//log.debug("tag: " + tag);
|
||||
|
||||
switch (tag) {
|
||||
case TAG_TILE_LINE:
|
||||
@@ -116,7 +117,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
|
||||
case TAG_TILE_TAG_KEYS:
|
||||
if (keys == null || curKey >= numKeys) {
|
||||
Log.d(TAG, mTile + " wrong number of keys " + numKeys);
|
||||
log.debug(mTile + " wrong number of keys " + numKeys);
|
||||
return false;
|
||||
}
|
||||
keys[curKey++] = decodeString();
|
||||
@@ -124,7 +125,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
|
||||
case TAG_TILE_TAG_VALUES:
|
||||
if (values == null || curValue >= numValues) {
|
||||
Log.d(TAG, mTile + " wrong number of values " + numValues);
|
||||
log.debug(mTile + " wrong number of values " + numValues);
|
||||
return false;
|
||||
}
|
||||
values[curValue++] = decodeString();
|
||||
@@ -132,18 +133,18 @@ public class TileDecoder extends PbfDecoder {
|
||||
|
||||
case TAG_TILE_NUM_TAGS:
|
||||
numTags = decodeVarint32();
|
||||
//Log.d(TAG, "num tags " + numTags);
|
||||
//log.debug("num tags " + numTags);
|
||||
break;
|
||||
|
||||
case TAG_TILE_NUM_KEYS:
|
||||
numKeys = decodeVarint32();
|
||||
//Log.d(TAG, "num keys " + numKeys);
|
||||
//log.debug("num keys " + numKeys);
|
||||
keys = new String[numKeys];
|
||||
break;
|
||||
|
||||
case TAG_TILE_NUM_VALUES:
|
||||
numValues = decodeVarint32();
|
||||
//Log.d(TAG, "num values " + numValues);
|
||||
//log.debug("num values " + numValues);
|
||||
values = new String[numValues];
|
||||
break;
|
||||
|
||||
@@ -154,7 +155,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
|
||||
decodeVarintArray(len, mSArray);
|
||||
if (!decodeTileTags(numTags, mSArray, keys, values)) {
|
||||
Log.d(TAG, mTile + " invalid tags");
|
||||
log.debug(mTile + " invalid tags");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -162,13 +163,13 @@ public class TileDecoder extends PbfDecoder {
|
||||
case TAG_TILE_VERSION:
|
||||
version = decodeVarint32();
|
||||
if (version != 4) {
|
||||
Log.d(TAG, mTile + " invalid version " + version);
|
||||
log.debug(mTile + " invalid version " + version);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.d(TAG, mTile + " invalid type for tile: " + tag);
|
||||
log.debug(mTile + " invalid type for tile: " + tag);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -292,14 +293,14 @@ public class TileDecoder extends PbfDecoder {
|
||||
|
||||
case TAG_ELEM_COORDS:
|
||||
if (coordCnt == 0) {
|
||||
Log.d(TAG, mTile + " no coordinates");
|
||||
log.debug(mTile + " no coordinates");
|
||||
}
|
||||
|
||||
mElem.ensurePointSize(coordCnt, false);
|
||||
int cnt = decodeInterleavedPoints(mElem.points, mScaleFactor);
|
||||
|
||||
if (cnt != coordCnt) {
|
||||
Log.d(TAG, mTile + " wrong number of coordintes "
|
||||
log.debug(mTile + " wrong number of coordintes "
|
||||
+ coordCnt + "/" + cnt);
|
||||
fail = true;
|
||||
}
|
||||
@@ -310,12 +311,12 @@ public class TileDecoder extends PbfDecoder {
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.d(TAG, mTile + " invalid type for way: " + tag);
|
||||
log.debug(mTile + " invalid type for way: " + tag);
|
||||
}
|
||||
}
|
||||
|
||||
if (fail || numTags == 0 || numIndices == 0) {
|
||||
Log.d(TAG, mTile + " failed reading way: bytes:" + bytes + " index:"
|
||||
log.debug(mTile + " failed reading way: bytes:" + bytes + " index:"
|
||||
+ (Arrays.toString(index)) + " tag:"
|
||||
+ (mElem.tags.numTags > 0 ? Arrays.deepToString(mElem.tags.tags) : "null")
|
||||
+ " " + numIndices + " " + coordCnt);
|
||||
@@ -354,7 +355,7 @@ public class TileDecoder extends PbfDecoder {
|
||||
int idx = tagIds[i];
|
||||
|
||||
if (idx < 0 || idx > max) {
|
||||
Log.d(TAG, mTile + " invalid tag:" + idx + " " + i);
|
||||
log.debug("{} invalid tag:{}", mTile, idx + ' ' + i);
|
||||
return false;
|
||||
}
|
||||
mElem.tags.add(mTileTags.tags[idx]);
|
||||
|
||||
@@ -18,8 +18,6 @@ import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
|
||||
/**
|
||||
* A utility class with IO-specific helper methods.
|
||||
*/
|
||||
@@ -39,7 +37,7 @@ public final class IOUtils {
|
||||
closeable.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.d(IOUtils.class.getName(), e.getMessage() + " " + e);
|
||||
//log.debug(e.getMessage() + " " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,13 @@ package org.oscim.utils;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.oscim.backend.Log;
|
||||
import org.oscim.core.GeometryBuffer;
|
||||
import org.oscim.renderer.elements.VertexItem;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Tessellator {
|
||||
private static final String TAG = Tessellator.class.getName();
|
||||
static final Logger log = LoggerFactory.getLogger(Tessellator.class);
|
||||
|
||||
private static final int RESULT_VERTICES = 0;
|
||||
private static final int RESULT_TRIANGLES = 1;
|
||||
@@ -37,7 +38,7 @@ public class Tessellator {
|
||||
|
||||
long ctx = Tessellator.tessellate(points, ppos, index, ipos, rings, result);
|
||||
if ((numPoints / 2) < result[RESULT_VERTICES]) {
|
||||
Log.d(TAG, "skip poly: " + Arrays.toString(result) + " " + numPoints);
|
||||
log.debug("skip poly: " + Arrays.toString(result) + " " + numPoints);
|
||||
Tessellator.tessFinish(ctx);
|
||||
return 0;
|
||||
}
|
||||
@@ -129,13 +130,13 @@ public class Tessellator {
|
||||
geom.index, 0,
|
||||
numRings, result);
|
||||
|
||||
//Log.d(TAG, "got "
|
||||
//log.debug("got "
|
||||
// + result[RESULT_VERTICES] + " "
|
||||
// + result[RESULT_TRIANGLES]);
|
||||
|
||||
boolean verticesAdded = false;
|
||||
if (numPoints < result[RESULT_VERTICES] * 2) {
|
||||
//Log.d(TAG, "grow vertices" + geom.pointPos);
|
||||
//log.debug("grow vertices" + geom.pointPos);
|
||||
verticesAdded = true;
|
||||
}
|
||||
|
||||
@@ -194,7 +195,7 @@ public class Tessellator {
|
||||
}
|
||||
|
||||
if (numRings == 0 || numPoints == 0) {
|
||||
Log.d(TAG, "missing " + numPoints + ":" + numRings);
|
||||
log.debug("missing " + numPoints + ":" + numRings);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.oscim.utils;
|
||||
|
||||
import org.oscim.backend.Log.Logger;
|
||||
|
||||
public class TestLogger implements Logger {
|
||||
|
||||
@Override
|
||||
public void d(String tag, String msg) {
|
||||
System.out.println(tag + " " + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void w(String tag, String msg) {
|
||||
System.out.println(tag + " " + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(String tag, String msg) {
|
||||
System.out.println(tag + " " + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void i(String tag, String msg) {
|
||||
System.out.println(tag + " " + msg);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user