Subscribe to this thread
Home - General / All posts - Select objects whose centers/centroids are within polygons
RAR111 post(s)
#16-Nov-20 14:11

Hi all,

Would it be possible to select any objects - points, lines, polygons- that have their center/centroid inside selected polygons without needing to create center/centroid first for the objects before the overlay?

Thank you!

apo
171 post(s)
#16-Nov-20 21:44

Two questions :

  1. is sql an option for you?
  2. M8 or M9

a.

RAR111 post(s)
#16-Nov-20 22:09

Apo,

Thank you so much for helping; yes SQL will be OK and I am using M9.

Thank you again apo!

apo
171 post(s)
#17-Nov-20 08:07

just an example

-- $manifold$

TABLE CALL TableCacheIndexGeoms((

SELECT [Ojects Drawing].*, 

GeomMakePoint(GeomCenter([Ojects Drawing].[Geom],0)) as GeomCenter

FROM [Ojects Drawing]

INNER JOIN [Selected Polygons]

ON Geomtouches([Selected Polygons].[Geom],GeomMakePoint(GeomCenter([Ojects Drawing].[Geom],0)),0)

), TRUE);

Attachments:
test_centroid.mxb

RAR111 post(s)
#17-Nov-20 12:23

Apo,

That is beautiful!

Thank you so much for your help!!!

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