docs: @Pure
  	public static URL generateShapeFileIndexFromShapeFile(File shapeFile) throws IOException {
  		final File shxFile = FileSystem.replaceExtension(shapeFile, "." + ShapeFileIndexFilter.EXTENSION_SHX); //$NON-NLS-1$
  
  		try (ShapeFileReader<Object> shpReader = new ShapeFileReader<>(shapeFile, new NullFactory())) {
  
  			try (ShapeFileIndexWriter shxWriter = new ShapeFileIndexWriter(
  					shxFile,
  					shpReader.getShapeElementType(),
  					shpReader.getBoundsFromHeader())) {
  				int offset = shpReader.getFileReadingPosition();
  				int newOffset;
  				int shpLength;
  
  				while (shpReader.read() != null) {
  					newOffset = shpReader.getFileReadingPosition();
  					// byte length - file header length - record header length
  					shpLength = newOffset - offset;
  					shxWriter.write(shpLength);
  					offset = newOffset;
  				}
  			}
  		}
  
  		return shxFile.toURI().toURL();
  	}