{"id":1594,"date":"2012-01-25T02:25:28","date_gmt":"2012-01-25T02:25:28","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=1594"},"modified":"2017-01-27T19:19:18","modified_gmt":"2017-01-27T10:19:18","slug":"postgis-%ea%b3%b5%ea%b0%84%eb%8d%b0%ec%9d%b4%ed%84%b0-%ed%85%8c%ec%9d%b4%eb%b8%94-%ec%83%9d%ec%84%b1%ec%97%90-%eb%8c%80%ed%95%9c-sql","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=1594","title":{"rendered":"[GIS] PostGIS, \uacf5\uac04\ub370\uc774\ud130 \ud14c\uc774\ube14 \uc0dd\uc131\uc5d0 \ub300\ud55c SQL"},"content":{"rendered":"<p>\uc9c4\ud589\ud558\uace0 \uc788\ub294 \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \uacf5\uac04 DBMS\ub85c PostGIS\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uacf5\uac04 \ud14c\uc774\ube14\uc744 \uc9c1\uc811 \ub9cc\ub4e4\uc5b4\uc5b4 \ud65c\uc6a9\ud574\uc57c\ud560 \ud544\uc694\uac00 \uc788\uc5b4 \ucc3e\uc740 \ub0b4\uc6a9\uc744 \uc815\ub9ac\ud574 \ubd05\ub2c8\ub2e4.<\/p>\n<p>\uace0\uc720\ud55c ID \uac12\uc73c\ub85c\uc368 fid\uc640 \uae30\ud0c0 \ud544\ub4dc\ub85c\uc368 name \uadf8\ub9ac\uace0 Geometry \uac12\uc5d0 \ub300\ud55c the_geom\uc774\ub77c\ub294 \uc774\ub984\uc758 \ud544\ub4dc\ub97c \uac00\uc9c0\ub294 \ud14c\uc774\ube14\uc744 \uc0dd\uc131\ud558\ub294 SQL \ubb38\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre>CREATE TABLE \"tst_table\"(\r\n    fid INTEGER PRIMARY KEY,\r\n    name VARCHAR(64),\r\n    the_geom geometry,\r\n\r\n    CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),\r\n\r\n    CONSTRAINT enforce_geotype_the_geom CHECK \r\n            (geometrytype(the_geom) = 'MULTIPOLYGON'::text \r\n        OR \r\n            the_geom IS NULL),\r\n\r\n    CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = (-1))\r\n);<\/pre>\n<p>1\ubc88 \uc904\uc5d0 \uc0dd\uc131\ud560 \ud14c\uc774\ube14 \uba85\uc73c\ub85c\uc368 tst_Table\ub85c \uc9c0\uc815\ud588\uc2b5\ub2c8\ub2e4. 2~4\ubc88 \uc904\uc774 \uc55e\uc11c \uc5b8\uae09\ud55c \ud544\ub4dc\ub4e4\uc774\uad6c\uc694. 6\ubc88 \uc904\uc740 Geometry\uc5d0 \ub300\ud55c \ud544\ub4dc\uc778 the_geom\uc758 \ucc28\uc6d0\uc774 2\ucc28\uc6d0, \uc989 X\uc640 Y\uc758 \uc30d\uc774\uc5b4\uc57c \ud55c\ub2e4\ub294 \uc81c\uc57d \uc870\uac74\uc785\ub2c8\ub2e4. \uadf8\ub9ac\uace0 8\ubc88 \uc904\uc758 \uc81c\uc57d \uc870\uac74\uc740 Geometry\uac00 MULTIPOLYGON \ud0c0\uc785\uc774\uba70 NULL \uc77c \uc218 \uc788\ub2e4\ub294 \uac83 \uc785\ub2c8\ub2e4. \uadf8\ub9ac\uace0 13\ubc88 \uc904\uc740 Geometry\uc758 Spatial Reference ID\uc5d0 \ub300\ud55c \uc81c\uc57d \uc870\uac74\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \uc544\ub798\ub294 \uc55e\uc11c \uc0dd\uc131\ud55c \uacf5\uac04 \ud14c\uc774\ube14\uc5d0 \ud558\ub098\uc758 \ub808\ucf54\ub3c4\ub97c \ucd94\uac00\ud558\ub294 SQL \ubb38\uc785\ub2c8\ub2e4.<\/p>\n<pre>INSERT INTO tst_Table \r\n (\r\n    fid, \r\n    name, \r\n    the_geom\r\n) \r\nVALUES \r\n (\r\n    0, \r\n    '\ud14c\uc2a4\ud2b8', \r\n    ST_GeomFromText('MULTIPOLYGON(((0 0,1 0,1 1,0 1,0 0)))', -1)\r\n); <\/pre>\n<p>\uc77c\ubc18\uc801\uc778 INSERT SQL \ubb38\uc785\ub2c8\ub2e4. \ub2e8\uc9c0 \uc8fc\ubaa9\ud574\uc57c\ud560 \uc904\uc740 11\ubc88\uc785\ub2c8\ub2e4. Geometry\uc5d0 \ub300\ud55c WKT \ud615\uc2dd\uc73c\ub85c \uc9c0\uc815\ud588\uc73c\uba70 \uacf5\uac04\ucc38\uc870\ub85c -1\uc744 \uc8fc\uc5c8\uc2b5\ub2c8\ub2e4. \uc774 \uac12\uc740 \uc55e\uc11c \uacf5\uac04 \ud14c\uc774\ube14\uc744 \uc0dd\uc131\ud560\ub54c \uc81c\uc57d \uc870\uac74\uacfc \uc77c\uce58\ud569\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc9c4\ud589\ud558\uace0 \uc788\ub294 \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 \uacf5\uac04 DBMS\ub85c PostGIS\ub97c \uc0ac\uc6a9\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uacf5\uac04 \ud14c\uc774\ube14\uc744 \uc9c1\uc811 \ub9cc\ub4e4\uc5b4\uc5b4 \ud65c\uc6a9\ud574\uc57c\ud560 \ud544\uc694\uac00 \uc788\uc5b4 \ucc3e\uc740 \ub0b4\uc6a9\uc744 \uc815\ub9ac\ud574 \ubd05\ub2c8\ub2e4. \uace0\uc720\ud55c ID \uac12\uc73c\ub85c\uc368 fid\uc640 \uae30\ud0c0 \ud544\ub4dc\ub85c\uc368 name \uadf8\ub9ac\uace0 Geometry \uac12\uc5d0 \ub300\ud55c the_geom\uc774\ub77c\ub294 \uc774\ub984\uc758 \ud544\ub4dc\ub97c \uac00\uc9c0\ub294 \ud14c\uc774\ube14\uc744 \uc0dd\uc131\ud558\ub294 SQL \ubb38\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. CREATE TABLE &#8220;tst_table&#8221;( fid INTEGER PRIMARY KEY, name VARCHAR(64), the_geom geometry, CONSTRAINT &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=1594\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[GIS] PostGIS, \uacf5\uac04\ub370\uc774\ud130 \ud14c\uc774\ube14 \uc0dd\uc131\uc5d0 \ub300\ud55c SQL&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[84],"class_list":["post-1594","post","type-post","status-publish","format-standard","hentry","category-gis-working-history","tag-postgis"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1594"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1594\/revisions"}],"predecessor-version":[{"id":3099,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1594\/revisions\/3099"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1594"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}