logo

Crowdly

Browser

Add to Chrome

import geopandas as gpd from shapely.geometry import box def check_topology(...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

import geopandas as gpd

from shapely.geometry import box

def check_topology(geodataframe):

    overlaps = geodataframe.overlay(geodataframe, how='intersection')

    

    overlaps = overlaps[overlaps.index_1 != overlaps.index_2]

    

    if len(overlaps) > 0:

        return False, "Виявлено перекриття полігонів"

    

    union = geodataframe.unary_union

    boundary = geodataframe.total_bounds

    bbox = box(*boundary)

    

    if not union.equals(bbox):

        return False, "Виявлено проміжки між полігонами"

    

    return True, "Топологічна узгодженість підтверджена"

Яку проблему топологічної узгодженості НЕ зможе виявити даний код?

✅
❌
❌
❌
More questions like this

Want instant access to all verified answers on moodle.chnu.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome