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 interfaceDefines some kind of processing of anorg.opengis.feature.Feature. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe character encoding that is used by default, "UTF-8". -
Constructor Summary
ConstructorsConstructorDescriptionShapefileProcessor(ShapefileProcessor.FeatureProcessor featureProcessor) Creates a newShapefileProcessorthat processes features in a shapefile using the givenShapefileProcessor.FeatureProcessor. -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessShapefile(URL shapefileUrl) Processes a shapefile read from the given URL with the givenShapefileProcessor.FeatureProcessorthat determines what to do with each individualorg.opengis.feature.Featurein the file.voidsetCharacterEncoding(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 newShapefileProcessorthat processes features in a shapefile using the givenShapefileProcessor.FeatureProcessor.- Parameters:
featureProcessor- theFeatureProcessorto use, must not benull
-
-
Method Details
-
processShapefile
Processes a shapefile read from the given URL with the givenShapefileProcessor.FeatureProcessorthat determines what to do with each individualorg.opengis.feature.Featurein 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
-