[libgfc Index] [libgfc Hierarchy] [Headers]
ArcView shapefile reader class. More...
#include <utils/src/gshapefile.h>
If you want to read associated attributes for each shape record, use the class DBFile that comes with this class for that purpose. This class only reads the geometry record in the .shp file which
is indexed by the .shx file. DBFile will read the .dbf file or tabular attributes. The tabular records and the geometry records have one-to-one mappings, and appear in the same order in the .shp file and .dbf file respectively.
[public]
this constructor automatically opens the named shapefile for read access.
[public]
print the basic info. about the shapefile to the console.
[public]
GShapeFile :: openShapeFile --
Given a shape file name, tries to open the corresponding .shp, .shx, and .dbf files. If success then read the header info into in-memory structure. The files will be memory-mapped.
Return 0 upon success, otherwise -1.
Side effects: The three files are opened and header structures read into memory. Ready to retrieve individual shape/attribute records.
[public]
return the type of shape record in a shapefile. It is one of the following types: av_Point, av_Arc, av_Polygon, av_MultiPoint, and av_Null if unknown.
[public]
return the number of records in a shapefile
[public]
return the universal bounding rectangle for all the shape records in a shapefile.
[public]
retrieve a shape record's information.
Return NULL if failed. Otherwise the following values are set properly: verticies: contains all the verticies parts: contains the parts index (in the unit of vertices) into the "vertices" array. Each verticy has two double coordinates. n_parts: number of parts n_verts: number of total vertices (summed over all parts) vertices: the array of vertices (pair of doubles).
[public]
return the pointer to the nth spatial record as a GFC ADT object. the returned pointer points to a memory address owned by this GShapeFile object.
[public]
retrieves a shape record as a spatial GFC ADT. val must be a valid pointer to the proper type of GFC ADTs. The following is the correspondence between ArcView spatial types and GFC spatail ADTs: ArcView GFC point GPoint arc GArc polygon GPolygon multi-point not-supported yet
[public]
retrieve the mbr of 'nth' shape record
[protected]
make full path to the shape file
[protected]
get the offset (in bytes) of the nth record in the main (.shp) file. The offset is relative to the beginning of the file and starts with 0.
nth | is the number of record of concern. starts w/ 0. |
len | is the content length (in byte) of the record. |
[protected]
gives advice about how the shapefile will be accessed
Documentation generated by lqian@lqian-sun on Wed Jul 14 09:36:10 EDT 1999 | Kdoc |