ESRI shapes --again
Wed, 28 Jul 1999 16:28:58 +0800 (SST)
thanks to all the help so far I have code now that works on windows
(albeit very clunky) that can read the pertinent info from the shape header
and return a list with all the necessary parameters to read info out of
the shape file. Now come the big design questions
1) I have considered building a map object, basically a list that would
hold the info from the shape file and a data frame as part of the list.
Should all of the vertices of a shape be stored in this structure? I can
see this getting big really fast. My idea was to store only offset and the
size of each record and whenever a shape needs to be plotted or accessed
the vertices can be retrived from the .shp file through an access function.
the problem is if the user wants to project the map all projections will
have to be done on the fly as the vertices are accessed.
for those who don't know shape files are stored in 3 files, .shp .shx and .dbf
the .shp file holds the geometric information, the .shx file holds the
ofsets and the record sizes for each shape, and the .dbf file holds the
which brings me to question 2
2) the .dbf file contains the attribute information, so I
basically nead to write another version of read.table to access the dbf
file and store it as a data frame (the natural equivalent of an ArcView
data table). Is there a way to extend or access the functions of read.table
to construct a data frame without using a lot of memory building seperate
vectors and factors etc. and binding them into a data frame.
3) I have been cheating. Dr. Ripley suggested I start compiling this as
a package, using the supplied make files. Very sensible advice, however I am
not exactly sure how to do this on windows. I have checked the faq which
says there is a sample Makefile in the eda package, I assume this
is Unix only couldn't find it. So to do this as far as I can tell from the
dcumentation I could get my hands on I need to make a folder in
\rw0642\src\library and put the subdirectories R, src, man and data and
then run make? Or am I missing something?
Thanks again for all the help.
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: email@example.com