-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add support for encoding data as a raw image bitmap to UTF grids #43
base: master
Are you sure you want to change the base?
Conversation
This adds support for getting the raw image data rendered by the mapnik grid renderer. The data is returned as 64-bit signed integers or 32-bit signed integers (host endian), depending on whether BIGINT is true or not.
I am somewhat confused by this, why not just use the Image object to get raw image data |
@flippmoke How would you access the Image object? AFAICS, there's no way to access the underlying buffer from a |
My question is more why are you using a grid object rather then an Image object. https://github.com/mapnik/python-mapnik/blob/master/src/mapnik_image.cpp#L454-L456
|
Also if you did want the raw character buffer from the grid does that really help because you wouldn't have a mapping to what the character were? |
@flippmoke I experimented with UTF grid, but found its resolution to be too low for our use case and increasing the resolution inflates the JSON too much. So by getting the raw grid data (which is basically an array of 64-bits containing the feature IDs (which can be downscaled to 32-bit, 16-bit or 8-bit; depending on the amount of features)), we want to send these as images down to the client and extract the data to get the corresponding feature ID in JavaScript. A mapping to the actual feature metadata will be provided out of band, eg with a static JSON file. |
Okay that makes more sense. So some things I want to talk about before we would be able to merge something to help you out.
If you need any help towards achieving these things let me know please, more then willing to give input or help. Thanks for your pull request! |
Sure, what API are you suggesting? I'm off the coming week so I probably won't be responsive. |
That would be fine, do we need to have a way to retrieve what the raw symbols mean then at this point, etc. If they are not included in the |
Aren't the raw symbols the feature IDs? Unless you want to keep that an implementation-specific thing and allow for changing the meaning in the future? (in which case you do need a mapping) |
This adds support for getting the raw image data rendered by the
mapnik grid renderer. The data is returned as 64-bit signed integers or
32-bit signed integers (host endian), depending on whether BIGINT
is true or not.