Exemplo n.º 1
0
def computeOPRA(l1, l2):
    touch = pattern('FF1F00102')
    im_pettern = l1.relate(l2)
    #print ("im_pattern....:",im_pettern)
    rangle, dangle = computeAngle(l1, l2)
    #print (dangle)
    if (touch.matches(im_pettern)):
        opraRelation = opraRelations(dangle)
        return opraRelation
    else:
        return "nonAdjacent"
Exemplo n.º 2
0
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 23 12:25:10 2018

@author: s_jan001

RCC11: Captures the Topological relations between
    Polygoanl features

"""

#from de9im import pattern
from qualifier.utils_i4l import pattern

DC_pattern = pattern('FF*FF****')
ECp_pettern = pattern('FF*F0****')
ECl_pettern = pattern('FF*F1****')
PO_pettern = pattern('T*T***T**')
NTPP_pattern = pattern('T*****FF*')
NTPP_inv_pattern = pattern('T*F**F***')
TPPp_pattern = pattern('2FF10FTTT')
TPPl_pattern = pattern('2FF11FTTT')
TPPp_inv_pattern = pattern('**F*0F***')
TPPl_inv_pattern = pattern('2FF11FTTT')
equals_pattern = pattern('T*F**FFF*')


def polygonal_topology(p1, p2):

    im_pettern = p1.relate(p2)
Captures the TOPOLOGICAL RELATIONS between 
    (
        LINE-LINE
        LINE-POLYGON
        LINE-POINT
        POLYGON-POINT
    )features 

@s_jan

"""

from qualifier.utils_i4l import pattern

disjoint = pattern('FF*FF****')
touch = pattern('FT*******' or 'F**T*****' or 'F***T****')
#touch = pattern('F01FF0212' or'FF1F00212' )
intersects = pattern('1010F0212')
within = pattern('1FF0FF212')
crosses = pattern('101FF0212')


def topolgical_relation_lineRegion(f1, f2):

    im_pattern = f1.relate(f2)
    #return im_pattern
    if (disjoint.matches(im_pattern)):
        return "disjoint"
    elif (touch.matches(im_pattern)):
        return "touches"
Exemplo n.º 4
0
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 23 12:25:10 2018

@author: s_jan001

RCC11: Captures the Topological relations between
    Polygoanl features

"""

#from de9im import pattern
from qualifier.utils_i4l import pattern

DC_pattern = pattern('FF*FF****')
EC_pattern = pattern('FF*F0****' or 'FF*F1****')
PO_pattern = pattern('T*T***T**')
NTPP_pattern = pattern('T*F**F***')
NTPP_inv_pattern = pattern('T*****FF*')
TPP_pattern = pattern('2FF10F212' or '2FF11F212')
TPP_inv_pattern = pattern('212F01FF2' or '212F11FF2')
EQ_pattern = pattern('T*F**FFF*')


def polygonal_topology(p1, p2):
    im_pattern = p1.relate(p2)

    # return im_pettern
    if (DC_pattern.matches(im_pattern)):
        return "dc"
    elif (EC_pattern.matches(im_pattern)):
Exemplo n.º 5
0
# -*- coding: utf-8 -*-
"""
Function captures:
        - topological relations between  streets
Created on Wed Jan 31 11:05:43 2018

@author: s_jan001
"""
from qualifier.utils_i4l import pattern

#disjoint = pattern('FF*FF****')
touch1 = pattern('FF1F00102')
touch2 = pattern('FF10F0102')
#contains = pattern('T*****FF*')
#within = pattern('T*F**F***')
#covers = pattern('T*****FF*' or '*T****FF*'or '***T**FF*'or '****T*FF*')
#covered_by = pattern('T*F**F***'or'*TF**F***'or '**FT*F***' or '**F*TF***')
#crosses = pattern('T*T******' or 'T*****T**' or '0********' )
#overlaps = pattern('T*T***T**' or '1*T***T**')


def compute_street_topology(st1, st2):
    im_pettern = st1.relate(st2)
    #return im_pettern
    if (touch1.matches(im_pettern)):
        return "connected"
    if (touch2.matches(im_pettern)):
        return "connected"
    else:
        return "disconnected"