如何读取WKT格式文件

我们找到了这些有用的包:

Python - shapely.loads()

R - rgeos

如何读取geojson格式文件

我们找到了这些有用的包:

Python -  jsongeojsonshapely (使用json,然后将其转换成shapely的复杂多边形)

R - geojsonio

如何将几何投影到像素坐标

在我们提供的数据集中,我们创建了一组地理坐标,它们在x = [0,1]和y = [-1.0]的范围内。 这些坐标被变换,使得我们模糊卫星图像被拍摄的位置。 图像来自地球上相同的区域。

为了利用这些图像,我们提供每个图像的网格坐标,以便您知道如何缩放它们并将它们与像素的图像对齐。 在grid_sizes.csv中,给出每个imageId的Xmax和Ymin值。

对于每个图像,您应该能够从图像栅格获取宽度(W)和高度(H)。 对于3391 x 3349 x 3的3波段图像,W为3349,H为3391.然后可以按如下方式缩放数据:

如何将的你结果转为多边形

最好使用cascaded_union()将多边形列表展开为不重叠的多边形。

缩放结果回到原来的坐标:

然后就很容易使用shapely来输出多边形到wtk格式文件:mulitpoly.wkt

如何在Python中打开GeoTiff文件

GDAL功能强大但有点难安装。如果你想去用它读取栅格文件,tifffile是一个轻量的打开GeoTiff文件的包。

例如,下面的代码你能读取16波段的图像:

 import gdal
from gdalconst import * img_filename_16bandA = 'data/16band/6100_1_3_A.tif'
img_filename_16bandM = 'data/16band/6100_1_3_M.tif'
img_filename_16bandP = 'data/16band/6100_1_3_P.tif' datasetA = gdal.Open(img_filename_16bandA, GA_ReadOnly )
datasetM = gdal.Open(img_filename_16bandM, GA_ReadOnly )
datasetP = gdal.Open(img_filename_16bandP, GA_ReadOnly ) print 'Size is ',datasetA.RasterXSize,'x',datasetA.RasterYSize, \
'x',datasetA.RasterCount
print 'Size is ',datasetM.RasterXSize,'x',datasetM.RasterYSize, \
'x',datasetM.RasterCount
print 'Size is ',datasetP.RasterXSize,'x',datasetP.RasterYSize, \
'x',datasetP.RasterCount

输出:

Size is 136 x 134 x 8
Size is 848 x 837 x 8
Size is 3391 x 3348 x 1

 或者你能属于tiffffile:

 import tifffile as tiff
P = tiff.imread(img_filename_16bandP)
tiff.imshow(P)

打如何在R中打开Geo Tiff文件

感谢社区成员smota的提出:

 library(raster)
raster_6044_4_4 <- raster("./data/three_band/6040_4_4.tif")
plot(raster_6044_4_4)
library(rgdal)
gdal_6044_4_4 <- readGDAL(paste0("./data/three_band/", '6040_4_4', ".tif"))
plot(gdal_6044_4_4)

处理图像:

 devtools::install_github("ropensci/geojsonio")
library("geojsonio")
install.packages("rgdal", type = "source")
install.packages("rgeos", type = "source")
library("rgdal")
library("rgeos")
library(ggplot2)
grid_6010_4_4 <-geojson_read("./data/train_geojson/train_geojson/6010_4_4/Grid_6010.geojson", method = local, what= 'sp')
plot(grid_6010_4_4)
ggplot(grid_6010_4_4, aes(long, lat, group = group)) + geom_polygon()

获得Docker?

这个dockerfile应该能对Python使用者有帮助。

                                                                                   ---本文译自:https://www.kaggle.com/c/dstl-satellite-imagery-feature-detection/details/data-processing-tutorial

Dstl Satellite Imagery Feature Detection-Data Processing Tutorial的更多相关文章

  1. pytorch例子学习-DATA LOADING AND PROCESSING TUTORIAL

    参考:https://pytorch.org/tutorials/beginner/data_loading_tutorial.html DATA LOADING AND PROCESSING TUT ...

  2. Image Processing and Analysis_8_Edge Detection:Design of steerable filters for feature detection using canny-like criteria ——2004

    此主要讨论图像处理与分析.虽然计算机视觉部分的有些内容比如特 征提取等也可以归结到图像分析中来,但鉴于它们与计算机视觉的紧密联系,以 及它们的出处,没有把它们纳入到图像处理与分析中来.同样,这里面也有 ...

  3. Image Processing and Analysis_21_Scale Space:Feature Detection with Automatic Scale Selection——1998

    此主要讨论图像处理与分析.虽然计算机视觉部分的有些内容比如特 征提取等也可以归结到图像分析中来,但鉴于它们与计算机视觉的紧密联系,以 及它们的出处,没有把它们纳入到图像处理与分析中来.同样,这里面也有 ...

  4. Image Processing and Computer Vision_Review:A survey of recent advances in visual feature detection(Author's Accepted Manuscript)——2014.08

    翻译 一项关于视觉特征检测的最新进展概述(作者已被接受的手稿) 和A survey of recent advances in visual feature detection——2014.08内容相 ...

  5. Linux command line exercises for NGS data processing

    by Umer Zeeshan Ijaz The purpose of this tutorial is to introduce students to the frequently used to ...

  6. Chrysler -- CCD (Chrysler Collision Detection) Data Bus

    http://articles.mopar1973man.com/general-cummins/34-engine-system/81-ccd-data-bus CCD (Chrysler Coll ...

  7. [翻译]MapReduce: Simplified Data Processing on Large Clusters

    MapReduce: Simplified Data Processing on Large Clusters MapReduce:面向大型集群的简化数据处理 摘要 MapReduce既是一种编程模型 ...

  8. Spring Data JPA Tutorial Part Nine: Conclusions(未翻译)

    This is the ninth and the last part of my Spring Data JPA tutorial. Now it is time to take a look of ...

  9. SQL Server Reporting Services 自定义数据处理扩展DPE(Data Processing Extension)

    最近在做SSRS项目时,遇到这么一个情形:该项目有多个数据库,每个数据库都在不同的服务器,但每个数据库所拥有的数据库对象(table/view/SPs/functions)都是一模一样的,后来结合网络 ...

随机推荐

  1. 浅谈.NET,C#三层架构

     三层架构 常见架构: 三层(经典) MVC MVVM MVP   开发中常见的23种设计模式: 创建型模式,共五种:工厂方法模式.抽象工厂模式.单例模式.建造者模式.原型模式. 结构型模式,共七种: ...

  2. Bug列表

    1.Space is not allowed after parameter prefix ': 这个问题主要原因是Hibernate不能识别SQL语句中的":="导致的网上有其他 ...

  3. 【MySQL】 清除等待连接

    由于MySQL突然新增了很多连接,超出了my.cnf所设置的最大连接数,MySQL服务无法访问,这里通过Shell脚本来删掉Sleep连接 方式1 清除连接进程 #!/bin/bash #------ ...

  4. Flink 1.3.2 Standalone模式安装

    一.依赖文件安装 1.1 JDK 参见博文:http://www.cnblogs.com/liugh/p/6623530.html 二.文件准备 2.1 文件名称 flink-1.3.2-bin-ha ...

  5. emacs命令记录

    C-代表按住Ctrl键 M-代表按住Alt键,也可以用按一下ESC放开代替   最先要记住的 M-x <cmd>      输入指令执行,在输入时用Tab可以自动补全或列出项目 C-g   ...

  6. tensorflow笔记(五)之MNIST手写识别系列二

    tensorflow笔记(五)之MNIST手写识别系列二 版权声明:本文为博主原创文章,转载请指明转载地址 http://www.cnblogs.com/fydeblog/p/7455233.html ...

  7. 新博客在SEO方面需要注意哪几点?

    无论是什么程序的博客,都应该注意这重要的几点! 第一点:网站目标明确进入主题,有些人对于SEO不是特别熟悉,或者说没有接触过.当你做好一个网站,不管网站内容是什么,首先你都得了解最基本的SEO,比如网 ...

  8. vue.js拓展篇(8):测试开发与调试

    内容 第15章:测试开发与调试 任何实际项目的开发,除了功能性代码的完成,规范的开发流程和严谨的测试都是不可或缺的.合理使用工具将事半功倍. 1.ESLint ESLint是Lint语法检查工具,避免 ...

  9. vue.js基础知识篇(1):简介、数据绑定

    目录第一章:vue.js是什么? 第二章:数据绑定第三章:指令第四章:计算属性第五章:表单控件绑定代码链接: http://pan.baidu.com/s/1qXCfzRI 密码: 5j79 第一章: ...

  10. python使用mongodb

    系统环境:Windows 10 ,python3.x 1.安装mongodb mongodb下载官网:https://www.mongodb.com/download-center?jmp=nav#c ...