-
-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features are being dropped randomly with no systematic order #1455
Comments
I am also a newbie but maybe I can help a bit here on GitHub because Martin is such a GREAT piece of software. Thanks to the contributors!! |
i think we had a few asks about controlling which features go into a tile. At the moment, we only support |
Perfomace is everything! According to my understanding (the doc is not complete on this) it should be possible to provide arguments to PSQL which makes it possible to achieve this in a PSQL function? |
yes, all this is possible in a pg function. Take a look at the demo site which passes and uses params |
Yes, the Taxi sensation, you're right... I meant "TODO: Modify this example to actually use the query parameters." in https://maplibre.org/martin/sources-pg-functions.html Anyway, I just discovered Martin a few days ago and I'm thrilled! Thank you and all the contributors for this fantastic piece of software! |
Thanks for your comments @nyurik and @CptHolzschnauz . Let me give you one example to explain the kind of behavior I'm trying to achieve. Below is the screenshot of 2000 randomly generated points (can't upload the geojson but happy to share if needed for testing). Kindly note how they are spread. I have spread them into two clusters, each one having 1000 points each. Now when I upload this table, setting max_feature_count: 1000, in QGIS, at zoom 5 I see the data like this: When I create vector tiles against the same data using Tippecanoe using the following command: My say is, apart from all the possibilities of having a pg function that can be used to neatly filter features on the fly always keeping them well within the max_feature_count limit, if there is a scenario where there is no pg function or the function happened to return more than 1000 features there is no systematic order in which Martin drops them. IMHO, tile coming from Tippecanoe is more representative of what's there on the ground (although those points are mostly synthetic, guess by taking an average of nearby points and so you won't find them exactly at the same location in the original data; but from the visual point of view it's acceptable IMHO). At least we can say there are roughly two clusters with around equal number of features. In case of Martin, it looks like there is nothing in South-East region. One only needs to zoom in enough to figure out the actual spread of points. Having an inbuilt feature to drop features beyond the max_feature_count limit in a way that doesn't loose the essence of the data (mainly their spatial spread and density) would be great. Hope I managed to give a reasonable explanation. Just sharing one more screenshot, this is what Martin shows at zoom 4 |
Thx for all the in depth explanation! So, two things:
|
Thanks for your quick reply @nyurik |
@e-n-f is great! Maybe we can get their feedback on this? |
Hi! Just to make sure, you're saying that you want to emulate the tippecanoe behavior, not that you have found a bug in tippecanoe? If tippecanoe needs to Spatialite can give you a quadkey equivalent with st_geohash. I'm not sure how to do the bit reversal in SQL, but maybe string reversal would be close enough to give you a pretty good drop sequence. |
For polygons I would recommend Both methods have been tuned recently to be more consistent between zoom levels. I can talk about the old behaviors if you want the details, though. |
thanks for such awesome in-depth info! So it sounds like Tippecanoe does not rely on SQL to get just the needed data, and rather retrieves all data, computes geohash (quadkey) of the centroid, and then incrementally drops last digits (picking one item per shortened key) - until it has small-enough dataset. Essentially an incremental clustering approach |
Right, yes, tippecanoe does not use SQL, but does all of its ordering and processing internally from the full set of features, and yes, the result is effectively clustering, but locating the feature representing the cluster at the location of an arbitrary feature in the cluster rather than at the mean of the clustered features' locations. |
thx for all the feedback @e-n-f! So to make this work, I see two main paths:
|
Hi there,
I'm new to Martin. I've been using Tippecanoe so far, and it offers some ways to control how features should be dropped if they exceed a certain limit per tile. I'm not able to control this in Martin. Kindly look at the following two scenarios:
Slightly left view:
Slightly right view:
Here, I'm simply panning slightly to my right and the big yellow cluster suddenly appears.
Also, when I start zooming out it randomly drops all features from random locations giving an impression that there is nothing in there. I need to zoom in enough to make sure.
Low Zoom:
High Zoom:
I have made sure it's not network timing out while loading the tile. Below is what my config.yaml looks like, which I copied from https://maplibre.org/martin/config-file.html. Am I missing something? Any kind of help to make it performant while not loosing the impression of where the polygons are at various zoom levels and pans would be extremely helpful.
The text was updated successfully, but these errors were encountered: