from
MEX_SHAPE
by John Evans
Reads in common ESRI shapefile formats.
|
| Chapter 1. Introduction |
This code will provide you with a mexfile that will read (not write)
certain ESRI shapefiles without having to purchase the Mapping Toolbox
from MATLAB. By "certain shapefiles" I mean SHPT_POINT (point),
SHPT_MULTIPOINT, SHPT_ARC, (simple polyline), or SHPT_POLYGON (simple
polygon). There are a slew of other possibilities, but I have yet to run
into a shapefile that did not get classified as one of these four (the
code is written to throw an exception if an unknown type is encountered).
The mex file itself returns a structure for each shape that is read.
Because that can be a little annoying when dealing with point shapefiles,
a wrapper routine (shape_get.m) for the mex file is provided that
allows the user to optionally collect each of the points into a vector.
It's probably a good idea to use the wrapper routine exclusively.
|
|
Contact us at files@mathworks.com