将 .tif 转换为 geojson 而不使用 gdal

发布于 2025-01-17 01:14:44 字数 1069 浏览 4 评论 0原文

你好,我正在开发一个带有 geotiff 和 geojson 文件的 api。您是否有办法使用 geotiff.py 将图像文件 (.tif) 转换为 geojson 而不使用 GDAL?

预先感谢您的帮助。

我尝试创建这个 api(未完成),但我对非 GDAL 用途了解不多。 使用Python

@app.route("imgeo/upload-img.html")
def upload_file():
    if request.method == 'POST':
        geo_tiff = GeoTiff(tiff_archivo, as_crs=none, banda=1)
        zarr_array = geo_tiff.read()


def server_info():
    ubication = [
        {
            "type": "FeatureCollection",
            "features": [
                {
                    "type": "Feature",
                    "geometry": {
                        "type": "Polygon",
                        "coordinates": [-74.006393, 40.714172]  # for example
                    },
                    "properties": {
                        "name": "your ubication",
                        "description": "your ubication"
                    }
                }
            ]
        }
    ]
    return jsonify(ubication)


if __name__ == '__main__':
    # Start the application
    app.run(debug=True)

Hi, I am working on an api with geotiff and geojson files. Do you have a way to use geotiff.py to convert an image file (.tif) to geojson without using GDAL?

Thanks in advance for your help.

I tried to create this api (unfinished) but I don't have much knowledge of non-GDAL uses. use python

@app.route("imgeo/upload-img.html")
def upload_file():
    if request.method == 'POST':
        geo_tiff = GeoTiff(tiff_archivo, as_crs=none, banda=1)
        zarr_array = geo_tiff.read()


def server_info():
    ubication = [
        {
            "type": "FeatureCollection",
            "features": [
                {
                    "type": "Feature",
                    "geometry": {
                        "type": "Polygon",
                        "coordinates": [-74.006393, 40.714172]  # for example
                    },
                    "properties": {
                        "name": "your ubication",
                        "description": "your ubication"
                    }
                }
            ]
        }
    ]
    return jsonify(ubication)


if __name__ == '__main__':
    # Start the application
    app.run(debug=True)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文