Subscribe to this thread
Home - General / All posts - M9 create drawing from query : delicate situation
apo75 post(s)
#13-Feb-20 09:59

Dear all,

I was using for long this very useful possibility offered in M8 and now in M9 of "linking" a drawing on a query. This option is very similar in both versions but on one point, the spatial index.

My interest is to generate (for example GeomMakePoint), and not select as shown in the help examples, a geometry using sql and create a drawing from that, but the M9 system requires a spatial index to exist in the query table schema.

I can't find a way to address this issue, any idea?

Best

a.

tjhb
9,095 post(s)
#13-Feb-20 13:18

Would it work for you to reuse an existing table (and drawing)?

You can empty then refill it between uses.

apo75 post(s)
#13-Feb-20 13:23

Hmmm nice idea to use an existing or just created structure, yes it might to the work.

but what is interesting to me is that once I create the new Drawing, M9 is asking for the projection to be used but not if an index has to be created. By the way storing an index in a unstored data structure is not that intuitive

Thanks

a.

joebocop
402 post(s)
#13-Feb-20 17:12

It's possible that I've misunderstood the question here, but in 9 I "link" drawings to queries producing geoms (such as those calling GeomMakePoint) successfully, without needing to build index every time a viewport opens, like

-- $manifold$

TABLE CALL TableCacheIndexGeoms(

  (SELECT GeomMakePoint(VectorMakeX2([x][y])) AS [geom_mfd] FROM [My_Table])

  , True

)

apo75 post(s)
#14-Feb-20 07:26

Never saw this tip, but it works like a charm and make my day.

I love learning from this forum

Thanks a lor Joe

adamw


8,882 post(s)
#14-Feb-20 07:30

Several ways to go:

  • wrap the result of the query into a table with indexes using TableCacheIndexGeoms, like joebocop shows;
  • use a computed field and create an index on that field;
  • make a query do DELETE / INSERT into a table and create an index on the geometry field in that table.

That's just something that immediately comes to mind.

apo75 post(s)
#14-Feb-20 08:31

I selected the first option for its elegance. Thanks

a.

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