public class ShapefileLoader
extends java.lang.Object
This 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.
Constructor and Description |
---|
ShapefileLoader(java.io.InputStream in)
Creates a ShapefileLoader object using an input stream.
|
Modifier and Type | Method and Description |
---|---|
LineMap |
readLineMap()
Retrieves a LineMap object from the Shapefile input stream.
|
public ShapefileLoader(java.io.InputStream in)
in
- public LineMap readLineMap() throws java.io.IOException
java.io.IOException