Package com.reallifedeveloper.tools.gis
Class ShapefileProcessor
java.lang.Object
com.reallifedeveloper.tools.gis.ShapefileProcessor
Reads a shapefile and processes it in some way.
One example of use is to create a version that converts a shapefile into SQL insert statements.
- Author:
- RealLifeDeveloper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Defines some kind of processing av anorg.opengis.feature.Feature
. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The character encoding that is used by default, "UTF-8". -
Constructor Summary
ConstructorsConstructorDescriptionShapefileProcessor
(ShapefileProcessor.FeatureProcessor featureProcessor) Creates a newShapefileProcessor
that processes features in a shapefile using the givenShapefileProcessor.FeatureProcessor
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
processShapefile
(URL shapefileUrl) Processes a shapefile read from the given URL with the givenShapefileProcessor.FeatureProcessor
that determines what to do with each individualorg.opengis.feature.Feature
in the file.void
setCharacterEncoding
(String newCharacterEncoding) Sets the character encoding to use in the shapefile that is created.
-
Field Details
-
DEFAULT_CHARACTER_ENCODING
The character encoding that is used by default, "UTF-8".- See Also:
-
-
Constructor Details
-
ShapefileProcessor
Creates a newShapefileProcessor
that processes features in a shapefile using the givenShapefileProcessor.FeatureProcessor
.- Parameters:
featureProcessor
- theFeatureProcessor
to use, must not benull
-
-
Method Details
-
processShapefile
Processes a shapefile read from the given URL with the givenShapefileProcessor.FeatureProcessor
that determines what to do with each individualorg.opengis.feature.Feature
in the file.- Parameters:
shapefileUrl
- a URL to the shapefile- Throws:
IOException
- if there was a problem reading the shapefile
-
setCharacterEncoding
Sets the character encoding to use in the shapefile that is created.- Parameters:
newCharacterEncoding
- the new character encoding
-