-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comment as TileJSON for Database View is not working #1494
Comments
Hi |
Thanks for your fast response @CptHolzschnauz To clarify further: I am able to configure tiles with all the properties corresponding to the views columns. all the data is perfectly served in a maplibre web app. |
So you mean from other tables or with parameters? |
Ok. So you modified auto_published in the config according to the manual and it did not worked out. So I can't help you, I think I'm working on a lower level ;=) Anyway, the manual says: Other than adjusting auto_publish section in configuration file, you can fine tune the TileJSON on the database side directly: Add a valid JSON as an SQL comment on the table. Martin will merge table comment into the generated TileJSON using JSON Merge patch. The following example update description and adds attribution, version, foo(even a nested DIY field) fields to the TileJSON. DO $do$ BEGIN
EXECUTE 'COMMENT ON TABLE table_source IS $tj$' || $$
{
"version": "1.2.3",
"attribution": "osm",
"description": "a description from table comment",
"foo": {"bar": "foo"}
}
$$::json || '$tj$';
END $do$; |
Yeap, this is what I did. @nyurik do you have an insight if this feature is exclusively working for TABLE and FUNCTION objects? |
Hi @Gotcha17 I tried your json commnet and it works on The table DROP TABLE IF EXISTS table_source;
CREATE TABLE table_source(gid serial PRIMARY KEY, geom geometry(GEOMETRY, 4326));
INSERT INTO table_source(geom) values (GeomFromEWKT('SRID=4326;POINT(0 0)'));
INSERT INTO table_source(geom) values (GeomFromEWKT('SRID=4326;POINT(-2 2)'));
INSERT INTO table_source(geom) values (GeomFromEWKT('SRID=4326;LINESTRING(0 0, 1 1)'));
INSERT INTO table_source(geom) values (GeomFromEWKT('SRID=4326;LINESTRING(2 2, 3 3)')); The sql comment DO $do$ BEGIN
EXECUTE 'COMMENT ON TABLE table_source IS $tj$' || $$
{
"source_name": "Some source name",
"source_description": "Some source description"
}
$$::json || '$tj$';
END $do$; |
May I have your full comment and table structure to make a debug? |
hey @sharkAndshark, I can confirm that this feature works fine when using a TABLE. Can you confirm this behavior and is it intended to only support provide this feature support for TABLEs and FUNCTIONs and not for VIEWs? |
I made a test on view and it didn't work. I think it's a bug here. @Gotcha17 |
Thanks @sharkAndshark and @nyurik ! |
Hey, i am trying to customize the TileJSON in order to have some additional parameters in it with my custom text.
I am running a
and using View as the tile source.
In this views I have tried to make change via the function as described in the docs
without success.
Additionally, I have tried just to put a simple JSON formatted text into the View description e.g.:
without a effect.
This applies for both cases, "auto_publish" and specific configuration of the tile source via "tables" section of the config.yaml
In all cases just the "standard" generated TileJSON is displayed without any information from the view description.
There are also any errors displayed, when I am setting
RUST_LOG=debug
.Do have any advise?
The text was updated successfully, but these errors were encountered: