Skip to content

convert GIS WMTS tile image to polygon and point using computer vision

License

Notifications You must be signed in to change notification settings

billju/raster_to_vector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

raster_to_vector

convert GIS WMTS tile image to polygon and point using computer vision

define your tile image request function

the function should cache images to speed up

from raster_to_vector import GetTile

get_tile = GetTile('https://my-wmts/{z}/{y}/{x}')

(lng lat zoom) to polygon

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)

find all text (lng lat) in bounded area

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)

convert raster to vector in bounded area

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)

About

convert GIS WMTS tile image to polygon and point using computer vision

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages