camptocamp / tilecloud

A powerful utility for generating, managing, transforming, and visualizing map tiles in multiple formats.
BSD 2-Clause "Simplified" License
231 stars 34 forks source link

Errors in README.md #1667

Closed NH-RedAnt closed 10 months ago

NH-RedAnt commented 10 months ago

The Getting started section leaves out the actual install of tilecloud. "pip install tilecloud" should be added someplace.

This repo does not seem to include a setup.py file, or anything to install. Nor does the repo contain run-in-place python code.

All of the references to "./tc-viewer" and "./tc-info" do not work. The files in the git repo can't be run directly, end in .py and have _ where the - is. After a "pip install tilecloud" the commands do work but only without the preceding "./".

Now I'm also having trouble with the suggested demos. But I'll report back on that once I have spent more time to see if the installation is actually ok.

NH-RedAnt commented 10 months ago

Just noting a few more issues found and I believe resolved in version 1.11.0.

As noted by some others 1.11.0 version installed from PyPy is missing the repo's "views" folder. Doing a git clone and then running tc-viewer from the cloned source can provide the necessary "views/".

The current repo content supplies a "view/leaflet.tpl" with href from leaflet.cloudmade.com that does not resolve. Replacing both the leaflet.css and leaflet.js href lines with those indicated at "https://leafletjs.com/examples/quick-start/" do resolve this issue.

In "scripts/tv_viewer.py" the "tile" function has an undefined "root". Prior revisions seem to have removed it's default definition of "root=TileCoord(0,0,0)". Adding this prior default resolves the issue, but may fail when a non-default root is supplied.

In "scripts/tc_mbtiles_info.py" there are two places where the class Tiles is instantiated with a single argument of "connection", but the class requires a bool argument prior to the connection passed to it's parent class. Preceding the connection argument with True, appears to behave as expected. This needs to be done in both places. Or perhaps alter the Tiles class to have a default?

I still don't have a lot working, but gaining on it.

NH-RedAnt commented 10 months ago

Just noting that I was the idiot for comments about setup.py. This is the first project I've encountered with the new "pyproject.toml" style packaging. I'll be learning that now so I can suggest how to correctly fix the "views".

NH-RedAnt commented 10 months ago

Just noting that the missing views can be packaged by poetry. Update the [tool.poetry] value for "include", so the array also contains "views/**". Once done a "poetry build" seems to include them in the packages.

sbrunner commented 10 months ago

I do a first path of fix in #1669