Skip to content
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

In auto-discover, hide geocolumns from tables with multiple ones #663

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ curl localhost:3000/points,lines/0/0/0

# Table Sources

Table Source is a database table which can be used to query [vector tiles](https://github.com/mapbox/vector-tile-spec). When started, Martin will go through all spatial tables in the database and build a list of table sources. A table should have at least one geometry column with non-zero SRID. All other table columns will be represented as properties of a vector tile feature.
Table Source is a database table which can be used to query [vector tiles](https://github.com/mapbox/vector-tile-spec). When started, Martin will go through all spatial tables in the database and build a list of table sources. A table should have at least one geometry column with non-zero SRID. All other table columns except geometry will be properties of a vector tile feature.

## Table Source TileJSON

Expand Down
2 changes: 1 addition & 1 deletion src/pg/scripts/get_table_sources.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ annotated_geometry_columns AS (
SELECT
schema, name, geom, srid, type, is_view, geom_idx,
COALESCE(
jsonb_object_agg(columns.column_name, columns.type_name) FILTER (WHERE columns.column_name IS NOT NULL),
jsonb_object_agg(columns.column_name, columns.type_name) FILTER (WHERE columns.column_name IS NOT NULL AND columns.type_name != 'geometry'),
'{}'::jsonb
) as properties
FROM annotated_geometry_columns AS gc
Expand Down
2 changes: 0 additions & 2 deletions tests/expected/generated_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ postgres:
clip_geom: true
geometry_type: POINT
properties:
geom2: geometry
gid: int4
table_source_multiple_geom.1:
schema: public
Expand All @@ -104,7 +103,6 @@ postgres:
clip_geom: true
geometry_type: POINT
properties:
geom1: geometry
gid: int4
functions:
function_Mixed_Name:
Expand Down
8 changes: 0 additions & 8 deletions tests/pg_server_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ postgres:
bounds: [-180.0, -90.0, 180.0, 90.0]
geometry_type: POINT
properties:
geom2: geometry
gid: int4
table_source_multiple_geom.geom2:
schema: public
Expand All @@ -207,7 +206,6 @@ postgres:
bounds: [-180.0, -90.0, 180.0, 90.0]
geometry_type: POINT
properties:
geom1: geometry
gid: int4
MIXPOINTS:
schema: MIXEDCASE
Expand Down Expand Up @@ -254,7 +252,6 @@ postgres:
geometry_type: POINT
properties:
gid: int4
geom1: geometry
table_source:
schema: public
table: table_source
Expand Down Expand Up @@ -309,7 +306,6 @@ postgres:
bounds: [-180.0, -90.0, 180.0, 90.0]
geometry_type: POINT
properties:
geom2: geometry
gid: int4
"};

Expand Down Expand Up @@ -477,7 +473,6 @@ postgres:
geometry_type: POINT
properties:
gid: int4
geom1: geometry
points2:
schema: public
table: points2
Expand Down Expand Up @@ -524,7 +519,6 @@ postgres:
geometry_type: POINT
properties:
gid: int4
geom2: geometry
points1:
schema: public
table: points1
Expand Down Expand Up @@ -576,7 +570,6 @@ postgres:
bounds: [-180.0, -90.0, 180.0, 90.0]
geometry_type: POINT
properties:
geom2: geometry
gid: int4
table_source_multiple_geom.geom2:
schema: public
Expand All @@ -586,7 +579,6 @@ postgres:
bounds: [-180.0, -90.0, 180.0, 90.0]
geometry_type: POINT
properties:
geom1: geometry
gid: int4
table_source:
schema: public
Expand Down