Skip to content
This repository

move grid_renderer feature keys to counter (or rendering buffer to 32bit ints) #1196

Closed
springmeyer opened this Issue · 7 comments

3 participants

Dane Springmeyer strk Christian Gendreau
Dane Springmeyer
Owner

Early revisions of the grid_renderer used an incrementing counter for each feature processed, and burned that integer into the grid buffer during rendering. During encoding these keys were re-mapped back to the feature's actual id.

After #753 was finished for all key datasources, I moved to burning the feature.id() directly into the rendering buffer because they were now promised to be unique and because it simplified the encoding boilerplate.

This was short-sided because we need to support at least 32 bit integers (and in the future perhaps 64 bit) for both feature.ids(). Currently now its possible for feature ids to overflow when pushed into the unsigned short rendering buffer which is limited to 65535 and only positive numbers.

Dane Springmeyer springmeyer closed this in 957c40f
Dane Springmeyer
Owner

note to anyone watching - yes, we need to consider moving to 64 bit integers, but since feature.id() is 32 that was my target for now.

strk
strk commented

was this backported to the 2.0 branch ?

Dane Springmeyer
Owner

no.

Christian Gendreau

On mapnik 2.0, could I reduce the impact of the issue if I reduce the density of overlapping points?

Dane Springmeyer
Owner

@cgendreau - no, the only workaround is to ensure that your feature ids are less than 65,535.

Christian Gendreau

@springmeyer You mean a maximum of 65,535 features or 65,535 as the maximum value of a feature?

Dane Springmeyer
Owner

It depends. Most directly I mean the maximum value of the feature id. In the case of the the Mapnik postgis plugin (which I think is what you are using) by default the feature.id() is incremented per feature - so that would mean the overflow could be avoided by rendering less than 65k features per tile. The postgis plugin has a key_field option which allows the user to control which value is used for the feature.id() and in that case overflow would only occur based on that fields value.

Christian Gendreau cgendreau referenced this issue in Canadensys/canadensys-explorer
Closed

Problem with the interactivity on the map #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.