{"id":71,"date":"2019-04-04T20:43:55","date_gmt":"2019-04-04T20:43:55","guid":{"rendered":"http:\/\/www.sqlgeometry.com\/?p=71"},"modified":"2019-04-04T20:43:55","modified_gmt":"2019-04-04T20:43:55","slug":"multiple-geometries-in-database-checking","status":"publish","type":"post","link":"https:\/\/www.sqlgeometry.com\/?p=71","title":{"rendered":"Multiple Geometries in database checking"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I loaded a Geodatabase with FME into Postgis recently. The data were polygons. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After loading I noticed it was taking a long time for the connection to be made, there were a lot of errors  which isn&#8217;t that unusual due to some of the data originally coming from CAD and doesn&#8217;t meet OGC requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That was not all though, there was something else going on with these data. I ran check geometry and ST_IsValid which told me that there were a whole lot of Ring Self-Intersection errors as expected.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Here was the interesting part:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Using this query:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT ST_GeometryType(geom) as geomtype <br> FROM public.\"MyTable\"<br> group by geomtype<br><br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I found that the database had stored 4 kinds of geometry:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8220;ST_CurvePolygon&#8221;<br>\n&#8220;ST_MultiPolygon&#8221;<br>\n&#8220;ST_MultiSurface&#8221;<br>\n&#8220;ST_Polygon&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This was surprising because the source was a File Geodatabase and should only have one type of geometry, which should store as ST_MultiPolygon. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am not sure if FME recreated these geometries or if the File Geodatabase itself was a geometry collection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Additionally, using the Database Manager tool in Qgis, the table would not load as there were too many errors, that I think were QGIS enforcing the single geometry datatype.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I loaded a Geodatabase with FME into Postgis recently. The data were polygons. After loading I noticed it was taking a long time for the connection to be made, there were a lot of errors which isn&#8217;t that unusual due to some of the data originally coming from CAD and doesn&#8217;t meet OGC requirements. That &hellip; <a href=\"https:\/\/www.sqlgeometry.com\/?p=71\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Multiple Geometries in database checking<\/span> <span class=\"meta-nav\">&rarr;<\/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":[1],"tags":[6,7,5],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-fgdb","tag-geometry","tag-postigs"],"_links":{"self":[{"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=71"}],"version-history":[{"count":1,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":72,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/posts\/71\/revisions\/72"}],"wp:attachment":[{"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}