Skip to content
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

collector #4

Open
yhahn opened this issue Sep 19, 2014 · 6 comments
Open

collector #4

yhahn opened this issue Sep 19, 2014 · 6 comments

Comments

@yhahn
Copy link
Member

yhahn commented Sep 19, 2014

  • Turns all features in a layer into a single Multi-N.
  • Drops metadata for the features/coalesces them into a single feature's attributes.
ian29 added a commit that referenced this issue Oct 6, 2014
@ian29
Copy link
Contributor

ian29 commented Oct 7, 2014

  • i can concat() geom arrays - not sure if anything else needs to happen to flag this as a multi* geom.
    • currently all geom types are dumped into just one array. is this vt-kosher?
  • still need to: "Drops metadata for the features/coalesces them into a single feature's attributes."

@ian29
Copy link
Contributor

ian29 commented Oct 20, 2014

update

  • collector now flattens attributes based on 1 or 0 grouby parameters
  • per @springmeyer's very helpful explanation last week, naively concatenating geometry arrays does not work as, as each moveto() is relative to the previous coordinate. to account for this, probably will need to full rountrip the geoms from delta encoding -> not-delta-encoding -> delta encoding.

at least we have benchmarks now

@ian29
Copy link
Contributor

ian29 commented Oct 24, 2014

ok i think i have this working:

update

by "absolute" coordinates i mean coordinates that not delta encoded but actually relative to the vt origin.

  • as we iterate through a layer, we create multi* geoms by append geometry arrays based on geometry type and/or a supplied groupby field
  • for each geometry array added to the output mutli* array, we alter the array's initial moveto() parameters so that they are relative to the previous segment's endpoint
  • in order to find the new moveto() parameters, we calculate the difference between the previous segment's endpoint and the current segment's start point (although the initial moveto params are deltas, the are relative to the origin, so we can interpret them as absolute coordinates yay).
  • rather iterating through a long list of deltas to find the previous segment's endpoint, we're storing this as a bucket property which is updated every time a feature is placed in a bucket.
  • i think i unzigzagged / rezigzagged everything in the right place i hope maybe who knows how does math work

next

i'm waiting on mapnik/node-mapnik#338 to land in order to visually test the above

@ian29
Copy link
Contributor

ian29 commented May 11, 2015

welp mapbox/mapnik-vector-tile#98

@springmeyer
Copy link

Hey @ian29. This push still has merit. The aim I think of a collector should be to create multigeometries out of single geometries. This is totally supported and can be a great optimization - resulting in much smaller tiles. You just don't want to create mixed collections of different geometry types - this is not supported and nor would there be any benefit. Make sense?

@ian29
Copy link
Contributor

ian29 commented May 11, 2015

ah okay thx @springmeyer i read mapbox/mapnik-vector-tile#98 too fast

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants