wiki:BldgsGeomMisc

Microsoft Buildings dataset, snapshot feb19 valid/invalid in postgis

https://trac.osgeo.org/geos/attachment/ticket/987/msft-osm-CA_ex0sm.jpg

Invalid Polygons Datafile

https://trac.osgeo.org/geos/attachment/ticket/987/feb19_reason.csv

https://github.com/Microsoft/USBuildingFootprints

CA scan for invalid polygons:

select gid,st_isvalidreason(geom) from msft_ca_jul18 where not st_isvalid(geom);
--

   gid   |                   st_isvalidreason                    
---------+-------------------------------------------------------
 1932577 | Self-intersection[-117.879309006686 34.0939527158598]
 1083503 | Self-intersection[-118.151041032252 34.1665520003544]
   88756 | Ring Self-intersection[-119.076734 35.415403]
     ...   ....
 4354462 | Ring Self-intersection[-118.565846 34.078259]
 5310650 | Self-intersection[-117.885100999011 34.1099770731587]
 5244655 | Self-intersection[-116.344896 33.719872]
(43 rows)

Import to postgis

https://trac.osgeo.org/geos/attachment/ticket/987/do_import_msft.sql

https://trac.osgeo.org/geos/attachment/ticket/987/feb19_invalids.csv

Screenshots of Invalid Geometry

https://trac.osgeo.org/geos/attachment/ticket/987/OGC_fail-11.png

https://trac.osgeo.org/geos/attachment/ticket/987/invalid-8039880-46.png

https://trac.osgeo.org/geos/attachment/ticket/987/ex-28.png

=# SELECT postgis_full_version();
-----------------------------------
 POSTGIS="2.4.3" PGSQL="100" GEOS="3.6.2-CAPI-1.10.2 4d2925d6" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.3.3, released 2018/12/14" LIBXML="2.9.3" LIBJSON="0.11.99" LIBPROTOBUF="1.2.1"  RASTER

Sample CA Msft Buildings

{
  "type":"FeatureCollection",
  "features":
  [
    {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-118.254638,33.7843],[-118.254637,33.784231],[-118.254556,33.784232],[-118.254559,33.784339],[-118.254669,33.784338],[-118.254668,33.7843],[-118.254638,33.7843]]]},"properties":{}},
    {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-118.254414,33.784255],[-118.254232,33.784255],[-118.254232,33.784355],[-118.254414,33.784355],[-118.254414,33.784255]]]},"properties":{}},
    {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-118.253019,33.784683],[-118.253153,33.784683],[-118.253153,33.78458],[-118.253019,33.78458],[-118.253019,33.784683]]]},"properties":{}},
   ....
    {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-120.941051,39.935173],[-120.941051,39.935087],[-120.940869,39.935087],[-120.940869,39.935208],[-120.940976,39.935208],[-120.940976,39.935173],[-120.941051,39.935173]]]},"properties":{}},
    {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-120.947556,39.933526],[-120.947556,39.933446],[-120.947403,39.933446],[-120.947403,39.933526],[-120.947556,39.933526]]]},"properties":{}}
  ]
}


OSM California Polygon Invalids

https://trac.osgeo.org/geos/attachment/ticket/987/osm_invalids_sample56.png

 POLYGON((-116.282708 33.7294822,-116.2824887 33.7294855,-116.2824857 33.7293452,-116.2825882 33.7293437,-116.2825891 33.7293853,-116.2826191 33.7293849,-116.2826181 33.7293383,-116.2826411 33.729338,-116.28278 33.7293368,-116.2827417 33.7293365,-116.2827433 33.7294112,-116.2827065 33.7294117,-116.282708 33.7294822))
 POLYGON((-116.2755448 33.7440069,-116.2755475 33.7440693,-116.2756384 33.7440675,-116.275638 33.7441183,-116.2756344 33.7441182,-116.2756339 33.7441885,-116.2756398 33.7441878,-116.2756394 33.7442332,-116.2756635 33.7442333,-116.2756685 33.7443933,-116.2756401 33.7443938,-116.2756387 33.744241,-116.2756112 33.7442405,-116.2756065 33.7440682,-116.275631 33.7440069,-116.2755448 33.7440069))
 POLYGON((-121.1453045 38.6882284,-121.1453156 38.6882104,-121.14536 38.6882187,-121.1454524 38.6882175,-121.1454 38.6882705,-121.1454355 38.6883041,-121.1455233 38.688238,-121.1454907 38.6882188,-121.1455356 38.6882212,-121.1455448 38.6882404,-121.1455495 38.6882777,-121.145514 38.6882825,-121.1455125 38.6883101,-121.1455032 38.688333,-121.1454617 38.6883306,-121.1454185 38.688327,-121.1453892 38.688321,-121.1453846 38.6882885,-121.1453477 38.6882753,-121.1453369 38.6882488,-121.1452937 38.68822,-121.1453045 38.6882284))
 POLYGON((-121.1385616 38.6831932,-121.1385556 38.6831924,-121.1386403 38.6832044,-121.1386495 38.683214,-121.1387358 38.683226,-121.1387376 38.6832169,-121.1387959 38.6832254,-121.138799 38.6832076,-121.1388105 38.6832128,-121.1388074 38.6832327,-121.1387874 38.6832381,-121.138752 38.6832302,-121.1387366 38.6832417,-121.138695 38.6832339,-121.1385471 38.6832224,-121.1385224 38.683223,-121.1385286 38.6832104,-121.1385548 38.6832044,-121.1385616 38.6831932))
 POLYGON((-121.1311171 38.684792,-121.1311037 38.6847962,-121.1311251 38.6846622,-121.1310916 38.6846622,-121.1309334 38.6846622,-121.1309291 38.6847437,-121.1309266 38.684792,-121.1310085 38.6847952,-121.1310125 38.6847847,-121.1311171 38.684792))
 POLYGON((-122.2777271 38.2831574,-122.2771745 38.2831878,-122.2771544 38.2831889,-122.2771352 38.2827884,-122.2771203 38.2827892,-122.2778086 38.282753,-122.2778108 38.2827783,-122.278053 38.2827653,-122.2780613 38.2828595,-122.2778704 38.2828698,-122.2778923 38.2831174,-122.2777244 38.2831265,-122.2777271 38.2831574))

--
NOTICE:  Self-intersection at or near point -116.28274171351045 33.729337130768805
NOTICE:  Self-intersection at or near point -116.27560652752226 33.744068131138171
NOTICE:  Self-intersection at or near point -121.14530502440944 38.688227549606296
NOTICE:  Self-intersection at or near point -121.13856157201428 38.683193246094113
NOTICE:  Self-intersection at or near point -121.13110451105652 38.684791121421732
NOTICE:  Self-intersection at or near point -122.2771352007823 38.282788416318006

Last modified 5 years ago Last modified on Sep 26, 2019, 7:38:08 AM
Note: See TracWiki for help on using the wiki.