This work is based on the Java ESRI Shape File Reader which is distributed under the terms of the Apache License Version 2.0.
The source code has been copied from Sourceforge in July 2014 http://sourceforge.net/projects/javashapefilere/
There's the library org.geotools:gt-shapefile which can be used for
working with shapefiles. If you don't want to pull in 12Mb of transitive
dependencies but rather work with a rather small library of a few dozen
kB in size, this library could be a better choice. This library has a
bunch of dependencies itself, but they accumulate to roughly 2Mb in size.
We provide access to the artifacts via our own Maven repository:
The package is available at these coordinates:
de.topobyte:shapefile4j:0.3.0
This repository also ships a small set of command line tools from the
util module.
To build and install the executables, run:
./install.shThis builds the distribution and runs the generated installer from
util/build/setup/.
The installer creates symlinks for the commands in:
$HOME/binMake sure that directory is part of your PATH, for example:
export PATH="$PATH:$HOME/bin"The following commands are installed:
ShapefileInfoshow file sizes, record counts and bounding box informationShapefileShowFieldsprint the DBF field definitionsShapefileDumpDataprint all rows from the associated DBF tableShapefileToSmxCollectionconvert all geometries plus DBF attributes into a directory of SMX files