]> gitweb.factorcode.org Git - factor.git/commitdiff
shapefiles: use null-shape singleton for... null shapes.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 19 Feb 2018 00:08:18 +0000 (16:08 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 19 Feb 2018 00:08:18 +0000 (16:08 -0800)
extra/shapefiles/shapefiles.factor

index 34fbbb368565548559c32015730fd3488a54a32b..49a85d143886bd67cf13c0233b01e13680736830 100644 (file)
@@ -47,6 +47,8 @@ y-min x-max y-max z-min z-max m-min m-max ;
     read-double
     header boa ;
 
+SINGLETON: null-shape
+
 TUPLE: point x y ;
 
 : read-point ( -- point )
@@ -141,7 +143,7 @@ m-range m-array ;
 
 : read-shape ( -- shape )
     4 read le> {
-        { 0 [ null ] }
+        { 0 [ null-shape ] }
         { 1 [ read-point ] }
         { 3 [ read-polyline ] }
         { 5 [ read-polygon ] }