Commit Graph
56 Commits
Author SHA1 Message Date
Erica Fischer 2261adf05e 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.
2022-10-07 12:11:12 -07:00
Erica Fischer c34348218f Try a little harder to find an optimal label point 2022-10-06 13:05:38 -07:00
Erica Fischer ffd07befce Don't choose a label point that is too close to a border 2022-10-06 11:46:10 -07:00
Erica Fischer 7127f8af97 If the label point isn't within the polygon, find one that is 2022-10-06 11:27:44 -07:00
Erica Fischer dd43a8d79a Use Turf's center-of-mass algorithm for polygon label points 2022-10-05 19:02:30 -07:00
Erica Fischer 1885f989bf Add an option to generate label points in place of polygons 2022-10-04 16:02:31 -07:00
Erica FischerandRoman Karavia 182093bdc7 Improve precision of polygon area calculations (#19)
* Improve precision of get_area by using long double

* Trying to get consistent polygon area results between ARM and x86

* Calculate polygon area closer to the origin for better precision

* Update changelog

* Also exercise tiny polygon dust in the ring area test

They previously behaved differently here between x86 and ARM

* On M1 Macs, long double is just double anyway, so don't use it

* Be more careful about overflow: scale the polygon ring down into range

* Fix the bug I just introduced in the scaled area calculation

* Use only the sign from the scaled-down area calculation

Co-authored-by: Roman Karavia <47303530+romankaravia@users.noreply.github.com>
2022-10-04 10:04:34 -07:00
Erica Fischer 4ef430b913 Add an option for the Visvalingam simplification algorithm (#16)
* First attempt at porting Paul Mach's Visvalingam implementation

* Make indent

* Mostly working

* Approximate equivalence from Douglas-Peucker to Visvalingam levels

* Don't simplify away tile boundary crossing points

* Add a command-line option and test for Visvalingam simplification

* Update changelog

* Cleanup in response to review feedback

* Include <stdio.h> to fix compiler warnings
2022-09-30 12:00:07 -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 6978a0e102 Reindent with clang-format (#3) 2022-07-28 11:19:30 -07:00
Monty Taylor efa40d20ab Clean a few warnings emited by GCC v8
An instance of catching an exception by value:

  https://blog.knatten.org/2010/04/02/always-catch-exceptions-by-reference/

In jsontool, there's a warning about writing 8 bytes into a 7
byte buffer, potentially truncating or losing the nul-terminator.

There are a couple of instances of an unused bool variable, not
really a big deal.
2020-05-17 09:43:24 -05: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 6376c283ba Add Hilbert Curve feature sequencing as an option 2018-12-12 10:51:00 -08:00
Eric Fischer cf28e6b88b Make it an error, not a warning, to have missing coordinates for a point 2018-11-26 14:50:45 -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 48486b5d7b Add --use-source-polygon-winding and --reverse-source-polygon-winding 2018-06-01 12:59:28 -07:00
Eric Fischer 59dd095607 Make file positions and lengths thread-safe 2018-05-07 14:42:49 -07:00
Eric Fischer d89d46da65 Remove unused parameters 2017-11-07 10:55:34 -08:00
Eric Fischer 9cbbc4c68d Merge branch 'master' into plugins-merge 2017-03-02 10:45:25 -08:00
Eric Fischer 1b68dcdc22 Fix division by 0 by using more general and robust polygon-checking code 2017-02-17 13:25:56 -08:00
Eric Fischer 62e1018c87 Fix area of placeholders for degenerate multipolygons 2017-02-06 14:14:34 -08:00
Eric Fischer 31f254ac99 Upgrade to Wagyu 0.3.0; downgrade C++ requirement to C++ 11 2017-01-26 13:28:17 -08:00
Eric Fischer aa75f4a4c4 Merge branch 'master' into plugins 2017-01-12 16:03:55 -08:00
Eric Fischer 72086b7e92 Upgrade Wagyu to cfc895 and use its Sutherland-Hodgman implementation 2017-01-11 15:43:07 -08:00
Eric Fischer 2fdec7d2e4 Try using Wagyu's quick_clip 2017-01-06 16:24:09 -08:00
Eric Fischer 854dc2bca5 Merge branch 'master' into plugins 2016-12-20 14:15:06 -08:00
Eric Fischer 4fc671f1d1 Merge branch 'master' into plugins 2016-12-14 11:29:58 -08:00
Eric Fischer b3c116b989 Merge branch 'master' into wagyu-clean 2016-12-14 11:12:07 -08:00
Eric Fischer d7d5bed781 Remove duplicate vertices before calling wagyu 2016-12-13 16:55:33 -08:00
Eric Fischer af3d48e5b3 Fix integer overflow identified by -fsanitize=integer 2016-12-13 16:19:38 -08:00
Eric Fischer 0e5b513637 Start getting features (just geometry so far) back from the prefilter 2016-12-09 15:35:57 -08:00
Eric Fischer 5194a39c16 Factor out clipping to tile boundaries; test random attributes & layers 2016-12-09 10:47:03 -08:00
Eric Fischer 569825324a Factor out feature deserialization 2016-12-08 17:11:37 -08:00
Eric Fischer a4f5406cfb Switch polygon topology correction from Clipper to Wagyu 2016-12-07 14:29:09 -08:00
Eric Fischer f6d5d1803b Round coordinates in low-zoom grid instead of truncating
To avoid rounding error if features are already tile-grid-aligned
2016-11-29 15:18:44 -08:00
Eric Fischer 0db8d9ed8b Option to snap low zooms to a stairstep grid 2016-11-28 15:45:38 -08:00
Eric Fischer 9ea29601ab Don't let line simplification reduce a polygon ring to below 3 points 2016-11-14 11:22:21 -08:00
Eric Fischer faa5720e3b Remove dead code 2016-11-01 16:31:45 -07:00
Eric Fischer 8296190487 Remove leftovers from early versions of --detect-shared-borders 2016-10-26 15:47:26 -07:00
Eric Fischer 93d3c40593 Remove dead code 2016-10-26 15:43:46 -07:00
Eric Fischer f7daa05515 Add a critical point where the set of rings using a polygon edge changes 2016-10-05 17:16:18 -07:00
Eric Fischer 0d1931319c Use simpler calculation to intersect polygon edges with tile edges.
Add the polygon that produced a bad tile with the previous version
as a test.
2016-08-24 15:32:48 -07:00
Eric Fischer 8b339abd40 Use the same serialization in both places, and add sanity checks 2016-08-08 17:08:36 -07:00
Eric Fischer 9908db5e56 Add an option to vary the level of line and polygon simplification 2016-07-12 16:51:56 -07:00
Eric Fischer 850a36b2f6 Update clang-format options for clang-format 3.9.0 2016-06-16 12:33:38 -07:00
Eric Fischer c0edefa721 Pack structures tighter to use a little less memory 2016-05-11 14:23:39 -07:00
Eric Fischer 4f01b13fe1 Let zoom level 0 have just as much extent and buffer as any other zoom 2016-05-09 16:01:10 -07:00
Eric Fischer 0f1d2e4220 Fix additional g++ warnings 2016-05-03 16:39:26 -07:00