61 Commits

Author SHA1 Message Date
Dane Springmeyer
65964c93f5 more std:: usage in c++ files 2016-04-26 16:56:24 -07:00
Dane Springmeyer
d0b5ba3862 use std::fabs instead of clib fabs 2016-04-26 16:51:12 -07:00
Eric Fischer
8c82ee4c5f Merge branch 'master' into earcut-polygon
Conflicts:
	tile.cc
2016-04-26 12:09:56 -07:00
Eric Fischer
ea638914ce Add an option not to clip features and to include each exactly once per zoom 2016-04-20 15:06:43 -07:00
Eric Fischer
41099ed731 Don't add extra points at tile boundaries if not clipping
The extra points kept the features from being exactly the same
in each tile.
2016-04-19 16:13:02 -07:00
Eric Fischer
62a74afbdc Remember to do floating point division in pnpoly 2016-04-19 12:28:49 -07:00
Eric Fischer
04c56320d2 Merge branch 'master' into earcut-polygon
Conflicts:
	geometry.cc
2016-04-14 16:21:56 -07:00
Eric Fischer
cb4a83776e Fix log formatting 2016-04-12 16:52:46 -07:00
Eric Fischer
e5461b1863 Additional debug output from polygon checking 2016-04-12 16:40:03 -07:00
Eric Fischer
efe66dcafe Use stdio instead of mmap for geometry while tiling to reduce thrashing 2016-04-11 15:59:02 -07:00
Eric Fischer
acb97361a0 Fix a line simplification crash when a segment degenerates to a single point 2016-04-07 16:45:45 -07:00
Eric Fischer
1e6332bae8 Merge branch 'master' into earcut-polygon
Conflicts:
	geojson.c
	tile.h
2016-04-07 13:50:04 -07:00
Eric Fischer
574a2b79c8 Add an option to drop a fraction of polygons by zoom.
Only warn once about polygon cleaning failures.
2016-04-06 14:17:44 -07:00
Eric Fischer
e5157ec66b Fix where I used the wrong names for the max/min long long constants 2016-03-31 11:39:12 -07:00
Eric Fischer
10cd9c8875 Check the ring order manually and reorder them if they don't nest right 2016-03-29 11:05:39 -07:00
Eric Fischer
c404082421 Factor out copied-and-pasted polygon area calculations 2016-03-28 17:01:17 -07:00
Eric Fischer
6f5199adc7 Check whether polygon inner rings are inside the outer ring 2016-03-28 16:52:33 -07:00
Eric Fischer
c6051d876f Merge branch 'master' into earcut-polygon
Conflicts:
	geometry.cc
2016-03-28 15:45:16 -07:00
Eric Fischer
c2231318bd Many places where I used unsigned array indices but meant size_t 2016-03-25 12:20:32 -07:00
Eric Fischer
d4776c8bfb Warn when splitting up a 700-sided polygon for the first time 2016-03-23 17:35:19 -07:00
Eric Fischer
705a58d255 Reverse polygon rings if they come out of Clipper with the wrong polarity 2016-03-23 17:10:10 -07:00
Eric Fischer
a989611515 Upgrade to Clipper 3eb6a85910aff 2016-03-21 16:13:47 -07:00
Eric Fischer
707036fe79 Upgrade Clipper to 07b828b1 to fix self-intersecting polygons 2016-03-18 16:35:29 -07:00
Eric Fischer
7896c3c2c9 Don't get stuck in a loop if subdividing a complex polygon fails 2016-03-10 17:07:22 -08:00
Eric Fischer
7eccc7a758 Silently drop zero-area polygons instead of showing Clipper errors 2016-03-10 16:03:02 -08:00
Eric Fischer
ea304d3a98 Split complex polygons into multiple features 2016-02-11 12:14:32 -08:00
Eric Fischer
ef646e8414 Refactor simple polygon clipping for arbitrary bounding boxes 2016-02-11 11:31:53 -08:00
Eric Fischer
1f8b6faec8 Simplify lines consistently on opposite sides of tile boundaries 2016-01-07 11:35:11 -08:00
Eric Fischer
f43d18eb73 Bring back the old simple polygon clipping algorithm 2016-01-04 17:31:33 -08:00
Eric Fischer
228a4d6bb9 Make the geometric origin a per-reader property for thread safety 2015-12-22 16:58:27 -08:00
Eric Fischer
cf279940da Don't simplify "unused" movetos from points. Don't write empty geometries. 2015-12-11 12:34:55 -08:00
Eric Fischer
f04c5e153a Avoid arithmetic overflow in area calculation 2015-12-09 15:02:59 -08:00
Eric Fischer
4bde17f8ff Remove unnecessary coordinate offsetting. Negative coordinates are OK. 2015-12-08 17:21:59 -08:00
Eric Fischer
dace304182 Offset coordinates for Clipper to keep them positive.
Limit very high or low latitudes and longitudes.
2015-12-08 16:24:17 -08:00
Eric Fischer
36f4f77640 Another polygon fix: if the outer ring was dropped, drop its inner rings too 2015-11-02 11:43:44 -08:00
Eric Fischer
358e9cad5b Use closepath for each polygon ring to match the vector tile spec 2015-10-28 14:34:57 -07:00
Eric Fischer
e554a121fb Fix formatting 2015-10-20 12:03:49 -07:00
Eric Fischer
f64e2c94e2 Let Clipper clean up polygons again after scaling and simplification 2015-10-15 17:11:29 -07:00
Eric Fischer
6a1895547d Reduce minimum polygon size for less blocky appearance 2015-10-14 15:51:11 -07:00
Eric Fischer
592c47c549 Fix signedness warnings 2015-10-14 12:24:18 -07:00
Eric Fischer
2b25c2fe3e Use Clipper for polygon clipping instead of my own implementation 2015-10-13 17:25:01 -07:00
Eric Fischer
329f041bf2 Remove closepath expectation in polygon thinning 2015-10-07 17:11:58 -07:00
Eric Fischer
5dc9f50345 Clean up polygon generation and clipping. Make sure winding order is correct. 2015-10-07 16:52:52 -07:00
Eric Fischer
18cdcb0732 Drop linetos smaller than tile resolution before doing normal simplification
Since simplification is rather expensive
2015-07-01 12:16:50 -07:00
Eric Fischer
a185073f0a Shrink the geometry by shaving off bits below the maxzoom tile resolution 2015-06-18 14:16:16 -07:00
Eric Fischer
1a44538bdf Use the first coordinates of the first feature as the origin for deltas 2015-06-18 10:52:01 -07:00
Eric Fischer
46626e4f08 Delta encoding for motion within features 2015-06-17 17:48:29 -07:00
Eric Fischer
8a1f0d83e1 Consistent indent style with clang-format 2015-06-03 11:22:13 -07:00
Eric Fischer
105dfa73d7 Use bounding box for quick accept/reject before detailed clipping. 2014-12-11 13:34:50 -08:00
Eric Fischer
380550ce85 Remember to remove the closepath after clipping away a polygon 2014-12-04 14:54:11 -08:00