convert GIS WMTS tile image to polygon and point using computer vision
the function should cache images to speed up
from raster_to_vector import GetTile
get_tile = GetTile('https://my-wmts/{z}/{y}/{x}')expand tile from given point until bounded by area
from raster_to_vector import find_polygon_from_point
polygon = find_polygon_from_point(lng=120.67, lat=24.171, z=9, get_tile=get_tile)
print(polygon.wkt)recognize text based on rapidocr-onnxruntime engine
from raster_to_vector import find_text_in_area
found, queue = find_text_in_area(bound=polygon, z=9, get_tile=get_tile)
for point, text in found:
print(text, point.wkt)the algorithm will zoom in if the unknown area does not show text
from raster_to_vector import find_polygon_in_area
results = find_polygon_in_area(bound=polygon, z=9, maxz=10, get_tile=get_tile)
for polygon, text in results:
print(text, polygon.wkt)