Coder Social home page Coder Social logo

Comments (6)

kiambogo avatar kiambogo commented on May 30, 2024 1

Did you try viewing the map through the built-in viewer? It provides out-of-the-box viewers for Mapbox GL JS, Openlayers, and other debug tools. I would first test here, as it could be an issue with your Mapbox GL JS implementation locally (layers/styling not configured properly). The viewer can be accessed by pointing your browser to the instance running t-rex (i.e. http://:8080). You may need to zoom/pan around to find your points. Using Inspector, you can also click on the different tiles to get more info (like # of features).

Finally, @pka also included instructions in the README for decoding vector tiles so you can view the payload in each tile:

curl --silent http://127.0.0.1:6767/ne_10m_populated_places/5/31/17.pbf | gunzip -d | protoc --decode=vector_tile.Tile src/mvt/vector_tile.proto

from t-rex.

pka avatar pka commented on May 30, 2024 1

This tile looks empty indeed. You write that your data was in mercator projection, but your config says that the layer data is in SRID 4326, which is WGS84. So t-rex transforms from 4326 to 3857 (Web Mercator). This could be the reason for missing data. Maybe you had wrong parameters in the DB loading process?

When you set RUST_LOG=debug (e.g. RUST_LOG=debug t_rex serve ...) you get additional log output including the SQL queries. So you can check manually why no data is found.

from t-rex.

musicformellons avatar musicformellons commented on May 30, 2024

I tried the the viewer. It looks nice, but does not return my points when I look under the mapbox tab. I actually would expect to -at least- have a zoomin&out widget (as it is included under the OpenLayers tab...), but I have just white, nothing else.

Part of my confusion is that it seems I need to add some styling as the viewer mentions:
Style JSON: http://<remoteIPaddress>:8080/customlayer.style.json
Or is this autogenerated and thus not really necessary to add?

The confusion comes from the fact that my styling -thus far- has been part of my mapbox-gl-js setup (so separate from the vector tiles... I am just looking for serving 'unstyled' tiles, but without styling my points might not show in the viewer?

I also tried decoding vector tiles. As I seemed to need one, I supplied a proto file from here:
https://raw.githubusercontent.com/mapbox/vector-tile-spec/master/2.1/vector_tile.proto

And then did:
$ curl --silent http://<remoteIPaddress>:8080/markers/4/2/6.pbf | gunzip -d | protoc --decode=vector_tile.Tile vector_tile.proto
I get:

layers {
  name: "customlayer"
  extent: 4096
  version: 2
}

and that's it. Does this mean there are no points in that tile? As I am sure it should contain many of my points, this would be good to know.

BTW: the coords of the points I uploaded into postgres were in mercator (so not wgs84) format. This worked for the tileserver I had before, but am wondering if this could be a culprit of my troubles maybe?

from t-rex.

musicformellons avatar musicformellons commented on May 30, 2024

Ha! After changing srid = 4326 into srid = 3857 in the config.toml it works within my mapbox-gl-js app! Looks really good and fast!

However, my points still do not show within the viewer (both not mapbox-gl and openlayers). Why is that? Styling?

from t-rex.

pka avatar pka commented on May 30, 2024

I guess because of cached tiles. Empty the browser cache and try again.

from t-rex.

musicformellons avatar musicformellons commented on May 30, 2024

Yep, that did the trick. As there is no basemap it is hard to see whether my points are 'correct'. They seem on different places (maybe to do with the 'srid trick' I did). In my app everything is working brilliantly. Very happy!

from t-rex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.