{"id":422,"date":"2019-08-10T00:20:25","date_gmt":"2019-08-09T15:20:25","guid":{"rendered":"https:\/\/ujicya.jp\/wordpress\/?p=422"},"modified":"2019-09-24T14:02:46","modified_gmt":"2019-09-24T05:02:46","slug":"workflow-of-python-geospatial-development","status":"publish","type":"post","link":"https:\/\/ujicya.jp\/blog-mapping\/workflow-of-python-geospatial-development\/","title":{"rendered":"Python3\u00d7\u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u3000\u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u6d41\u308c"},"content":{"rendered":"\n<p>\u300cPython\u3067\u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0 \u300d\u30b7\u30ea\u30fc\u30ba\u7b2c\uff12\u5f3e\u3067\u3059\uff0e<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\uff0c \u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u3092Python\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u3088\u3063\u3066\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u7c21\u5358\u306a\u6d41\u308c\u3092\u89e3\u8aac\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<h2>\u5168\u4f53\u306e\u6d41\u308c<\/h2>\n\n\n\n<p>\u5730\u56f3\u30c7\u30fc\u30bf\u3092\u6271\u3046\u969b\u306b\u306f\uff0c<br>\u307e\u305a\u809d\u5fc3\u306e \u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u3092\u5165\u624b\u3057\uff0c\u6b21\u306b \u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7528\u3044\u3066\u8aad\u307f\u8fbc\u307f\uff0c\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3059\u308b\uff0c\u3068\u3044\u3046\u6d41\u308c\u304c\u4e00\u822c\u7684\u304b\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u3082\u3061\u308d\u3093\u4f8b\u5916\u3082\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u304c\uff0c\u3068\u308a\u3042\u3048\u305a\u3053\u306e\u5f62\u5f0f\u3067\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n\n\n\n<h2> \u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u306e\u5165\u624b<\/h2>\n\n\n\n<p>\u4e00\u304b\u3089\u5de8\u5927\u306a \u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3059\u308b\u6a5f\u4f1a\u306f\uff0c\u307e\u305a\u7121\u3044\u3068\u8a00\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046\uff0e<\/p>\n\n\n\n<p>\u307b\u3068\u3093\u3069\u306e\u5834\u5408\uff0c\u56fd\u3084\u81ea\u6cbb\u4f53\uff0c\u56e3\u4f53\u306a\u3069\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u3082\u306e\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u4e3b\u306a\u5730\u56f3\u30c7\u30fc\u30bf\u5165\u624b\u5143Web\u30b5\u30a4\u30c8\u3092\u4e0b\u306b\u63b2\u8f09\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-togineer-blog\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/ujicya.jp\/wordpress\/mapdata-website\/\n<\/div><\/figure>\n\n\n\n<p>\u591a\u304f\u306eWeb\u30b5\u30a4\u30c8\u3067\u306f\uff0c\u30d9\u30af\u30bf\u30c7\u30fc\u30bf\u306f\u300c\u30b7\u30a7\u30fc\u30d7\u30d5\u30a1\u30a4\u30eb\uff08.shp\uff09\u300d\uff0c\u30e9\u30b9\u30bf\u30c7\u30fc\u30bf\u306f\u300cGeotiff\u300d\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n\n\n\n<h2> \u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f<\/h2>\n\n\n\n<p>\u3053\u3053\u3067\uff0c\u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306b\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8aac\u660e\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<h3>GDAL\/OGR<\/h3>\n\n\n\n<p>GDAL\/OGR\uff08Geospatial Data Abstraction Library\uff09\u3068\u306f\uff0c\u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u306e\u5909\u63db\u6a5f\u80fd\u3084\u305d\u306e\u4ed6\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u542b\u3080\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\uff0e<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">\u30b5\u30a4\u30c8<\/span><\/p>\n\n\n\n<ul><li><a href=\"https:\/\/gdal.org\/\">GDAL<\/a><\/li><li><a href=\"http:\/\/adhoc.osgeo.osuosl.org\/livedvd\/docs\/ja\/overview\/gdal_overview.html\">OSGeoLive GDAL\/OGR<\/a><\/li><\/ul>\n\n\n\n<p>GDAL\/OGR\u3092\u4f7f\u3046\u3053\u3068\u3067\uff0c\u591a\u6570\u306e\u5730\u56f3\u30c7\u30fc\u30bf\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\uff08\u30d9\u30af\u30bf\u30fb\u30e9\u30b9\u30bf\uff09\u3092\u7d71\u4e00\u7684\u306a\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u64cd\u4f5c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u306f\uff0c\u4e0a\u8a18\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u8f09\u3063\u3066\u3044\u307e\u3059\u304c\uff0c\u30d9\u30af\u30bf\u306720\u7a2e\u985e\u4ee5\u4e0a\uff0c\u30e9\u30b9\u30bf\u306750\u7a2e\u985e\u4ee5\u4e0a\u3067\u3059\uff0e<\/p>\n\n\n\n<p>\u307e\u305f\uff0c\u6570\u591a\u304f\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u304b\u3089\u306e\u5229\u7528\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\uff0e<br>\u79c1\u306e\u77e5\u308b\u9650\u308a\u3067\u306f\uff0cC\uff0cC++\uff0cPython\uff0c\uff32\uff0cJava\uff0cC#\uff0cRuby\uff0cVB6\uff0cPerl\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u3068\u3053\u308d\u3067\uff0cGDAL\/OGR\u3068\u66f8\u304d\u307e\u3059\u304c\uff0c\u672c\u6765\uff0cGDAL\u3068OGR\u306f\u5225\u7269\u3067\u3059\uff0e<\/p>\n\n\n\n<p>\u533a\u5225\u3068\u3057\u3066\u306f\uff0c<span style=\"text-decoration: underline;\">GDAL\u306f\u30e9\u30b9\u30bf\u3092\u6271\u3044\uff0cOGR\u306f\u30d9\u30af\u30bf\u3092\u6271\u3044\u307e\u3059\uff0e<\/span><\/p>\n\n\n\n<p>\u3057\u304b\u3057\uff0c\u73fe\u5728\u306f\u300cGDAL\u300d\u3068\u3044\u3046\u540d\u79f0\u306e\u5358\u4e00\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u4e21\u8005\u304c\u7d71\u5408\u3055\u308c\u3066\u3044\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u305d\u3053\u3067\uff0c\u308f\u304b\u308a\u3084\u3059\u3055\u306e\u305f\u3081\uff0c\u672c\u30d6\u30ed\u30b0\u3067\u306f\u7d71\u5408\u3055\u308c\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u300cGDAL\/OGR\u300d\u3068\u547c\u3073\uff0c\u5358\u306a\u308bGDAL\u3092\u300cGDAL\u300d\u3068\u547c\u3076\u3053\u3068\u306b\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<h3>GDAL\u306e\u30e9\u30b9\u30bf\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb<\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" src=\"https:\/\/ujicya.jp\/wordpress\/wp-content\/uploads\/2019\/08\/GDAL_DataModel-1024x594.jpg\" alt=\"GDAL\u306b\u304a\u3051\u308b\u30e9\u30b9\u30bf\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\" class=\"wp-image-643\" width=\"410\" height=\"237\"\/><figcaption><strong>GDAL\u306b\u304a\u3051\u308b\u30e9\u30b9\u30bf\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb<\/strong><br>\u300ePython Geospatial Development, second edition\u300f\u3092\u53c2\u8003\u306b\u4f5c\u6210<\/figcaption><\/figure><\/div>\n\n\n\n<p>GDAL\u306f\uff0c\u8aad\u307f\u8fbc\u3093\u3060\u30e9\u30b9\u30bf\u30c7\u30fc\u30bf\u3092\u3053\u306e\u56f3\u306e\u3088\u3046\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08Dataset\uff09\u306b\u5909\u63db\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306b\uff0cPython3\uff08\u203b\uff09\u3067\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u306e\u4f8b\u3092\u793a\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-python\"><code class=\"language-python\">from osgeo import gdal\n\n# \u300cgdal.Open\u300d\u3067geotiff\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\uff0e\ndataset = gdal.Open(\"xxx.tif\")\nprint(type(dataset))<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;class 'osgeo.gdal.Dataset'> <\/code><\/pre>\n\n\n\n<p>\u203bPython3\u306e\u74b0\u5883\u6761\u4ef6<\/p>\n\n\n\n<ul><li>Anaconda\uff08Python3.7.3\uff09<\/li><li>GDAL\/OGR\u306einstall\uff1a\u300cconda install gdal\u300d<\/li><li>GDAL\/OGR\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u540d\uff1agdal 2.3.3<\/li><\/ul>\n\n\n\n<h3>OGR\u306e\u30d9\u30af\u30bf\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb<\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" src=\"https:\/\/ujicya.jp\/wordpress\/wp-content\/uploads\/2019\/08\/OGR_DataModel-1024x883.jpg\" alt=\"OGR\u306b\u304a\u3051\u308b\u30d9\u30af\u30bf\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\" class=\"wp-image-644\" width=\"339\" height=\"292\"\/><figcaption><strong> OGR\u306b\u304a\u3051\u308b\u30d9\u30af\u30bf\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb<\/strong><br>\u300ePython Geospatial Development, second edition\u300f\u3092\u53c2\u8003\u306b\u4f5c\u6210 <\/figcaption><\/figure><\/div>\n\n\n\n<p>OGR\u306f\uff0c\u8aad\u307f\u8fbc\u3093\u3060\u30d9\u30af\u30bf\u30c7\u30fc\u30bf\u3092\u3053\u306e\u56f3\u306e\u3088\u3046\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08Data Source\uff09\u306b\u5909\u63db\u3057\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u8aad\u307f\u8fbc\u307f\u65b9\u306e\u4f8b\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\uff0e<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-python\"><code class=\"language-python\">from osgeo import ogr\n\n#\u300cogr.Open\u300d\u3067\u30b7\u30a7\u30fc\u30d7\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u3053\u307f\u307e\u3059\uff0e\ndatasource = ogr.Open(\"xxx.shp\")\nprint(type(datasource))<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;class 'osgeo.ogr.DataSource'> <\/code><\/pre>\n\n\n\n<h2>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u51e6\u7406<\/h2>\n\n\n\n<p>\u8aad\u307f\u8fbc\u3093\u3060\u5f8c\u306f\uff0c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3084\u30e1\u30bd\u30c3\u30c9\u3092\u7528\u3044\u3066\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3066\u3044\u304d\u307e\u3059\uff0e<\/p>\n\n\n\n<p>\u5177\u4f53\u7684\u306a\u51e6\u7406\u5185\u5bb9\u306f\uff0c\u4ee5\u964d\u306e\u56de\u3067\u3054\u7d39\u4ecb\u3067\u304d\u305f\u3089\u3068\u601d\u3063\u3066\u3044\u307e\u3059\uff0e<\/p>\n\n\n\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n\n\n\n<div class=\"wp-block-columns has-2-columns\">\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-togineer-blog\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/ujicya.jp\/wordpress\/python-geospatial-programming-0\/\n<\/div><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-togineer-blog\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/ujicya.jp\/wordpress\/python-geospatial-programming-1\/\n<\/div><\/figure>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u300cPython\u3067\u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0 \u300d\u30b7\u30ea\u30fc\u30ba\u7b2c\uff12\u5f3e\u3067\u3059\uff0e \u4eca\u56de\u306f\uff0c \u5730\u7406\u7a7a\u9593\u30c7\u30fc\u30bf\u3092Python\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u3088\u3063\u3066\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u7c21\u5358\u306a\u6d41\u308c\u3092\u89e3\u8aac\u3057\u307e\u3059\uff0e \u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\uff0e \u5168\u4f53\u306e\u6d41\u308c \u5730\u56f3\u30c7\u30fc\u30bf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[13,39,16,19],"_links":{"self":[{"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/posts\/422"}],"collection":[{"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/comments?post=422"}],"version-history":[{"count":0,"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/posts\/422\/revisions"}],"wp:attachment":[{"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/media?parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/categories?post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ujicya.jp\/blog-mapping\/wp-json\/wp\/v2\/tags?post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}