Subscribe to this thread
Home - General / All posts - Manifold 9 and dynamic drawings
danb

2,039 post(s)
#20-Aug-23 21:04

I have been taking my first tentative steps with Manifold 9 Server and have a question about dynamic drawings. By way of some background. In a GeoPackage,

I have a drawing layer representing fictitious mooring swing circles:

See Clipboard-1

In another M9 project, I link in this layer form the GeoPackage and process it using a dynamic query (TableCacheIndexGeoms) to determine which swing circles overlap by a percentage greater than a value set as a query parameter. The resulting data from the dynamic query is themed and the project exposed as an internet maps server.

See Clipboard-2

So far so good. I can click on the layer to show the data and everything has been incredibly simple so far considering that I have never tried a Manifold 9 IMS prior to this.

Anyway, my thinking was, that if users then linked to the GeoPackage that is the source layer and added a new polygon, that because the IMS is showing a dynamic drawing based on a linked table, that it would automatically refresh and update to reflect the changes. This however does not seem to be the case. For example, I add a new polygon to the GeoPackage:

See Clipboard-3

Now I zoom to the polygon in the IMS. I would expect to see the triangular polygon and for them both to have been themed red but alas no.

See Clipboard-4

The only way to get it to display is to stop the IMS service and then restart it. No room to attach Clipboard-5 but it is a close up of a red circle and triangle as expected.

Is this expected behavior or am I doing something wrong? Any pointers appreciated as always and nice work on the WMS! Can we have a WFS next? J

Attachments:
Clipboard-1.png
Clipboard-2.png
Clipboard-3.png
Clipboard-4.png


Landsystems Ltd ... Know your land | www.landsystems.co.nz

dale

623 post(s)
#20-Aug-23 22:04

Ohh, this would make an excellent video when solved.

danb

2,039 post(s)
#20-Aug-23 22:46

Wouldn't it just! There are lots of things like this that Manifold could do which would offer terrific leaps forward at my place of employ.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Dimitri


7,316 post(s)
#21-Aug-23 06:09

Could you post the project?

danb

2,039 post(s)
#21-Aug-23 09:18

Sure. Will do first thing tomorrow. Thanks Dimitri


Landsystems Ltd ... Know your land | www.landsystems.co.nz

danb

2,039 post(s)
#21-Aug-23 21:01

Here you go. My steps are listed in the project.

Many thanks for your interest

Attachments:
M9 SWING FORUM.mxb
SWING FORUM.gpkg


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Dimitri


7,316 post(s)
#22-Aug-23 07:01

Thanks. I duplicated the effect. At first I thought that given your instructions...

9. Draw a polygon that covers at least 20% of the southernmost green swing circle.

10. Exit Manifold session without saving.

... the issue was not saving the edits made. But that's not the case. Even if you save the edits the web display does not update.

That's interesting because after editing the gpkg in a different session, and saving changes, you can open the M9 SWING FORUM.map project even while the web server is running and see that the Map has updated using new data from the changed gpkg as pulled by the query that generates the dynamic drawing.

But the web display doesn't update unless the Server service (I use services) is stopped and started again.

I think the issue might be to do with how Server caches data when drawings are the dynamic results of queries. It seems not to be updating the drawing data it has cached after the initial launch, even though that data might have changed if the drawing is created from a query.

On the one hand I can see how you wouldn't want the server to rebuild everything having to do with a drawing on every motion by any visitor to a website (in most applications that would result in truly awful performance), but I can see how in the case of drawings created from queries you'd want that to happen when the results returned by the query have changed.

I think that will require some thought how to do in a performant way. I've reported it to Engineering.

Thanks for providing a clear and well-explained example!

danb

2,039 post(s)
#22-Aug-23 09:04

Great. Many thanks for looking into this Dimitri. I am keen to hear what engineering get to with it.

BTW I chose GPKG as an easy proxy for any multiuser database, so I was expecting that if it worked using a GPKG, it would also work with SQLServer, Oracle etc.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

adamw


10,445 post(s)
#17-Sep-23 11:16

Anyway, my thinking was, that if users then linked to the GeoPackage that is the source layer and added a new polygon, that because the IMS is showing a dynamic drawing based on a linked table, that it would automatically refresh and update to reflect the changes. This however does not seem to be the case.

Because you used TableCacheIndexGeoms which caches the data. If you use a regular drawing which operates on uncached data, data added to GPKG will be visible on the map served by the IMS.

I understand that there is a bind - if you have a dynamic drawing, it should have an RTREE index, and TableCacheIndexGeoms is an easy way to provide that index. However, TableCacheIndexGeoms adds caching and so the drawing becomes only somewhat dynamic - you can refresh it and you can update it from the session that ran TableCacheIndexGeoms, but any changes made via other means won't be picked up automatically. The best way to go here is perhaps to stop using caching and rely on an RTREE index provided by the data source. Then, if you want the data to be dynamic, put it into a view and create an index on the view, or maybe serve a static table and periodically copy the results of the dynamic query into that table according to some schedule.

danb

2,039 post(s)
#17-Sep-23 19:31

Thanks Adam, I am going to need to re-read this several times to fully understand, but my immediate thought is that a TableCallIndexGeoms function or some such. Having a truly dynamic system, even if it only effectively works for smaller dynamic drawings such as this would be such a boon.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

danb

2,039 post(s)
#17-Sep-23 22:35

... that a TableCallIndexGeoms function or some such would be useful.

Is there an opportunity to demonstrate this as a Server example or video? I am guessing that I am not the only one interested in dynamic GIS and Manifold 9 would seem to offer an excellent foundation.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

adamw


10,445 post(s)
#01-Oct-23 12:41

The problem here is that (a) the data lives outside of Manifold (GPKG), (b) we want to pick changes made outside of Manifold (= the layer is dynamic), yet (c) we also want to have a spatial index (otherwise the data won't render).

There is no way to have both (b) and (c). Right now you have (c), but not (b). We can support layers without a spatial index, this would allow you to have (b), but not (c). But this would only work well enough for relatively small layers, because we'd basically be fetching the entire layer on each request to render it.

The simplest solution for now is to make the data a little less dynamic - eg, whenever you specify the parameter value for the percentage in step 1, instead of doing a SELECT with WHERE based on that parameter, do a DELETE / INSERT to put the result that would be returned by SELECT into a separate table. Then have that separate table participate as a layer in a map.

In general, however, we will provide means to specify query parameters via the web UI. The web UI will then automatically recompute queries whenever you specify a different set of parameters (plus we will add an option to recompute them manually even for the same set of parameters, eg, to pick up changes to data outside of Manifold).

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.