Package lejos.robotics.mapping
Class ShapefileLoader
- java.lang.Object
-
- lejos.robotics.mapping.ShapefileLoader
-
public class ShapefileLoader extends java.lang.ObjectThis class loads map data from a Shapefile and produces a LineMap object, which can be used by the leJOS navigation package.
There are many map editors which can use the Shapefile format (OpenEV, Global Mapper). Once you have created a map, export it as Shapefile. This will produce three files ending in .shp .shx and .dbf. The only file used by this class is .shp.
NOTE: Shapefiles can only contain one type of shape data (polygon or polyline, not both). A single file can't mix polylines with polygons.
This class' code can parse points and multipoints. However, a LineMap object can't deal with points (only lines) so points and multipoints are discarded.
- Author:
- BB
-
-
Constructor Summary
Constructors Constructor Description ShapefileLoader(java.io.InputStream in)Creates a ShapefileLoader object using an input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LineMapreadLineMap()Retrieves a LineMap object from the Shapefile input stream.
-
-
-
Method Detail
-
readLineMap
public LineMap readLineMap() throws java.io.IOException
Retrieves a LineMap object from the Shapefile input stream.- Returns:
- the line map
- Throws:
java.io.IOException
-
-