Subscribe to this thread
Home - General / All posts - Topology Overlay Identity with Overlapping Areas
BCowper


1,275 post(s)
#29-Sep-11 17:07

I've been scratching my head on this one: I have a Line Drawing representing a pipeline and a Drawing that contains Areas some of which overlap, the Areas represent various species. I want to find a way of replicating the Topology Overlay Identity function so that I end up with Line features that indicate the extent of each species along the pipeline.

My problem with the Identity command is where the Areas overlap I will only get data transferred from one of the Areas. Ideally I would want a Line created for each species extent, creating duplicate Lines where the species Areas overlap.

tjhb
10,094 post(s)
#29-Sep-11 21:36

Would a query do Brian?

OPTIONS COORDSYS("Lines" AS COMPONENT);

SELECT

    ClipIntersect([L].[Geom (I)][A].[Geom (I)]AS [Section],

    [A].[Species]

FROM

    [Lines] AS [L]

    INNER JOIN

    [Areas] AS [A]

    ON Touches([L].[Geom (I)][A].[Geom (I)]

    AND ClipIntersect([L].[Geom (I)][A].[Geom (I)]IS NOT NULL

;

BCowper


1,275 post(s)
#29-Sep-11 22:14

You're a life saver yet again Tim, thanks I must be at least up to a keg of beer owing!

I have a species ranking column too and can plug that in to the query and use an Order By at the end using the ranking column to control the display order of the lines. Fantastic.

dale

630 post(s)
#02-Sep-16 06:13

I’m working on a similar problem, in this case areas to areas, some of which overlap.

I wish to determine how many hectares of town planning overlays type by type lie within a park. I have two drawings parks as area objects, and planning overlays as area objects.

Planning overlay areas can overly other areas, thus a “land subject to flooding (LSF)” can can overlay a “wildfire management zone” (WMZ)

Topology Overlay identity will return only the top most area where overlay areas overlap.

Arc 10.something respects the overlaps using Arc intersect, returning discrete planning overlay objects where they lie within parks, and attributed with park attribute data, thus "park name, zone name"

My questions:

Can the identity function in Manifold return overlapping area objects, or can it only handle non overlapping objects (lines/areas)?

Is modifying the query above to areas/areas the most simple approach to the problem?

tjhb
10,094 post(s)
#02-Sep-16 07:01

I think Topology Overlay inherently resolves overlaps. This is something Dan has discussed before (online and offline).

I seem to remember I have code to do it without resolving overlaps (respecting them)--and that it wasn't very easy! (nor very fast). I'll see if I can find it.

[Got it.]

Dale, see this thread from 2014. Funnily enough, the question was also about fire management areas in Australia!

The query does preserve overlaps.

There may be more work to do regarding execution speed--I didn't follow that up. Test data would help with that (if necessary).

tjhb
10,094 post(s)
#02-Sep-16 07:23

[Just bumping this for Dale, in case he didn't notice the edit.]

dale

630 post(s)
#02-Sep-16 09:38

Got it, thanks Tim.

I'll post a map file with a subset of the data I'm working on, showing the result of the Topo overlay. I'd better check what the manual has to say about Topology overlay/identity, regarding overlaps. (crosses fingers that Dimitri might mistake this for a Radian thread and post an elegant solution...)

tjhb
10,094 post(s)
#02-Sep-16 10:20

Do check, but I've just tested, and Topology Overlay it does resolve overlaps (in both drawings).

The query doesn't resolve overlaps inside either drawing. (It does between the Data and Overlay drawings of course, that's how dicing works.)

So in the query, for each area in Data: (a) the part lying within each area in Overlay is returned separately; (b) and the part lying within no area in Overlay is also returned.

tjhb
10,094 post(s)
#02-Sep-16 11:21

I've tidied the query up a bit to make it easier to reuse.

Add lists of Data and Overlay attributes where indicated (see placeholders a, b, c and x, y, z).

OPTIONS 

    CoordSys("Data" AS COMPONENT), 

    Precision("Data" AS COMPONENT)

;

SELECT

    [ID]

    -- Data attributes

--    [a], [b], [c], ...

    -- Overlay attributes

--    [x], [y], [z], ...

--    [op],

    -- For checking: for each ID

    -- there may be many parts of type "intersection",

    -- but only one for type "exclusion"

    [Part]

FROM

    (SELECT

        [ID]

        -- Data attributes

--        [a], [b], [c], ...

        -- Overlay attributes

--        [x], [y], [z], ...

        [op],

        CASE [op]

            WHEN "intersection" THEN

                CASE

                    WHEN [Mask A] IS NULL THEN NULL

                        -- no intersection between this data area and any overlay mask

                    ELSE ClipIntersect([ID][Mask A]-- with epsilon

                END

            WHEN "exclusion" THEN

                CASE

                    WHEN MAX([Mask B]IS NULL THEN Geom([ID])

                        -- no intersection between this data area and any overlay mask

                    ELSE ClipSubtract([ID], UnionAll([Mask B])) -- with epsilon

                        -- NULL if this data area is completely covered by overlay masks

                END

        END AS [Part]

    FROM

        (SELECT

            [D].[ID]--[D].[Geom (I)]),

            -- Data attributes a, b, c,...

--            [D].[a], [D].[b], [D].[c], ...

            [P].[op],

            -- Overlay attributes x, y, z,...

            -- filtered by operation type

            -- (included for intersection,

            -- for exclusion replaced by NULL, to be ignored in grouping)

--            IIf([P].[op] = "intersection", [O].[x], NULL) AS [x],

--            IIf([P].[op] = "intersection", [O].[y], NULL) AS [y],

--            IIf([P].[op] = "intersection", [O].[z], NULL) AS [z],

--            ...

            -- First reference to this overlay mask, for the intersection operation

            -- Used individually, for ClipIntersect

            -- For exclusion substitute NULL (ignored in grouping)

            CASE [P].[op] 

                WHEN "intersection" THEN [O].[ID] --[Geom (I)]

                WHEN "exclusion" THEN NULL

            END AS [Mask A],

            -- Second reference to this overlay mask, for the exclusion operation

            -- Used after grouping, for ClipSubtract

            -- For intersection substitute NULL (ignored in grouping)

            CASE [P].[op] 

                WHEN "exclusion" THEN [O].[ID] --[Geom (I)]

                WHEN "intersection" THEN NULL

            END AS [Mask B]

        FROM

            [Data] AS [D]

            LEFT JOIN

            [Overlay] AS [O]

            ON Touches([D].[ID][O].[ID]-- with epsilon

            AND NOT Adjacent([D].[ID][O].[ID]-- with epsilon 

            CROSS JOIN

            (VALUES ("intersection"), ("exclusion"NAMES ([op])

            ) AS [P]

        )

    GROUP BY

        [ID]

        -- Data attributes

--        [a], [b], [c], ...

        [op]

        -- Overlay attributes

--        [x], [y], [z], ...

        [Mask A]

        -- Group by Mask A to give a separate row for each intersection

        -- Not grouping by Mask B because we combine these copies of the masks for exclusion

    ) AS [T]

WHERE [Part] IS NOT NULL

;

Attachments:
Identity template.txt

dale

630 post(s)
#07-Sep-16 01:55

Thanks Tim,

I've attached a map file with an example of both desired output, output from topological overlay/identity, plus your query linked to a drawing.

The query and linked drawing returns the planning overlapped zones with the overlaps respected, not resolved.

This suggests that the topological overlay tool may be improved by offering a choice to either respect or resolve overlaps, rather than resolve alone. Arc Intersect offers respecting overlaps.

Attachments:
Park_overlay_query.map

tjhb
10,094 post(s)
#13-Sep-16 01:35

Dale,

Do you need anything else done, e.g. fully adapting the query for your sample data? No trouble to do that.

Tim

dale

630 post(s)
#13-Sep-16 14:12

Err, yes!

I've been using your query to see if I could get the output fields I wanted, in effect trying to learn just what the query is doing on a step by step basis. The desired output drawing and table in the file above is the output I'm after.

The aim is to show zone type, count and area where the zones intersect with park.

My rough idea of a workflow: Park cut to zones and attributed park name, zone name, with zone overlaps respected. Thus two overlapping (different) zones within a park would result in two overlapping areas, cut at park boundaries..

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