<jupyter_start><jupyter_text>Spatial Data Relationships<jupyter_code>from shapely.geometry import Point
from shapely.geometry import LineString
from shapely.geometry import Polygon<jupyter_output><empty_output><jupyter_text>Interseccion<jupyter_code>l_1 = LineString( ( (10,5), (10,15) ) )
l_2 = LineString( ( (5,8), (12, 9) ) )
l_3 = LineString( ( (11, 15), (17, 8) ) )
l_1.intersects(l_2)
import matplotlib.pyplot as plt
plt.plot(l_1)
plt.show()
l_1.intersects(l_2)<jupyter_output><empty_output><jupyter_text>Contains/Within<jupyter_code>p_1 = Point(11, 7)
poly_1 = Polygon([(0, 0), (10, 0), (10, 10), (0, 10)])
poly_1.contains(p_1)
p_1.within(poly_1)<jupyter_output><empty_output><jupyter_text>Crosses<jupyter_code>poly_1.crosses(l_1)
poly_1.crosses(l_1)<jupyter_output><empty_output><jupyter_text>Touches<jupyter_code>poly_2 = Polygon([(0, 0), (0, 2), (2, 2), (2, 0) ])
line_2 = LineString([ (0, 1), (-1, 2) ] )
line_3 = LineString([ (2, 1), (1, 1) ] )
line_2.touches(poly_2)
line_3.within(poly_2)
line_2.within(poly_2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17568850902184235, 'fraction_numerical': 0.0731244064577398, 'mean_word_length': 8.410714285714286, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '520351', 'license': 'MIT', 'n_tokens_mistral': 525, 'n_tokens_neox': 484, 'n_words': 73, 'path': 'notebooks/SpatialDataRelationships.ipynb', 'repo_name': 'minsait-geospatial/geo-binder', 'size': '1053'}