Subscribe to this thread
Home - General / All posts - TileGeomOverlayCount

1,965 post(s)
#23-Jun-22 21:03


I'm trying to use TileGeomOverlayCount. This does not work. I attached a screenshot. What is wrong ? My 'Field' is INT8 type and filled with 1.

Also, why does it needs a field in the arguments ? The function is to count the number of objects overlaying a pixel, so what does a field have to do with it ?

Thank you for your explanations !



1,946 post(s)
#23-Jun-22 21:41

Jumped in too quickly. I will give it a go first.

From a quick look, I think this is one of those ones where you need to put them in a map and try and find an alternative transform which joins them and will reproject the image into the same space as the image and then edit and modify the auto generated query to use this function.

I would be very happy to be wrong on this as I have missed this sort of functionality from the transform pane.

Landsystems Ltd ... Know your land |


10,126 post(s)
#24-Jun-22 08:22

TileGeomOverlayCount returns a table (with an image where each pixel tells how many geoms it belongs to). That's why the call does not work as an expression for a field, as shown on the screen. If you want to count the number of pixels covered by each geom, use TileGeomCount -- or just use the Join dialog.

The field argument passed to TileGeomOverlayCount is used to ignore geoms with NULL values in that field. If you don't need to ignore any geoms, you can pass a blank string.


1,965 post(s)
#24-Jun-22 15:43

Same result Adam : "cannot parse expression". I tried with the following :


' '


" "


10,126 post(s)
#25-Jun-22 07:45

The screen shows that you are trying to populate a tile field. This won't work.

What are you trying to do? Can you post example MAP file and the expression you are trying (and for which component and which field, if this isn't what's on the screen in the first post)?


1,965 post(s)
#29-Jun-22 14:02

Hi Adam,

I want to obtain what the TileGeomOverlayCount can output :

Given an image, a drawing, and a numeric field name in the drawing, produce an image with the same parameters as the specified image, but with each pixel in that image filled with the count of objects in the drawing that overlay that pixel.

How do I obtain that from the GUI ? I know how to use a few Transform, but this is the first time I use an expression. So I watched the TileMaskRange video and then tried to use the TileGeomOverlayCount expression. Obviously, I am missing something. I cannot edit the query, because I cannot get the expression's window to output anything else than "cannot parse expression", even if the result is routed to a new table/image.

I can duplicate my raster table and then run the following query and then create a new image from the new table, but I want the whole SQL to avoid manual steps. I use the GUI to obtain the SQL, but in this case I have no success.

INSERT into [RasterTable 2] ( [X], [Y],





CALL TileGeomOverlayCount([Raster], [D], '')

Thank you.


10,126 post(s)
#29-Jun-22 16:24

The Expression template is for situations where you go record by record and run a simple expression in the context of each. TileGeomOverlayXxx functions operate on entire components, so while you can coerce them to work in the context of a record (each record will call TileGeomOverlayXxx to create its own image for some reason), usually that's just a bad fit.

If you just want to obtain TileGeomOverlayXxx output, then perhaps do: SELECT * INTO newtable FROM CALL TileGeomOverlayCount(...);

To be able to use that as an image, you will have to add an RTREE index on x-y-tile fields.


987 post(s)
#24-Jun-22 18:47

some questions :

-how we can know using the documentation the structure/Schema of the table return by TileGeomOverlayCount(....) <table> ?

-Does a SQL FUNCTION in manifold can return instead <value> 1x1or <table>nxn a list 1xn ( not table with one column but value with a separator beetweeen each value ? )


Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en


10,126 post(s)
#25-Jun-22 07:50

The documentation says 'produce an image'. That means that the output table will have three fields: X, Y and Tile.

Can a FUNCTION return 'not table with one column but one value with a separator between each value' - do you want to get a string instead of a table? If so, you can turn a table into a string using StringJoinTokens.


987 post(s)
#26-Jun-22 15:18

concact cell content of column

Join Example: Join Data from Many Records into One Record (

very powerfull to concat text of cell of same column using static text , one column name with a group !

SQL joins

in a join manifold code use t for left table - (t=target modify )and s for right table ( s= source use)

in a join manifold use for column name t0 t1 t2 .... for t table and s0 s1 s2 ....for right table

in a join manifold s1 s2 s3 are declare inside first SELECT , define a value inside JOIN ( second select of query inside JOIN) , affected using "=" like t0=s0 outside JOIN using a SQL Wrapper ( UPDATE (... ) SET tn=sn, .......; )


  --inside code 


  t0 = s0, t1 = s1, t2 = s2;



    t.[pub_id] AS tkey0,

    t.[all titles] AS t0, t.[average sales] AS t1, t.[last publication] AS t2,

    s.sjoinkey, s.s0, s.s1, s.s2

  FROM [publishers] AS t LEFT JOIN (


      [pub_id] AS sjoinkey,

      '{"Title":["' & StringJoinTokens([title_name]'", "') & '"]}' AS s0,

      Avg([sales]AS s1,

      Max([pubdate]AS s2

    FROM [titles]

    GROUP BY [pub_id]

  ) AS s ON t.[pub_id] = s.sjoinkey


  t0 = s0, t1 = s1, t2 = s2;

Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en


595 post(s)
#25-Jun-22 10:50

Try something like this in the command window.




 CALL TileGeomOverlayCount([image][Vectorlayer]'mfd_id')


987 post(s)
#26-Jun-22 14:33


i test TileGeomOverlayCount with a image that have no projection and return pixel along a line and use SQL INTO to create the table in manifold project pane .

1) the numeric <field> name in TileGeomOverlayCount is attach for drawing or image ? The documentation should be more explicit ( like tolerance for newbies) . uid contain character so is s not a numeric type ?

2) the image create inside ask37,8pixel /cm or 96 pixel/inch by default . in manifold there is only150 dpi / mm . So must use 1500 pixel/cm but does pixel mean dpi ? how to got from pixel to dpi in horizontal and vertical ?

3) i use INTO <table> to create the table and then create a image from this table . Manifold show column to use but don't match by default X to X and Y to Y ( match first column so for Y it is X) !!

3) i test in (0 lat, 0 long) using a image that has been drawn using .I really don't know which projection name i have to choose for " repair initial coordinate system " . I think the red icon is relative to projection ....? but i don't remind /find the post whare adaww give the answer !!

4) how can we select a image channel and not a image in the TileGeomCount() ?

5) what is the definition color of a null pixel ??



Book about Science , cosmological model , Interstellar travels

Boyle surface fr ,en


10,126 post(s)
#27-Jun-22 14:38

In 9, a component without a projection is assumed to be in pseudo-Mercator, WGS84.

1 - The numeric field referenced in TileGeomOverlayXxx is related to the drawing, not the image. The TileGeomOverlayXxx functions overlay the drawing onto the image and count some statistics based on the field values in the drawing objects.

2 - The DPI you see in Paint.NET applies to printing. It has nothing to deal with the projection if that's what you are asking.

3 - We will make the default choice of fields for the index better.

The second 3 - If you want to use 0 lat, 0 long, a natural projection choice seems to be Latitide / Longitude? The red icon appears whenever there is a message from the system about something. To see all messages, use View - Messages.

4 - You don't need to specify a channel for TileGeomCount. Unlike other TileGeomXxx (plain TileGeomXxx, not TileGeomOverlayXxx) functions, TileGeomCount does not use pixel values.

5 - A NULL pixel is never painted. If you try accessing its color (this is possible, eg, using a script), you will get an indeterminate value (that is, you might get a different value depending on which build you are using, etc, we make no guarantees as to what that value will be nor do we guarantee that all missing pixels use the same value).

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