Talk:DE-9IM

Latest comment: 5 days ago by 2A00:23C5:FE1C:3701:1051:7725:5B14:15EF in topic Grammar error

ST_Relate translator

edit

The PostGIS (and similar by OGC standards) offer the ST_relate function for the DE-9IM analysis,

 http://www.postgis.org/documentation/manual-2.0/ST_Relate.html

If the DE-9IM article is correct, the "or list" for each spatial predicate (binary operator) is

Equals     T*F**FFF*
Disjoint   FF*FF****
Intersects T********	*T*******	***T*****	****T****
Touches    FT*******	F**T*****	F***T****
Crosses    T*T******	T*****T**	0********
Within     T*F**F***
Contains   T*****FF*
Overlaps   T*T***T**	1*T***T**
Covers	   T*****FF*	*T****FF*	***T**FF*	****T*FF*
CoveredBy  T*F**F***	*TF**F***	**FT*F***	**F*TF*** 

Then, we can translate the result of the ST_Replate() function into a summarized and human-readable string,

 http://code.google.com/p/postgis-st-relate-summary/  

--Krauss (talk) 16:32, 24 May 2012 (UTC)Reply

Number of possible cases

edit

The number of possible results in a binary DE-9IM matrix is 512, but, all results that ends with '0' or '1' (EE) starts with '1' or '0', since EE is the opposite of II. This correlation reduces the number of possible results to 256. Calculating the probability of each predicate in a context of possible matrix results,

Equals     T*F**FFF  = 2^3 = 8 (3.1% of 256)       or  T*F**FFF*  = 2^4 = 16 (3.1% of 512)
Disjoint   FF*FF***  = 2^4 = 16 (6.3% of 256)
Intersects T*******	*T******	***T****	****T***
           P1 = = 2^7 = 128 (50% of 256), P2 = 50% - P2(P1), P3 = ...
           P1+P2+P3+P4 = 240 (93.8% of 256)
Touches    FT******	F**T****	F***T***   112 (43.8%)
Crosses    T*T*****	T*****T*	0*******   changes with combination of input dimensions
           2^6 = 64 (25% of 256)  and 0% for inputs with equal dimensions, except lines.
Within     T*F**F**  = 2^5 = 32 (12.5% of 256)
Contains   T*****FF  = 2^5 = 32 (12.5% of 256)
Overlaps   T*T***T*	1*T***T*   changes with combination of input dimensions
           for both cases, 2^5 = 32 (12.5% of 256) 
Covers	   T*****FF	*T****FF	***T**FF	****T*FF   60 (23.4%)
CoveredBy  T*F**F**	*TF**F**	**FT*F**	**F*TF**   60 (23.4%)

You can demonstrate by Combinatorics or by software. Example:

 CREATE FUNCTION bit8checkmask(bit(8),bit(8),bit(8)) RETURNS boolean AS
 $func$
   SELECT COALESCE(($1 & $2 = $3),false);
 $func$ LANGUAGE SQL IMMUTABLE;

 CREATE FUNCTION testmask(bit[],bit[]) RETURNS table (s integer,perc float) AS 
 $func$
  select s, round(100.0*s::float/256.0,1) as perc FROM (
  select sum((
        bit8checkmask(v::bit(8),$1[1],$2[1])
     OR bit8checkmask(v::bit(8),$1[2],$2[2])
     OR bit8checkmask(v::bit(8),$1[3],$2[3])
     OR bit8checkmask(v::bit(8),$1[4],$2[4])
  )::integer)::integer as s from (
     select generate_series(0,255) as v
  ) as t ) as t2;
 $func$ LANGUAGE SQL;
 -- -- EXAMPLE:  
 select * from testmask( -- Intersects
    --     'T*******', '*T******', '***T****', '****T***'
    array[b'10000000',b'01000000',b'00010000',b'00001000'],
    array[b'10000000',b'01000000',b'00010000',b'00001000']
 ); --  240 | 93.8%

For the {0,1,2,F} domain of the DE-9IM matrix, generating sequences from 0 to 3^8=6561, falls into same percentuals for masks of {T,*} domain, like Intersects, Equals, etc. and lower values for masks of {0,1,2,T,*} domain.

--Krauss (talk) 22:12, 9 September 2012 (UTC)Reply

Illustrations for predicates

edit

Work to do, add some of these illustrations...

File:SpRelations.png
File:MBRs relationships.png

--Krauss (talk) 15:54, 22 July 2012 (UTC)Reply

edit
edit

Hello fellow Wikipedians,

I have just modified 2 external links on DE-9IM. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{Sourcecheck}}).

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 5 June 2024).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 17:15, 4 December 2016 (UTC)Reply

Featured article nomination

edit

An incomplete nomination for a Wikipedia:Featured article candidates has been placed on this page.

In my view the article is a long way from where it would need to be to stand a chance. The main criticism which would be encountered is its accessibility. Even as someone with a mathematics background I've found to hard to follow.--Salix alba (talk): 14:13, 1 October 2018 (UTC)Reply

Hi @Salix alba: thanks to comment (!). Well, I agree that more didatic will be good, can you show "didactic articles" as example?
  1. External didactic article about DE-9IM, as this one or this other: what characteristics you see there that you not see here? We need more illustrations? .. Show any paragraph or section that is better there (tham here), so if it is easy I can try to change here in the correct direction.
  2. Internal featured didactic article with mathematical background: any article, to show as "reference model" to this kind of content.
Krauss (talk) 01:02, 17 November 2018 (UTC)Reply

Grammar error

edit

This part of a sentence does not make sense: "...it is useful the translation..." 2A00:23C5:FE1C:3701:1051:7725:5B14:15EF (talk) 20:07, 10 November 2024 (UTC)Reply