Commit Graph
203 Commits
Author SHA1 Message Date
Erica Fischer becb04693d Track desired feature count and geometry size in strategies 2022-10-20 12:09:04 -07:00
Erica Fischer d379fdf06b Add an option to limit geometry vertex count 2022-10-20 11:46:41 -07:00
Erica Fischer b763625862 Add an option to generate label points in place of polygons (#20)
* Add an option to generate label points in place of polygons

* Change all these places where I said "extent" but really meant "area"

* Revert "Change all these places where I said "extent" but really meant "area""

This reverts commit 403828d2f7.

* Add --order-smallest-first and --order-largest-first options

* Use Turf's center-of-mass algorithm for polygon label points

* If the label point isn't within the polygon, find one that is

* Don't choose a label point that is too close to a border

* Try a little harder to find an optimal label point

* Checkerboard which tiles labels are generated in, to reduce adjacency

* Use a label point for the general representative point for polygons

(Skipping the iteration to find one that is as far as possible from
the borders)

This makes the labels look better in many cases (like France at z1)
but unfortunately ripples into changing the sequence of polygons in
many tests, so the diff is big.

* Revert "Use a label point for the general representative point for polygons"

This reverts commit 2261adf05e.

* Checkpoint work on spiral labels

* Clip label spirals to the feature bounds

* Fix label test

* Be careful not to place spiral labels too close to borders either

* For spiral anchors, only check tile scale, not feature size

* Update test

* Only try to find a central label point for the largest ring

* In tiny polygon dust, keep the attributes of the largest feature
2022-10-13 14:21:36 -07:00
Erica Fischer a6abb0bc30 Add the option to use a different simplification level at maxzoom (#17)
* Add an option to specify a different simplification at maxzoom

* Add test
2022-10-03 12:18:02 -07:00
Erica Fischer af1a7ed7ae Once features can't possibly fit in a tile, stop trying (#9)
* Stop adding features to a tile if it can't possibly work

* Add --integer and --fraction options to tippecanoe-decode

* Carry the strategies field from tileset metadata through tile-join

* Update changelog

* Assign different codes to different kinds of error exits
2022-09-23 20:01:13 -04:00
Erica Fischer a447dfc089 Extra coordinate precision; feature ordering; compression improvements
* Add an option to retain extra coordinate precision at maxzoom

* Make sure not to shift away the extra detail from coordinates

* Add an option to convert double-precision attributes to single

* Sort attribute values in tiles to make them compress a little better

* Slightly improve polygon simplification

By choosing a point that would be retained after simplification
to be the start/end point that always gets retained

* I regret making all of these tests involve polygons

* Add an option to specify the size of tiny polygons

* Fix accidental requiring of argument for --single-precision

* Guard against duplicate points when generating "sizes" for them

* Restore the intended behavior that tiny polygons don't get simplified

* Make the extra detail settable rather than always maximizing it

* Revert "Improve maxzoom guessing for tightly-clustered point data sources (#4)"

This reverts commit fec5e8354c.

* Add an option to prevent choosing a base zoom higher than the maxzoom

* Keep the drop rate high enough when the basezoom gets constrained

* Revert "Revert "Improve maxzoom guessing for tightly-clustered point data sources (#4)""

This reverts commit db6bc27d9e.

* Add --order-by and --order-descending options

* Accept multiple --order-by and --order-descending-by sort keys
2022-09-06 13:08:11 -07:00
Erica Fischer 86f3e98c02 Track the desired tile size for each zoom level in tileset metadata (#7) 2022-08-11 09:58:00 -07:00
Erica Fischer c65d6938a4 Drop or coalesce points too when dropping or coalescing smallest (#6)
* Handle points too when dropping or coalescing the "smallest" features.

* Add statistics of tile size reduction strategies to tileset metadata

* Update changelog and version

* Update documentation
2022-08-09 15:29:03 -07:00
Erica Fischer 6978a0e102 Reindent with clang-format (#3) 2022-07-28 11:19:30 -07:00
Brandon Liu f442e403c5 add logging struct with -u json options flag, log tiling progress [#13] 2022-07-05 15:32:11 +08:00
Eric Fischer ed9f844cef Fix calculation of mean when accumulating attributes in clusters 2020-02-06 15:28:10 -08:00
Eric Fischer fc335e2221 Be careful to avoid undefined behavior from shifting negative numbers 2019-06-17 17:50:25 -07:00
Eric Fischer 42ee195bc3 Add an option to keep intersection nodes from being simplified away 2019-05-13 17:39:07 -07:00
Eric Fischer 4d3e30773f Be more consistent about when longitudes beyond 180 are allowed 2019-04-12 12:12:14 -07:00
Eric Fischer ffab876002 Don't run shell filters if the current zoom is below the minzoom 2019-04-08 16:30:19 -07:00
Eric Fischer ca4aad0c64 Point features may now be coalesced into MultiPoint features with --coalesce 2018-12-11 17:09:13 -08:00
Eric Fischer 5229990523 Fix gridding of small squares; use less memory for small features 2018-11-21 15:34:43 -08:00
Eric Fischer 5dfbc4a281 Add --clip-bounding-box option to clip input geometry 2018-10-22 16:49:33 -07:00
Eric Fischer 1b75ca33b4 Bug fix: mismatched features could be coalesced if from a prefilter 2018-10-10 14:35:46 -07:00
Eric Fischer 759bceb986 Duplicate features within the buffer of the antimeridian on both sides 2018-07-27 16:14:49 -07:00
Eric Fischer 8d6bd4e10f Add a filter extension to allow filtering individual attributes 2018-06-18 11:26:22 -07:00
Eric Fischer b0229530ac Turn off progress indicators during tests
(For the sake of Travis's 4MB log limit)

Also fix a few places that logged progress even when told not to.
2018-06-07 13:27:49 -07:00
Eric Fischer c9eed0d457 Be careful to remove null attributes from prefilter/postfilter output 2018-06-06 11:48:57 -07:00
Eric Fischer 09565b4632 Fix arithmetic overflows 2018-05-11 17:29:29 -07:00
Eric Fischer 59dd095607 Make file positions and lengths thread-safe 2018-05-07 14:42:49 -07:00
Eric Fischer 8ba884530a Also take note of --force-feature-limit if extending zooms 2018-05-04 12:43:27 -07:00
Eric Fischer 1b26becad9 Clear up some confusion about attribute count and external references
Now the count is always adjacent to whereever the key/value pair is
stored, and is not kept in the serial feature object other than as
the length of the vectors of keys and values.
2018-04-05 15:40:14 -07:00
Eric Fischer d01d8177a0 Allow filtering features by zoom level in conditional expressions
This moves filtering from the serialization stage to the
tiling stage so that the zoom level can be known to the filter.

The side effect is to carry null attributes much further through
the pipeline than previously.
2018-04-05 14:15:19 -07:00
Eric Fischer 1c4aa57ffd Change the JSON writing functions to object methods 2018-03-16 13:43:21 -07:00
Eric Fischer 623e0c90fe More regularization of JSON writing 2018-03-15 17:07:26 -07:00
Eric Fischer fac0ebbf52 All the other places where I used volatile but really wanted atomic 2018-03-13 15:21:21 -07:00
Eric Fischer 834c05038c Add --progress-interval setting to reduce progress indicator frequency 2018-03-13 14:51:48 -07:00
Eric Fischer 2b936af96a Fix indentation 2018-03-02 10:35:58 -08:00
Eric Fischer 18e345efb0 Make clusters look better by averaging locations of clustered points 2018-03-01 16:53:59 -08:00
Eric Fischer 10a1bc8580 Fix use of references into the wrong string pool after parallel input 2018-02-28 13:09:55 -08:00
Eric Fischer bfb6778e07 Add feature density tilestats during tiling instead of as a special case 2018-02-27 17:04:15 -08:00
Eric Fischer d66d05213f Add the mean as an option for accumulating attributes 2018-02-27 16:12:29 -08:00
Eric Fischer f87b71b739 Check the layer before letting a feature be coalsced/clustered/dropped 2018-02-27 15:45:09 -08:00
Eric Fischer c604a51039 Don't coalesce features whose non-string-pool attributes don't match
Fortunately most attributes are in the string pool, but ones that
have passed through the prefilter are not. (Nor are attributes that
are generated by clustering or by attribute accumulation.)
2018-02-27 13:38:37 -08:00
Eric Fischer 45b1a1d9e0 Sum, product, concat, and comma operations work now 2018-02-26 16:47:15 -08:00
Eric Fischer 06ed9d14d8 Add an attribute for square root of cluster count 2018-02-26 12:53:43 -08:00
Eric Fischer a8a342f701 Send dot-dropping through the same pipeline.
The first feature in a tile can never be dropped, since there is
no previous feature to attach its properties to.

Remove the previous special case that reset the dropping counter
at the first feature within each tile proper (as opposed to the
first feature in each tile, including its buffer, which is now
the one that is guaranteed to be preserved).
2018-02-23 17:19:54 -08:00
Eric Fischer 7fe0c87806 Get attribute accmulation by concatenation working 2018-02-23 16:16:11 -08:00
Eric Fischer 27154c8f06 Cluster onto the previous feature instead of onto the next
This also allows doing the attribute and tilestats all at once
at the end of the tile instead of having to update a feature
to handle the last cluster.
2018-02-23 12:26:58 -08:00
Eric Fischer 30a277a43e Always keep the first feature so there is something to coalesce onto 2018-02-22 17:25:54 -08:00
Eric Fischer bc0edec753 Call a function that will eventually preserve the attributes 2018-02-20 17:24:15 -08:00
Eric Fischer b73e710855 Add --accumulate-attribute flag and pass the result to tiling 2018-02-20 16:19:49 -08:00
Eric Fischer 2e5b597ca1 Add --coalesce-fraction-as-needed and --coalesce-densest-as-needed 2018-02-06 14:39:05 -08:00
Eric Fischer e07a4dd51b Fix out-of-bounds error when no threads were needed for a zoom level 2018-01-18 12:12:35 -08:00
Eric Fischer aaf08a6c55 Add an option to specify the clustering distance directly 2017-12-20 17:33:30 -08:00