using mapzen in vtm

77 views
Skip to first unread message

Androider Sahapar

unread,
Oct 30, 2016, 8:51:45 AM10/30/16
to mapsforge-dev
Hi I Want to use mapzen web sources with vtm. for that I create a mapzenTileSourceClass which extended from GeojsonTileSource.
this is my class      

public class MapzenTileSource extends GeoJsonTileSource {
String tag = "MapzenTileSource ";

public MapzenTileSource() {
super("http://tile.mapzen.com/mapzen/vector/v1/all/");
String apiKey = "my api key";
setApiKey(apiKey);
}

@Override
public void decodeTags(MapElement mapElement, Map<String, Object> properties) {
Log.d(tag, "decodeTags mapElement=" + mapElement + " properties=" + properties);
}


}

but I'm getting this error message always

D/org.oscim.tiling.source.UrlTileDataSource: [X:34374, Y:21325, Z:16] Network Error: HTTP Error: HTTP/1.0 404 Not Found

im doing somthing wong?

Emux

unread,
Oct 30, 2016, 1:18:26 PM10/30/16
to mapsfo...@googlegroups.com
Though I don't get 404 errors, proper Mapzen url is without "/" at the end:

https://tile.mapzen.com/mapzen/vector/v1/all


BTW see also #57 for an initial Mapbox .mvt tiles (via Mapzen) implementation.

--
Emux

Androider Sahapar

unread,
Oct 31, 2016, 1:43:51 AM10/31/16
to mapsfo...@googlegroups.com
Yah you was right about "/"
but now I'm getting this error message 

java.lang.ArrayIndexOutOfBoundsException: length=512; regionStart=-10; regionLength=522
    at java.util.Arrays.checkOffsetAndCount(Arrays.java:1732)
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:197)
    at org.oscim.tiling.source.LwHttp$Buffer.read(LwHttp.java:245)
    at java.io.InputStream.read(InputStream.java:162)
    at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:194)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:153)
    at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:163)
    at java.io.InputStreamReader.read(InputStreamReader.java:233)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.loadMore(ReaderBasedJsonParser.java:131)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._skipWSOrEnd(ReaderBasedJsonParser.java:1688)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:562)
    at org.oscim.tiling.source.geojson.GeoJsonTileDecoder.decode(GeoJsonTileDecoder.java:93)
    at org.oscim.tiling.source.UrlTileDataSource.query(UrlTileDataSource.java:86)
    at org.oscim.layers.tile.vector.VectorTileLoader.loadTile(VectorTileLoader.java:135)
    at org.oscim.layers.tile.TileLoader.doWork(TileLoader.java:66)
    at org.oscim.utils.PausableThread.run(PausableThread.java:141)

at this line of code 
cache.write(buffer, offset + (len - add), add);
in LwHttp.java class

--
You received this message because you are subscribed to a topic in the Google Groups "mapsforge-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mapsforge-dev/vyIjGE_kZR4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mapsforge-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mapsfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mapsforge-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/86f72dec-1bc9-4352-2571-456edc99c7b9%40gmail.com.

For more options, visit https://groups.google.com/d/optout.

Emux

unread,
Oct 31, 2016, 3:41:56 AM10/31/16
to mapsfo...@googlegroups.com
GeoJSON tile source and decoder in 'vtm-extras' is for Mapnik vector tiles with related issue #48.

GeoJSON vector tiles (via Mapzen) are mentioned in #55 and would need probably a new tile decoder.

--
Emux

Androider Sahapar

unread,
Oct 31, 2016, 4:39:01 AM10/31/16
to mapsforge-dev
thanks.
but do you have any plans for adding this decoder to your great lib?

Emux

unread,
Oct 31, 2016, 4:53:16 AM10/31/16
to mapsfo...@googlegroups.com
I'm afraid I cannot answer for when something will be ready...
VTM is an open source project and everyone is welcomed to contribute. :)

We have #55, #56, #57 open issues for all Mapzen vector tile formats: .mvt, (geo) .json and .topojson.

Currently ready is an initial implementation for Mapbox .mvt tiles (provided by Mapzen too) in #57 working at the basics.
You can have a look at the Mapbox samples in 'vtm-android-example' and 'vtm-playground'.

--
Emux

Androider Sahapar

unread,
Nov 1, 2016, 1:10:28 AM11/1/16
to mapsfo...@googlegroups.com
thanks man. your so cool :)

--
You received this message because you are subscribed to a topic in the Google Groups "mapsforge-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mapsforge-dev/vyIjGE_kZR4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mapsforge-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mapsfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mapsforge-dev.
Reply all
Reply to author
Forward
0 new messages