Commit Graph
49 Commits
Author SHA1 Message Date
Erica Fischer aa96f126c1 Add a way to run tippecanoe single-threaded for profiling 2024-02-01 11:38:48 -08:00
Erica Fischer f957f30f90 Clean up internal naming related to tilestats (#190)
* Get rid of the type_and_string near-synonym for serial_val

* Rename file_keys to the more familiar tilestats

* "tas" (type_and_string) => "sv" (serial_val)

* "fk" (tile_keys) => "ts" (tilestats)

* Revert ""tas" (type_and_string) => "sv" (serial_val)"

This reverts commit 4854c57e22.

* More carefully this time: "tas" (type_and_string) => "sv" (serial_val)
2024-01-23 14:17:19 -08:00
Erica Fischer 390771f855 Polygon shards (#105)
* Put all of this back in geometry.cpp for conflict resolution

* Stabilize line simplification to behave the same regardless of winding

* Round instead of truncating when clipping lines

* Restore non-Wagyu polygon clipping from prior to 2fdec7d2

* Make it round, not truncate, which reverts the last commit's test diffs

* Clip in floating point, not integers, which makes no difference

* Track nodes added at tile edges during clipping

* Scale geometry up before wagyu to prevent changes from precision loss

* Actually do the shared edge detection

* Fix cases where nodes were not being added at the tile boundary

* One more place I should have rounded

* Narrow down where the discrepancy comes in

* Revert "Narrow down where the discrepancy comes in"

This reverts commit 221c4c5fc0ac9a6567e091c6a94b3d87dc8ade83.

* Another attempt to narrow it down

* The discrepancy seems to be introduced in reordering. No obvious bug

* Was still truncating instead of rounding in projection

* Also makes no difference...

* Just forget that line reversal exists for a minute

* Just reversal no coalescing

* Try clipping in integers instead of floating point

* Don't simplify after coalescing if they said no simplification

* Check whether behavior is consistent with intentional simplification

* Replace more floating point with integer

* Are these three features enough to demonstrate the problem?

* Add a few more nearby borders

* All the features that touch tile 6/16/23

* Stay in integers in line simplification

* More attempts to solve failures to simplify consistently

* Fix most of the overflow errors

* Fix known cases of integer overflow

* All the tests change again

* Pull clipping and scaling code back out into clip.cpp

* Resolve the test conflicts

* Stabilize choice of which three points to keep with different windings

* Almost right, I think!

* Fix collapse of islands to shards

* Self-intersections in the same feature don't count

* Revert "Self-intersections in the same feature don't count"

This reverts commit e04b19916e.

* Don't scale down geometry if we are going to look for shared nodes

* Fix the missing multiply that was keeping simplification from happening

* Fix one more opportunity for overflow

* Somehow I deleted this test?

* Lost this test too

* Clean up debugging printfs

* Restore code sequence from main to make it reviewable

* Remove unneeded rounding

* Update documentation

* This test is no longer useful

* Back to floating point Douglas-Peucker to fix undersimplification

* Try an older ubuntu

* Revert "Try an older ubuntu"

This reverts commit 13fefacfd7.

* Log OS info

* Remove tests that are no longer needed

* Oops, did need that one after all

* Fix the arm vs x86 discrepancy?

* Try another quantization

* Cleanup from review

* Add a test for the actual purpose of this PR
2023-09-14 16:51:38 -07:00
Erica Fischer f2127fec97 Reduce thrashing during feature ingestion and tiling (#56)
* Remove the concept of "separate metadata"

This was an extra level of attribute indirection (features point
to metadata records which point to key and value strings) which was
intended to reduce the size of temporary storage for features with
large numbers of attributes that were also spread across large numbers
of tiles at maxzoom.

For other kinds of features, the extra indirection slowed things down
instead, and, especially when maxzoom guessing was being used, many more
features were having their metadata externalized than could actually
benefit from it.

* Shave a few bytes off temporary files by using more unsigned integers

* Flush stderr after logging progress

* Revert "Shave a few bytes off temporary files by using more unsigned integers"

This reverts commit eef29084ec.

* Limit the size of the string pools and trees to fit in memory

* Add missing #include

* Move the string pool and search tree from mmap to allocated memory

* Sort in allocated rather than mapped memory too

* Also use pread instead of mapping to read in the data to sort

* When the pool gets too big, switch to just the file, not memory

* Switch string pool from memory to disk when memory is 10% full

* Add to-memory versions of the serialization functions

* Crashy work in progress toward compression

* Fix the pointer bug that was causing the crash

* Serialize features into memory rather than straight to disk

* Compress individual features in the temporary files

* Don't need to store the length of the geometry

* Remove per-feature compression; move minzoom back into the object

* Start adding a stream compressor object

* Track file position within fwrite_check()

* Add compressed stream writer functions

* Pull the writing of the serialized feature out to the callers

* Starting toward compression again from a different point

* Hook up more compression functions

* Remove unused code from the other day

* Make enough deflate calls to flush out all the buffered data

* Start on decompression

* Tile number is uncompressed, tile content is compressed

* Work on alternating compressed and uncompressed in decompression

* Closer, but still doesn't work

* Sort of works

* Works until we get to concatenated tiles

* More attempts that don't work

* One bug down

* It made a tileset!

* Handle nonzero initial zooms

* Fix seeking within compressed feature streams

* Tests pass!

* Remove debug spew

* Oops: remember to delete the temporary files so they don't hang around

* Test that fails with the current compression code

* Properly account for bytes read while closing the compressed stream

* Limit the number of warnings about bad label points

* A little more armor when closing decompression

* This time for sure

* A different, less fragile, test that failed previously with compression

* Move feature stream compression to its own file

* Remove now-unused code to deserialize from a file

* Forgot to add the new files

* Remove a little debugging logging

* Add a couple of comments on what it means to be within decompression

* Fix indentation

* Update changelog. Remove stray debugging comment.
2023-02-14 12:47:40 -08:00
Erica Fischer 2b7bbbdbca Report JSON object context on the same line as the error message (#49)
* Report JSON object context on the same line as the error message

* Update changelog
2022-12-14 12:34:21 -08: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 67cd9d8d85 Reduce tippecanoe memory usage (#5)
* Change JSON objects to a union type to use less memory

* Stop storing the string representation of JSON numbers

* Restore the ability to create features with large integer attributes

* Make sure large-integer feature IDs still behave as before

* Add missing #include

* Don't preallocate as much space for arrays and objects

* Treat inability to check free disk space as a warning, not an error

* Update changelog and version
2022-08-09 15:18:51 -07:00
Eric Fischer 0acdeef525 Fix null pointer crash when looking for feature extent in filter output 2018-10-22 13:26:53 -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 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 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 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 50910b211b Remove more unused parameters 2017-11-07 11:09:22 -08:00
Eric Fischer d89d46da65 Remove unused parameters 2017-11-07 10:55:34 -08:00
Eric Fischer e7ee83f27b Move attribute type coercion out of parsing and into serialization 2017-08-24 17:27:30 -07:00
Eric Fischer 200f6777ba Fix layer list in tilestats when filtering and tile-joining.
(The feature count when filtering will be the sum of features
across tiles instead of filters from the original input, since
the filter reader doesn't know what the original input feature
set was.)
2017-08-08 16:41:20 -07:00
Eric Fischer 635429cd87 Fix dangling pointer. Defer tilestats generation until tiling if filtering. 2017-08-08 13:38:48 -07:00
Eric Fischer eebc8f7639 Remember to close polygons before sending them to the prefilter 2017-08-08 11:58:51 -07:00
Eric Fischer c79f19e3ca Merge branch 'master' into plugins 2017-08-08 11:08:10 -07:00
Eric Fischer b301512860 Merge branch 'master' into plugins 2017-05-12 17:20:30 -07:00
Eric Fischer 7dc586bc84 Merge branch 'master' into plugins 2017-04-17 16:01:12 -07:00
Eric Fischer ae4f03d92b Add missing #include 2017-03-28 17:15:41 -07:00
Eric Fischer 834ba19277 Add option for newline-delimited output format to tippecanoe-decode 2017-03-28 16:25:40 -07:00
Eric Fischer 150e3663e1 Pass the index, sequence, and extent through the prefilter when needed 2017-01-13 14:59:11 -08:00
Eric Fischer 8e17c3aa09 Update the layer list outside of the property loop 2017-01-02 16:33:44 -08:00
Eric Fischer cf6a2d3a67 Provide layer names to postfilter and read layer names back in 2016-12-21 11:47:49 -08:00
Eric Fischer 71ac6596af Warn about broken pipes in filters instead of exiting abruptly 2016-12-21 10:10:22 -08:00
Eric Fischer 6a5461763c Fix reordering of attributes and failure to update layer name table 2016-12-20 16:41:23 -08:00
Eric Fischer c2fa8e3633 Switch the segment and layer ID based on prefilter output 2016-12-12 17:00:45 -08:00
Eric Fischer ad4060eced Fix coordinate rounding error in the prefilter 2016-12-12 16:12:22 -08:00
Eric Fischer 9c0e2cdfa7 Fill out layermaps when reading the output of the prefilter 2016-12-12 16:08:08 -08:00
Eric Fischer 5e7f718afc Fill out layermaps when reading the output of the postfilter 2016-12-12 15:21:05 -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 d940eb1cef Factor out filter setup from the reading and writing loops 2016-12-08 15:46:12 -08:00
Eric Fischer d1dc310bbc The GeoJSON-producing part of prefiltering 2016-12-08 15:13:38 -08:00
Eric Fischer 5960a15fcd Add magic #defines to avoid default small Mac stdio limits 2016-12-08 12:33:02 -08:00
Eric Fischer 6530e155eb Don't put a comma between features in filter output 2016-12-08 11:14:06 -08:00
Eric Fischer 3f14a0dd55 Factor out conversion from JSON types to vector tile attribute types 2016-12-07 16:17:17 -08:00
Eric Fischer 5554b9cbba Add the command-line option to specify the filter 2016-12-07 12:15:57 -08:00
Eric Fischer a114a890d8 Keep from leaking other pipe file descriptors to unrelated children 2016-12-07 11:26:03 -08:00
Eric Fischer 3d1ceac96a Lock around setup of pipeline and filter process 2016-12-07 11:16:34 -08:00
Eric Fischer 7514797c4c Add missing #includes 2016-12-06 17:25:23 -08:00
Eric Fischer d8fe69a99e Round coordinates instead of truncating to avoid projection error 2016-12-06 17:19:22 -08:00
Eric Fischer 679189e5a2 Parse JSON coming back in and turn it back into features 2016-12-06 17:19:22 -08:00
Eric Fischer 4256473283 More reorganization to reuse JSON parsing 2016-12-06 17:19:22 -08:00
Eric Fischer 112f451c66 Move JSON-writing again to keep it from requiring all plugin code 2016-12-06 17:19:22 -08:00
Eric Fischer 94bebbd276 Write GeoJSON to the filter and read (but don't parse) what comes back 2016-12-06 17:19:22 -08:00
Eric Fischer adfceed554 Factor out conversion from vector tile to GeoJSON 2016-12-06 17:19:22 -08:00