Handbook
Glossary
write-shp ( shapes -- header indices )
Vocabulary
shapefiles
.
private
Inputs
shapes
an
object
Outputs
header
an
object
indices
an
object
Definition
USING:
accessors
combinators
io
io.encodings.binary
io.streams.byte-array
kernel
math
sequences
;
IN:
shapefiles.private
:
write-shp
( shapes -- header indices )
[
header
new
]
dip
{
[
check-shape-types
]
[
first
shape-type
>>shape-type
]
[
[
update-bounds
]
each
]
[
]
}
cleave
binary
[
[
[
tell-output
100
+
2/
]
2dip
write-record
tell-output
100
+
8
-
2/
over
-
index
boa
]
map-index
]
with-byte-writer
swap
[
[
length
100
+
2/
>>file-length
[
write-header
]
keep
]
[
write
]
bi
]
dip
;