question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

globalQuantiles specified but viewportQuantiles is used

See original GitHub issue

I’m trying to use globalQuantiles to classify polygons with sequential color ramp, but the classification looks like it’s changing when the map view changes.

It looks like global vs viewport classification was being worked on in VL repo, maybe CARTOFrames issue is related?

https://github.com/CartoDB/carto-vl/issues/1275#issuecomment-466586846 https://github.com/CartoDB/carto-vl/pull/1281#issuecomment-470048194

Code snippet that produced the error

qSFR = '''
      SELECT * FROM la_join
      WHERE specificusetype = 'Single Family Residence'
      '''

vector.vmap(
    [vector.QueryLayer(
        qSFR,
        color='ramp(globalQuantiles($saleprice, 7), sunset)',
        strokeWidth='ramp(zoomrange([12,14]),[0,0.7])',
        strokeColor=colorRamp,
        interactivity={
            'cols': ['formatted_saleprice','formatted_size'],
            'header': ['<h2>Single Family Residence<h2>', ],
            'event': 'hover'
        }
    ),
    ],
    context=cc,
    basemap=vector.BaseMaps.voyager
)

Relevant error messages

No error messages, but a polygon’s classification should not change on zoom if Global Classification is used.

Here’s an example showing that a polygon’s classification is changing as what’s included in the viewport changes on zoom:

globalQuantilesCF

cartoframes version (find it with print(cartoframes.version))

‘0.9.2’

Python version (e.g., 3.5, 2.7, etc.)

3.7.1

Operation system (Windows, Linux, etc.)

Using Docker environment on a Mac: ~~https://github.com/mbforr/docker-cartoframes~~ from private end-to-end-demo repo

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ztephmcommented, Apr 25, 2019

OK thank you both, closing in favor of https://github.com/CartoDB/carto-vl/issues/1335

0reactions
elenatorrocommented, Apr 25, 2019

I’m going to add it as a CARTO VL issue because it should be tackled from this project. Once solved, then we’d update the version in CARTOFrames. Thank you very much for the update!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quantiles of spatial data in terra - Rdrr.io
You can use use global(x, fun=quantile) to instead compute quantiles across cells for each layer. You can also use this method to compute ......
Read more >
Quantile() function in R - A brief guide | DigitalOcean
Quantile : In laymen terms, a quantile is nothing but a sample that is divided into equal groups or sizes. Due to this...
Read more >
Quantile - Wikipedia
In some cases the value of a quantile may not be uniquely determined, as can be the case for the median (2-quantile) of...
Read more >
2 tmap | Making Maps with R - Bookdown
Originally, data could only be visualized in this way in R, but the ... only be used if the variable follows an uniform...
Read more >
quantile function - RDocumentation
The generic function quantile produces sample quantiles corresponding to the given probabilities. The smallest observation corresponds to a probability of 0 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found