mapscript.shapefileObj¶
- class mapscript.shapefileObj(filename: char, type: int = -1)¶
- An object representing a Shapefile. There is no write access to this object using MapScript. - Attributes - bounds- rectObjimmutable Extent of shapes- numshapes- int immutable Number of shapes - thisown- The membership flag - type- int immutable Shapefile type - see mapshape.h for values of type - Methods - __init__(filename: char, type: int = -1)[burim]¶
- Create a new instance. Omit the type argument or use a value of -1 to open an existing shapefile. - Type should be one of - MS_SHAPEFILE_POINT,- MS_SHAPEFILE_ARC,- MS_SHAPEFILE_POLYGONor- MS_SHAPEFILE_MULTIPOINT
 - add(shape: shapeObj) int[burim]¶
- Appends a shape to the open shapefile. Returns - MS_SUCCESSor- MS_FAILURE
 - addPoint(point: pointObj) int[burim]¶
- Appends a point to the open shapefile. Returns - MS_SUCCESSor- MS_FAILURE
 - get(i: int, shape: shapeObj) int[burim]¶
- Get the shapefile feature from index i and store it in shape. Returns - MS_SUCCESSor- MS_FAILURE
 - getExtent(i: int, rect: rectObj) void[burim]¶
- Retrieve a shape’s bounding box by index and stores it in rect. 
 - getPoint(i: int, point: pointObj) int[burim]¶
- Returns the point feature at index i and store it in pointObj. 
 - getShape(i: int) shapeObj[burim]¶
- Returns the shapefile feature at index i. More efficient than get. 
 - getTransformed(map: mapObj, i: int, shape: shapeObj) int[burim]¶
- Returns the feature at index i, simplify it, and store it in shape. Uses the map extent and cellsize for simplification. Returns - MS_SUCCESSor- MS_FAILURE
 













 
        
          
            