Package: tilemaker / 3.0.0-2

Metadata

Package Version Patches format
tilemaker 3.0.0-2 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001 A short note to remember kleunen.patch | (download)

README.md | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 a short note to remember @kleunen


0002 Mention store in the readme.patch | (download)

README.md | 7 5 + 2 - 0 !
1 file changed, 5 insertions(+), 2 deletions(-)

 mention --store in the readme


0003 Don t default to ocean for other shp geojson.patch | (download)

resources/process-openmaptiles.lua | 4 3 + 1 - 0 !
1 file changed, 3 insertions(+), 1 deletion(-)

 don't default to ocean for other shp/geojson


0004 Standalone coastline config and docs.patch | (download)

docs/RUNNING.md | 30 26 + 4 - 0 !
resources/config-coastline.json | 10 8 + 2 - 0 !
resources/process-coastline.lua | 21 13 + 8 - 0 !
src/options_parser.cpp | 4 0 + 4 - 0 !
4 files changed, 47 insertions(+), 18 deletions(-)

 standalone coastline config and docs


0005 Centroid . should return nil on error.patch | (download)

include/osm_lua_processing.h | 2 1 + 1 - 0 !
src/osm_lua_processing.cpp | 13 9 + 4 - 0 !
2 files changed, 10 insertions(+), 5 deletions(-)

 centroid(...) should return nil on error

Previously, calling Centroid(...) on an invalid geometry (such as
https://www.openstreetmap.org/relation/9769005, which I think gets
simplified to having 0 rings) would throw, killing the lua process.

Instead, return nil.

0006 support GeoJSON lines format.patch | (download)

include/geojson_processor.h | 3 3 + 0 - 0 !
src/geojson_processor.cpp | 51 50 + 1 - 0 !
src/tilemaker.cpp | 2 1 + 1 - 0 !
3 files changed, 54 insertions(+), 2 deletions(-)

 support geojson lines format

Described at https://stevage.github.io/ndgeojson/; each feature is given
its own line, rather than being wrapped in a FeatureCollection.

0007 satisfy windows build.patch | (download)

src/geojson_processor.cpp | 4 4 + 0 - 0 !
1 file changed, 4 insertions(+)

 satisfy windows build?


0008 support .geojsonseq .jsonseq.patch | (download)

src/geojson_processor.cpp | 2 1 + 1 - 0 !
src/tilemaker.cpp | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

 support .geojsonseq/.jsonseq


0009 parallelize geojsonl reading.patch | (download)

Makefile | 7 6 + 1 - 0 !
include/helpers.h | 8 8 + 0 - 0 !
src/geojson_processor.cpp | 50 17 + 33 - 0 !
src/helpers.cpp | 63 63 + 0 - 0 !
test/helpers.test.cpp | 59 59 + 0 - 0 !
test/test.jsonl | 3 3 + 0 - 0 !
6 files changed, 156 insertions(+), 34 deletions(-)

 parallelize geojsonl reading

For a ~300MB geojson file of mine, this decreases wall clock time from
2.5s to 1s.

0010 build.patch | (download)

src/geojson_processor.cpp | 2 0 + 2 - 0 !
src/helpers.cpp | 1 1 + 0 - 0 !
2 files changed, 1 insertion(+), 2 deletions(-)

 build


0011 build.patch | (download)

src/helpers.cpp | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 build


0012 Update process debug.lua.patch | (download)

resources/process-debug.lua | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 update process-debug.lua

Adjust to v3.0.0 syntax: `LayerAsCentroid(layer_name, algorithm, role, role...)`

0013 warn when compact used on non renumbered PBF.patch | (download)

include/osm_store.h | 1 1 + 0 - 0 !
include/pbf_processor.h | 2 2 + 0 - 0 !
src/pbf_processor.cpp | 11 10 + 1 - 0 !
3 files changed, 13 insertions(+), 1 deletion(-)

 warn when --compact used on non-renumbered pbf

A future commit will make it safe to do so, but it's still
memory-inefficient to use --compact on a non-renumbered PBF

0014 shard stores and compact aren t compatible.patch | (download)

include/node_stores.h | 4 2 + 2 - 0 !
src/tilemaker.cpp | 4 3 + 1 - 0 !
2 files changed, 5 insertions(+), 3 deletions(-)

 --shard-stores and --compact aren't compatible

CompactNodeStore doesn't know how to compute if it contains a node,
which is a prerequisite for sharding.

The two settings don't make much sense together: sharding will create N
CompactNodeStores, which each will take as much memory as a single one,
since each will likely have a large node ID.

0015 GeoJSON lines skip leading whitespace in a chunk.patch | (download)

src/geojson_processor.cpp | 5 4 + 1 - 0 !
1 file changed, 4 insertions(+), 1 deletion(-)

 geojson lines: skip leading whitespace in a chunk

If the chunking algorithm returns a chunk that consists only of
whitespace, the current code will try to parse at least one JSON
object out of it, and fail.

This fixes that bug by consuming all the whitespace before trying to
parse an item -- the `while(is.Tell() < chunk.length)` loop will no
longer be entered, as there will be no non-whitespace content to
consume.

0016 GeoJSON writer support points and linestrings.patch | (download)

include/geojson_writer.h | 48 37 + 11 - 0 !
1 file changed, 37 insertions(+), 11 deletions(-)

 geojson writer: support points and linestrings


0017 touch file.patch | (download)

README.md | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 touch file


0018 add Makefile build.patch | (download)

.github/workflows/ci.yml | 31 30 + 1 - 0 !
1 file changed, 30 insertions(+), 1 deletion(-)

 add makefile build

Only for Linux / Mac OS X

Still todo: actually install needed deps, run make test

0019 deps.patch | (download)

.github/workflows/ci.yml | 6 3 + 3 - 0 !
1 file changed, 3 insertions(+), 3 deletions(-)

 deps


0020 deps.patch | (download)

.github/workflows/ci.yml | 6 3 + 3 - 0 !
1 file changed, 3 insertions(+), 3 deletions(-)

 deps


0021 deps.patch | (download)

.github/workflows/ci.yml | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 deps


0022 deps.patch | (download)

.github/workflows/ci.yml | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 deps


0023 macosx.patch | (download)

.github/workflows/ci.yml | 10 4 + 6 - 0 !
1 file changed, 4 insertions(+), 6 deletions(-)

 macosx


0024 linux only deps.patch | (download)

.github/workflows/ci.yml | 5 3 + 2 - 0 !
1 file changed, 3 insertions(+), 2 deletions(-)

 linux-only deps


0025 linux only deps.patch | (download)

.github/workflows/ci.yml | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 linux-only deps


0026 mac only deps.patch | (download)

.github/workflows/ci.yml | 5 5 + 0 - 0 !
1 file changed, 5 insertions(+)

 mac-only deps


0027 print c version.patch | (download)

.github/workflows/ci.yml | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 print c++ version


0028 apple silicon.patch | (download)

.github/workflows/ci.yml | 7 6 + 1 - 0 !
1 file changed, 6 insertions(+), 1 deletion(-)

 apple silicon


0029 apple silicon.patch | (download)

.github/workflows/ci.yml | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 apple silicon


0030 apple silicon.patch | (download)

src/helpers.cpp | 4 4 + 0 - 0 !
1 file changed, 4 insertions(+)

 apple silicon


0031 apple silicon.patch | (download)

.github/workflows/ci.yml | 5 5 + 0 - 0 !
1 file changed, 5 insertions(+)

 apple silicon


0032 apple silicon.patch | (download)

.github/workflows/ci.yml | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 apple silicon


0033 apple silicon.patch | (download)

.github/workflows/ci.yml | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 apple silicon


0034 apple silicon.patch | (download)

.github/workflows/ci.yml | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 apple silicon


0035 apple silicon.patch | (download)

.github/workflows/ci.yml | 5 3 + 2 - 0 !
1 file changed, 3 insertions(+), 2 deletions(-)

 apple silicon


0036 run make test.patch | (download)

.github/workflows/ci.yml | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 run make test


0037 give up on apple silicon cmake build.patch | (download)

.github/workflows/ci.yml | 13 0 + 13 - 0 !
1 file changed, 13 deletions(-)

 give up on apple silicon cmake build

vcpkg isn't installed by default, and I'm not familiar enough with how
to install + use it. Hopefully the Makefile build will catch Apple Silicon issues

0038 fail build if non zero exit.patch | (download)

.github/workflows/ci.yml | 6 3 + 3 - 0 !
1 file changed, 3 insertions(+), 3 deletions(-)

 fail build if non-zero exit


0039 use ifstream binary.patch | (download)

src/pbf_processor.cpp | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 use ifstream::binary


0040 build pmtiles no store mbtiles store.patch | (download)

.github/workflows/ci.yml | 7 5 + 2 - 0 !
1 file changed, 5 insertions(+), 2 deletions(-)

 build pmtiles/no store, mbtiles/store

Future work: ensure they're the same.

0041 revert README change.patch | (download)

README.md | 1 0 + 1 - 0 !
1 file changed, 1 deletion(-)

 revert readme change


0042 AttributePair use uint not char.patch | (download)

include/attribute_store.h | 6 3 + 3 - 0 !
test/attribute_store.test.cpp | 6 4 + 2 - 0 !
2 files changed, 7 insertions(+), 5 deletions(-)

 attributepair: use uint, not char

Since we only allocate 4 bits and `char` is signed, the usable space
was -8..7. Larger values (like, say, 12) overflow, and get interpreted
as a negative value, which means they don't act as a filter, since all
zoom values are natural numbers.

The tests didn't actually test that a zoom value could be roundtripped.
I updated them, and verified they failed before the code change, and
passed after the code change.

I've also allocated an extra bit so that we support minzooms up to z31,
vs just up to z15, since I think (?) some people generate up to z16

0043 windows build uint uint8_t.patch | (download)

include/attribute_store.h | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 windows build: uint -> uint8_t


0044 Empty strings are ok really.patch | (download)

src/osm_lua_processing.cpp | 1 0 + 1 - 0 !
1 file changed, 1 deletion(-)

 empty strings are ok really


0045 SortedNodeStore publishGroup out of bounds read.patch | (download)

src/sorted_node_store.cpp | 8 5 + 3 - 0 !
1 file changed, 5 insertions(+), 3 deletions(-)

 sortednodestore::publishgroup: out of bounds read

Fixes the issued identified by @freeExec in #661

This code is a bit gross. It intentionally loops 1 past the size of the
vector to ensure that we "publish" all the chunks.

There's a similar loop at lines 511-602.

In both loops, there's sort of three chunks of code, which I'll
call "pre", "body" and "post". The pre/post sections need to be guarded,
and the guard for the first loop's "post" section was missing.

Looking at it with fresh eyes, I think we could extract the "body" parts
of both loops to their own functions, and then just call them again
after the loop ends. For now, I'm inclined to let a sleeping dog lie,
but if more work happens in here, that'd be a good cleanup step.

This was also visible in valgrind, as it turns out--the error
goes away with this change:

```
==1968107== Invalid read of size 4
==1968107==    at 0x33ABCD: SortedNodeStore::publishGroup(std::vector<std::pair<unsigned long, LatpLon>, std::allocator<std::pair<unsigned long, LatpLon> > > const&) (in /usr/local/bin/tilemaker)
==1968107==    by 0x33B715: SortedNodeStore::finalize(unsigned long) (in /usr/local/bin/tilemaker)
==1968107==    by 0x2FEE77: PbfProcessor::ReadPbfFile(unsigned int, bool, SignificantTags const&, SignificantTags const&, unsigned int, std::function<std::shared_ptr<std::istream> ()> const&, std::function<std::shared_ptr<OsmLuaProcessing> ()> const&, NodeStore const&, WayStore const&) (in /usr/local/bin/tilemaker)
==1968107==    by 0x140801: main (in /usr/local/bin/tilemaker)
```

SortedWayStore has a similar publishGroup function, but its internal
0046 Fix thread safety issue with shapefile index.patch | (download)

src/shp_processor.cpp | 5 4 + 1 - 0 !
1 file changed, 4 insertions(+), 1 deletion(-)

 fix thread safety issue with shapefile index


0047 typo.patch | (download)

src/shp_processor.cpp | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 typo


0048 Faster polygon combining 681.patch | (download)

include/geom.h | 2 2 + 0 - 0 !
include/output_object.h | 3 3 + 0 - 0 !
src/geom.cpp | 24 24 + 0 - 0 !
src/output_object.cpp | 5 5 + 0 - 0 !
src/tile_worker.cpp | 81 17 + 64 - 0 !
5 files changed, 51 insertions(+), 64 deletions(-)

 faster polygon combining (#681)


0049 When serving tiles add the CORS Access Control Allow.patch | (download)

server/server.cpp | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 when serving tiles, add the cors access-control-allow-origin: *
 header (#684)


0050 remove FAT_TILE_INDEX 700.patch | (download)

CMakeLists.txt | 1 1 + 0 - 0 !
Makefile | 9 8 + 1 - 0 !
docs/INSTALL.md | 8 0 + 8 - 0 !
include/coordinates.h | 9 0 + 9 - 0 !
include/osm_mem_tiles.h | 2 1 + 1 - 0 !
include/shp_mem_tiles.h | 2 1 + 1 - 0 !
include/tile_coordinates_set.h | 47 47 + 0 - 0 !
include/tile_data.h | 102 57 + 45 - 0 !
src/osm_mem_tiles.cpp | 4 2 + 2 - 0 !
src/shared_data.cpp | 6 0 + 6 - 0 !
src/shp_mem_tiles.cpp | 13 5 + 8 - 0 !
src/tile_coordinates_set.cpp | 57 57 + 0 - 0 !
src/tile_data.cpp | 101 44 + 57 - 0 !
src/tilemaker.cpp | 24 17 + 7 - 0 !
test/tile_coordinates_set.test.cpp | 58 58 + 0 - 0 !
15 files changed, 298 insertions(+), 145 deletions(-)

 remove fat_tile_index (#700)


0051 support multiple input files 701.patch | (download)

Makefile | 1 1 + 0 - 0 !
src/options_parser.cpp | 5 5 + 0 - 0 !
src/tilemaker.cpp | 39 30 + 9 - 0 !
test/options_parser.test.cpp | 23 20 + 3 - 0 !
4 files changed, 56 insertions(+), 12 deletions(-)

 support multiple input files (#701)

Fixes #696, a regression introduced in the v3.0 work:

- use the old NodeStore/WayStore when multiple input files
- don't use lazy geometries when multiple input files
- compute the bbox from the union of all the pbfs

I suspect we could probably restore lazy geometries for multiple input
files, but I haven't dug in to see what would be required.

For testing, I built a pmtiles with monaco + liechtenstein and verified
they both showed up.

0052 Reduce differences between official OpenMapTiles til.patch | (download)

resources/config-openmaptiles.json | 2 0 + 2 - 0 !
resources/process-openmaptiles.lua | 331 212 + 119 - 0 !
2 files changed, 212 insertions(+), 121 deletions(-)

 reduce differences between official openmaptiles tiles and tilemaker
 implementation (#686)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Add missing features classes to landcover layer.

They are already documented but have been missing in the implementation.

* Add missing place values, add islands mapped as polygons

* Hand over variables to the function instead of relying on global access

* Set correct minzoom for railway features, add railway subclass

Minzoom for railway features depends on railway=*, service=* and
usage=*. Only railway features with specific railway=* values are added
to the vector tiles. This means, railway=construction/disused/ and
railway=fancy_value are ignored.

The OpenMapTiles schema defines a subclass field for railways as well.
This commit adds this field.

* Drop railway features without names from transportation_name

It makes vector tiles smaller if we do not add railway features without
names to the vector tiles.

* Cleanup transportation_name, drop roads without name or ref from it

* Drop layers transportation_name_mid and transportation_name_detail, use
  MinZoom() instead.
* Do not write roads without names or ref into the vector tiles.

* Use write_to_transportation_layer function for ferries

* Do not write ferries without names to the vector tiles

* transportation* layers: minzoom, construction, raceway

* Set correct minzoom values for all roads in the transportation and
  transportation_name layer.
* Add highway=raceway
* Align handling of roads under construction to OpenMapTiles.

* Do not set mtb_scale if the tag is not present

* Add aerialways

* Do not set expressway if the tag is missing

* Add areas for pedestrians, add platforms

* Add missing subclass attribute to transportation layer

* Improve handling of polygons on transporation layer

* Do not write polygons other than infrastructure for pedestrians and
  piers.
* Set minzoom according to area size and absolute minzoom.

* Add man_made=bridge, add brunnel attribute for polygons

* Add man_made=bridge to layer transportation.
* Set brunnel attribute for all polygon features on that layer.

0053 Fix roundabouts 708.patch | (download)

resources/process-openmaptiles.lua | 42 22 + 20 - 0 !
1 file changed, 22 insertions(+), 20 deletions(-)

 fix roundabouts (#708)


0054 Remove macos latest CMake CI 718.patch | (download)

.github/workflows/ci.yml | 5 0 + 5 - 0 !
1 file changed, 5 deletions(-)

 remove macos-latest cmake ci (#718)


0055 Improves docker setup for basic usage to get started.patch | (download)

Dockerfile | 100 52 + 48 - 0 !
README.md | 13 13 + 0 - 0 !
docs/INSTALL.md | 6 5 + 1 - 0 !
resources/docker-entrypoint.sh | 2 1 + 1 - 0 !
4 files changed, 71 insertions(+), 50 deletions(-)

 improves docker setup for basic usage to get started more easily
 (#713)


0056 Fix reading bools from shapefiles 715.patch | (download)

include/attribute_store.h | 2 1 + 1 - 0 !
include/shared_data.h | 2 1 + 1 - 0 !
src/shp_processor.cpp | 7 6 + 1 - 0 !
3 files changed, 8 insertions(+), 3 deletions(-)

 fix reading bools from shapefiles (#715)


0057 Only use Mac specific LuaJIT linking for 2.0 716.patch | (download)

Makefile | 6 4 + 2 - 0 !
1 file changed, 4 insertions(+), 2 deletions(-)

 only use mac-specific luajit linking for 2.0 (#716)


0058 Update RUNNING.md docker old config name 721.patch | (download)

docs/RUNNING.md | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 update running.md docker old config name (#721)

Replace the old config name with the new .json extension.

0059 Adds convenience scripts to download coastline and l.patch | (download)

README.md | 15 11 + 4 - 0 !
get-coastline.sh | 17 17 + 0 - 0 !
get-landcover.sh | 32 32 + 0 - 0 !
get-monaco.sh | 10 10 + 0 - 0 !
4 files changed, 70 insertions(+), 4 deletions(-)

 adds convenience scripts to download coastline and landuse data, see
 #720 (#723)


0060 Merges compatible points into multipoints closes 719.patch | (download)

src/tile_worker.cpp | 29 26 + 3 - 0 !
1 file changed, 26 insertions(+), 3 deletions(-)

 merges compatible points into multipoints, closes #719 (#725)