Metadata-Version: 2.1
Name: raster-to-vector
Version: 0.0.1
Summary: convert GIS WMTS tile image to polygon and point using computer vision
Home-page: https://github.com/billju/raster_to_vector
Author: chuboy
Author-email: billju666@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rapidocr-onnxruntime
Requires-Dist: scikit-image
Requires-Dist: shapely

# 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
```python
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
```python
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
```python
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
```python
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)
```
