How to implement dynamic vector tile sever - mapbox

In my application, the backend (written in Java using spring boot) is serving REST API which expose a service that returns thousands of coordinates (based on filters it gets from the client). My frontend is using this API and then displays the results in Mapbox map.
The performance is not good enough for 100K of points and more, and we want to use vector tiles instead.
Since the data is dynamic, we would want our backend to act as a vector tile server, is this possible?
What's needed in order to server vector tile requests? Is there a library that can help?

Yes, this is possible. It's pretty straightforward to accept a request for a vector tile, then generate that tile and serve it back. It gets a little bit more complex when you factor in caching for performance, and trying to avoid redundant work.
I'm mostly familiar with JavaScript libraries, but mapbox-vector-tile-java looks like it will handle the part of turning geometry into a Mapbox vector tile.

Related

Tableau data layer to one state only

I'm looking to mask all of the detail in Tableau maps other than the state I'm filtered on. The data layer can seemingly only be applied to all or nothing. I'm unable to filter or limit to the dataset to which I'm working. Seems simple, yet 30min of google search can't find answer. Thank you!
I don’t believe that the map server can alter what it displays as a data layer based on the filters you choose in Tableau. The map server is a separate program that returns image tiles upon request. The map server doesn’t know about your filters on the client side - or even that the client app is called Tableau. It just knows that some client application asked for an image representing a map within a particular coordinate bounding box, with whatever style and data layer options that the client application passed.
That doesn’t mean you can’t accomplish your goal, just that you have to find a way to accomplish it on the Tableau side instead the map server side — unless you want to develop your own map server with that functionality, which would be an effort even with a tool like Mapbox.
You could
Decide what “data layers” the map server is providing that you want to retain and at what level of detail, say Avg(Income) per County
Go get that data, possibly from the census bureau
Uncheck the box for your data layers in the Map Layers pane
Use the data you downloaded above to color the map sections as desired
Add other marks to represent additional info as needed using a dual-axis and possibly data blending
Then voila, your data layers will obey your filter. You just had to move where that info was drawn. Of course, you had to find the necessary data instead of relying on the whoever built the map server to do that, but that isn’t too tough.
To handle the Tableau side of things, especially assuming you want to combine the layer we’ve been discussing with other data on your map, you will need to learn about a few other Tableau concepts. So read up on dual-axis maps, level of detail and possibly data blending.
Try this-Right click on the filter state and click show filter.Again right click on filter select "Multiple values(drop down) and then click the Customize and show apply button.Then choose the filter values and apply filter.enter image description here

Is there a way to use own custom data for traffic using the map?

Is there a way to use own custom data for traffic using the gmap, mapbox, leaflet. I just want to show custom data set for traffic using the map like google map indicating traffic in different colors in lanes. I just want to show the same but using own custom traffic data.
Any help would be appreciated.
there is no any Leaflet API to show traffic but you can applies traffic flow data to the map tiles before serving them by using Mapbox to draw on a Leaflet map to represent traffic.Here is the best approach that is not be using Leaflet functionality at all.
A web mapping library allows you to add a map to a web page and define the data it contains, its appearance, and a variety of functionality. Think of it like a toolbox filled with many different map-making tools that can be used together to build beautiful and interactive custom experiences.

Self host osm tiles

I want to host osm tiles and styles by my self on my server. I got a really nice style here
https://github.com/CartoDB/basemap-styles#1-web-raster-basemaps
It's free for use under observation of the license requirements. But i don't know how to make the next step.
I allready implemented the map on my site with using leaflet and this code (just the tile implementation part)
L.tileLayer(' url ', {}).addTo(map);
How to go on to replace this hosted version to go on to self hosted one?
You need to set up your own tile server by following the steps at switch2osm. This is an rather advanced step and requires a sufficient powerful system with fast storage and large memory. At least if you want to server tiles for the whole world. Smaller extracts have lower requirements.
Alternatively switch to vector tiles, e.g. Mapbox GL. It allows you to influence the rendering style without having to set up a large infrastructure for serving the data.

Serving a large dataset with minimal bandwidth

I want to serve a large spatial dataset, preferably without webgl support, over minimal bandwith. I've seen many examples doing so. For example:
https://interaktiv.morgenpost.de/europakarte/
What would be the best way to achieve something like this? Is it possible without hosting my data on mapbox, maybe host the data on AWS S3? How should I approach this?
I found a solution. There's a technology called an UTFGrid, which are tiles in JSON format. These tiles can be generated in many ways, for example by using TileMill and MB-util. These tiles are very small, but enable the user to see featureinfo on hover. Once these tiles are generated they can be hosted anywhere you want, AWS S3 or your own web-server.

Displaying web based visualisation or graphing of data based on a postgresql database?

I am working on a web application for a client that uses a postgresql database. I want the client to be able to go to a certain area of the site where the data from the database is displayed in graph form (for example, sales figures over a 6 month period). Is there a plugin I could use for this (I don't have any experience of this, so an easy one, or one with tutorials available would be great). I had a look at BIRT, which says it has a web based option but I couldn't really figure it out. I don't want the client to have to download and go through another program, I just want them to go to a url within their site, and it's all just presented to them there and then.
Any sort of pointers in the right direction would be greatly appreciated.
Thank you.
HighCharts, at http://www.highcharts.com/, works well for this case -- I use it fairly often. It supports Ajax data feeds in JSON format, so you can write an endpoint which returns the JSON representing the data from Postgres and which gets called from a JavaScript function which creates the graphs using that data (you would place that call in a ready function).
Also, if you're using Postgres 9.3 or higher, it supports JSON natively, so you can do the JSON conversion in the SQL query itself, as opposed to post-processing the results in your Python or other backend code.
Highcharts is reasonably flexible and allows for a variety of nice-looking, functional charts and graphs. If you want to get much fanicer, d3 may be worth a look. These are some the types of graphs/charts it can do: https://github.com/mbostock/d3/wiki/Gallery
I have not used d3 myself, however.
For the scenario you described above, Highcharts seems like it would work just fine.
It's been a while, and a lot has happened since 2016. There is now ChartJS as well - http://chartjs.org/, for example, which is easier to use than HighCharts and very flexible (I've used both).
What they both don't do is dynamic data. If you want that your client decides which data he wants to watch - that part you need to write yourself.