1:N relations in mapstore2 with geoserver and postgis

56 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by me

T Schoe

unread,
Oct 26, 2023, 11:10:32 AM10/26/23
to mapstore-developers
Hi there,

Imaging two simple tables in postgis.

CREATE TABLE parents (
    id SERIAL PRIMARY KEY,
    name VARCHAR(100)
    location geography(Point, 4326)
);

CREATE TABLE children (
    id SERIAL PRIMARY KEY,
    parent_id INT REFERENCES parents(id),
    name VARCHAR(100)
);

So we have an 1:N relation between both. Now I could create a database view and publish that view in geoserver as layer. The downside is I would have several points in mapstore for each parent child relation. But what I want instead is two have one point (the parent)  on a map that when clicked shows all children as "features"

I found the complex features extensions of geoserver https://docs.geoserver.org/stable/en/user/data/app-schema/complex-features.html that sounds what I'm looking for.

My question is:
- can mapstore2 work with complex wfs answers 
- or is there another way to visualize parent child relations with mapstore2 in the play with postgis and geoserver?

Thanks

Toni

Lorenzo Natali

unread,
Oct 30, 2023, 5:04:45 AM10/30/23
to mapstore-developers
Hi,
at the moment MapStore do not support complex features from app schema. It could be a cool feature.

Personally when I had some MapStore projects that required relationships between layers, I had to develop a customization that fits to the specific use case.
Reply all
Reply to author
Forward
0 new messages